The idea is to ask the spam bot a question which it does not expect, but it will be no problem for the users to answer. I’ve added to the registration form the question “How much is 5+2 ?”. Most of the new forum members were able to answer it on the first attempt. But spam bots had no clue.
So until someone bothers to write a spam bot specifically for my forums – I am okay. When it happens, I’ll just change the question. It can be many things: “What was the color of the white horse of Hammurabi?” or “How long did the six-day war lasted?” and so on. You got the point.
Here is how to do it.
In the template directory, edit profile_add_body.tpl, and add a new row the the form:
<td class="row1"><span class="gen">How much is 5+2 *</span></td>
<input type="text" class="post" style="width: 200px" name="math_question" size="6" maxlength="6" value="" />
Browse to the registration page on your forum to see that it looks right.
In includes/usercp_register.php, look around line 260, and add the condition that checks if the question was answered properly:
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? ‘<br />’ : ” ) . $lang[‘Fields_empty’];