JohnnyComeLately wrote:Maybe I'm misunderstanding, but in the 10-15 pages I've read, it seems like we're limited in our custom fields capability. For example, I can't say, "Type in the color of white rice" and then have it check to make sure they typed in "white". It appears we can only set a default, and what it CAN"T be when entered. Is this correct?
Currently, the "Numbers" type custom field is probably the best one for antispam purposes because it's the only one where you can set a specific required answer (but for best results, you should also edit the language file as indicated previously so the error message doesn't give away the answer).
You're right that with the "Dropdown box" field, all you can do is specify one possibility (usually the default) as the WRONG answer, and any other answer will be accepted. I pointed out in my earlier post at http://www.phpbb.com/community/viewtopi ... 5#p8935075
that this is probably too easy for spambots to defeat.
You cannot, in the current version of phpBB, create a custom TEXT field with specific required answer (such as the word "white"). You could, however, do it with a simple code change, as follows:
Code: Select all
In file includes/functions_profile_fields.php
Find the lines:
if (empty($field_value) && !$field_data['field_required'])
else if (empty($field_value) && $field_data['field_required'])
Then change the last of the above lines to:
else if ($field_data['field_required'] && strtolower($field_value) !== 'white')
Here, the intended answer (white) would be hard-wired into the code. Use of the strtolower function allows the user's answer to be case-independent (e.g., answers of "WHITE" and "White" will also be accepted). With this change, you'd be limited to only one text-type required custom field on your board, although you could still have other non-required custom text fields.
If you want a great deal more flexibility for custom antispam questions, install the Anti-Bot Question
MOD referenced at the beginning of this thread.