You'll find this when registering:
- If the bot writes in the wrong box (or in more than one) it will return an error.
- If the bot writes a wrong number/text it will return an error.
- If the bot doesn't select the box on the left it will return an error.
A bot will not be able to read all the information and will fail. The field you have to fill is random and the field name too (in the shot you can see it's the third option, but it is randomly ordered.
Installation instructions
Spoiler: [ Show ]
Spoiler: [ Hide ]
##############################################################
## MOD Title: Anti bot question (for Icy Phoenix)
## MOD Author: KasLimon < N/A > (N/A) http://www.customphpbb.es
## MOD Description: This mod tries to avoid Bot registration in your forum with a couple of options. You have to select
## only one, fill a field with a specific data and leave the rest empty. The order of the fields is randomly
## changed and the name and quantity is choosen by you.
##
## MOD Version: 0.0.1-beta
##
## Installation Level: Easy
## Installation Time: 2 Minutes
##
## Files To Edit: (5)
## includes/constants.php
## includes/usercp_register.php
## language/lang_english/lang_main.php
## language/lang_spanish/lang_main.php
## templates/mg_themes/profile_register_body.tpl
##
## Included Files: (0)
##
## License: http://opensource.org/licenses/GPL-license.php GNU General Public License v2
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
define('RANDOM_REGISTER_SELECTOR', 'klmcpbb');// Change klmcpbb with anything
define('RANDOM_REGISTER_VALUE', '1708');// Change 1708 with any number (please note it should not be long).
define('CS_BOXES', 4);// 4 boxes should be enough
// Anti bot question - END
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
rawurlencode($website);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
if($mode == 'register')
{
// check for the right box selection
if ($HTTP_POST_VARS[RANDOM_REGISTER_SELECTOR] != $board_config['max_sig_chars'] . RANDOM_REGISTER_VALUE)
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['CCS_fail2'];
}
// check for VIP code
if ($HTTP_POST_VARS[RANDOM_REGISTER_SELECTOR . 'vc'] != RANDOM_REGISTER_VALUE)
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . sprintf($lang['CCS_fail1'], RANDOM_REGISTER_VALUE) . '.';
}
// now check the other boxes are empty
for ($cs=1; $cs <= CS_BOXES; $cs++)
{
if (!empty($HTTP_POST_VARS[RANDOM_REGISTER_SELECTOR . $cs . 'vc']))
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['CCS_fail3'];
}
}
}
// Anti bot question - END
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('switch_confirm', array());
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
if ($mode == 'register')
{
$cs_boxes = CS_BOXES;
$cs_correct = rand(1, $cs_boxes);
for ($cs=1; $cs <= $cs_boxes; $cs++)
{
$cs_html .= '<input type="radio" value="';
if ($cs == $cs_correct)
{
$cs_html .= $board_config['max_sig_chars'] . RANDOM_REGISTER_VALUE;
}
else
{
$cs_html .= $board_config['max_sig_chars'] . $cs . RANDOM_REGISTER_VALUE;
}
$cs_html .= '" name="'.RANDOM_REGISTER_SELECTOR.'" /> '.(($cs == $cs_correct) ? $lang['Write'] .' <b>'.RANDOM_REGISTER_VALUE.'</b>': $lang['dontWrite']). ' ' . $lang['here'] . ': <input type="text" value="" name="';
if ($cs == $cs_correct)
{
$cs_html .= RANDOM_REGISTER_SELECTOR . 'vc';
}
else
{
$cs_html .= RANDOM_REGISTER_SELECTOR . $cs . 'vc';
}
$cs_html .= '" />';
if ($cs != $cs_boxes) $cs_html .= '<br />';
}
$cs_html = '<span class="gensmall">' . $cs_html . '</span>';
$template->assign_block_vars('switch_bots_cs', array(
'SELECTBOX' => $cs_html,
'L_CONFIRM_CODE_SELECTOR' => $lang['CCS'],
'L_CONFIRM_CODE_SELECTOR_E' => $lang['CCSE'])
);
}
// Anti bot question - END
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
$lang['Write'] = 'Write';
$lang['dontWrite'] = 'Don't write';
$lang['here'] = 'here';
$lang['CCS'] = 'Verification code';
$lang['CCSE'] = 'Please write the code specified in the correct box and activate the radio on the left and you'll be allowed to register here, otherwise, your register will be denied.';
$lang['CCS_fail1'] = 'Your code is wrong. The correct one is %s.';
$lang['CCS_fail2'] = 'You haven't selected the appropiate confirmation box. You've not passed the anti robot control.';
$lang['CCS_fail3'] = 'Please write ONLY in the specified box.';
// Anti bot question - END
#
#-----[ OPEN ]------------------------------------------
#
templates/mg_themes/profile_register_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END switch_confirm -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN switch_bots_cs -->
<tr>
<td class="row1"><span class="gen">{switch_bots_cs.L_CONFIRM_CODE_SELECTOR}: * </span><br /><span class="gensmall">{switch_bots_cs.L_CONFIRM_CODE_SELECTOR_E}</span></td>
<td class="row2">{switch_bots_cs.SELECTBOX}</td>
</tr>
<!-- END switch_bots_cs -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
## MOD Title: Anti bot question (for Icy Phoenix)
## MOD Author: KasLimon < N/A > (N/A) http://www.customphpbb.es
## MOD Description: This mod tries to avoid Bot registration in your forum with a couple of options. You have to select
## only one, fill a field with a specific data and leave the rest empty. The order of the fields is randomly
## changed and the name and quantity is choosen by you.
##
## MOD Version: 0.0.1-beta
##
## Installation Level: Easy
## Installation Time: 2 Minutes
##
## Files To Edit: (5)
## includes/constants.php
## includes/usercp_register.php
## language/lang_english/lang_main.php
## language/lang_spanish/lang_main.php
## templates/mg_themes/profile_register_body.tpl
##
## Included Files: (0)
##
## License: http://opensource.org/licenses/GPL-license.php GNU General Public License v2
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
define('RANDOM_REGISTER_SELECTOR', 'klmcpbb');// Change klmcpbb with anything
define('RANDOM_REGISTER_VALUE', '1708');// Change 1708 with any number (please note it should not be long).
define('CS_BOXES', 4);// 4 boxes should be enough
// Anti bot question - END
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
rawurlencode($website);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
if($mode == 'register')
{
// check for the right box selection
if ($HTTP_POST_VARS[RANDOM_REGISTER_SELECTOR] != $board_config['max_sig_chars'] . RANDOM_REGISTER_VALUE)
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['CCS_fail2'];
}
// check for VIP code
if ($HTTP_POST_VARS[RANDOM_REGISTER_SELECTOR . 'vc'] != RANDOM_REGISTER_VALUE)
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . sprintf($lang['CCS_fail1'], RANDOM_REGISTER_VALUE) . '.';
}
// now check the other boxes are empty
for ($cs=1; $cs <= CS_BOXES; $cs++)
{
if (!empty($HTTP_POST_VARS[RANDOM_REGISTER_SELECTOR . $cs . 'vc']))
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['CCS_fail3'];
}
}
}
// Anti bot question - END
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('switch_confirm', array());
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
if ($mode == 'register')
{
$cs_boxes = CS_BOXES;
$cs_correct = rand(1, $cs_boxes);
for ($cs=1; $cs <= $cs_boxes; $cs++)
{
$cs_html .= '<input type="radio" value="';
if ($cs == $cs_correct)
{
$cs_html .= $board_config['max_sig_chars'] . RANDOM_REGISTER_VALUE;
}
else
{
$cs_html .= $board_config['max_sig_chars'] . $cs . RANDOM_REGISTER_VALUE;
}
$cs_html .= '" name="'.RANDOM_REGISTER_SELECTOR.'" /> '.(($cs == $cs_correct) ? $lang['Write'] .' <b>'.RANDOM_REGISTER_VALUE.'</b>': $lang['dontWrite']). ' ' . $lang['here'] . ': <input type="text" value="" name="';
if ($cs == $cs_correct)
{
$cs_html .= RANDOM_REGISTER_SELECTOR . 'vc';
}
else
{
$cs_html .= RANDOM_REGISTER_SELECTOR . $cs . 'vc';
}
$cs_html .= '" />';
if ($cs != $cs_boxes) $cs_html .= '<br />';
}
$cs_html = '<span class="gensmall">' . $cs_html . '</span>';
$template->assign_block_vars('switch_bots_cs', array(
'SELECTBOX' => $cs_html,
'L_CONFIRM_CODE_SELECTOR' => $lang['CCS'],
'L_CONFIRM_CODE_SELECTOR_E' => $lang['CCSE'])
);
}
// Anti bot question - END
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
$lang['Write'] = 'Write';
$lang['dontWrite'] = 'Don't write';
$lang['here'] = 'here';
$lang['CCS'] = 'Verification code';
$lang['CCSE'] = 'Please write the code specified in the correct box and activate the radio on the left and you'll be allowed to register here, otherwise, your register will be denied.';
$lang['CCS_fail1'] = 'Your code is wrong. The correct one is %s.';
$lang['CCS_fail2'] = 'You haven't selected the appropiate confirmation box. You've not passed the anti robot control.';
$lang['CCS_fail3'] = 'Please write ONLY in the specified box.';
// Anti bot question - END
#
#-----[ OPEN ]------------------------------------------
#
templates/mg_themes/profile_register_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- END switch_confirm -->
#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN switch_bots_cs -->
<tr>
<td class="row1"><span class="gen">{switch_bots_cs.L_CONFIRM_CODE_SELECTOR}: * </span><br /><span class="gensmall">{switch_bots_cs.L_CONFIRM_CODE_SELECTOR_E}</span></td>
<td class="row2">{switch_bots_cs.SELECTBOX}</td>
</tr>
<!-- END switch_bots_cs -->
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Spanish language
#
#-----[ OPEN ]------------------------------------------
#
language/lang_spanish/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
$lang['Write'] = 'Escriba';
$lang['dontWrite'] = 'No escriba';
$lang['here'] = 'aquí';
$lang['CCS'] = 'Código de verificación';
$lang['CCSE'] = 'Escriba el código que se indica en el cuadro que se indica y seleccione el botón de su izquierda y tendrá permiso para registrarse, en caso contrario, su petición será denegada.';
$lang['CCS_fail1'] = 'Su código de verificación es incorrecto. El código correcto es %s.';
$lang['CCS_fail2'] = 'No ha seleccionado la opción correcta de la confirmación. No se ha pasado el control anti robots.';
$lang['CCS_fail3'] = 'Escriba sólo en el cuadro especificado.';
// Anti bot question - END
#-----[ OPEN ]------------------------------------------
#
language/lang_spanish/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// Anti bot question - BEGIN
$lang['Write'] = 'Escriba';
$lang['dontWrite'] = 'No escriba';
$lang['here'] = 'aquí';
$lang['CCS'] = 'Código de verificación';
$lang['CCSE'] = 'Escriba el código que se indica en el cuadro que se indica y seleccione el botón de su izquierda y tendrá permiso para registrarse, en caso contrario, su petición será denegada.';
$lang['CCS_fail1'] = 'Su código de verificación es incorrecto. El código correcto es %s.';
$lang['CCS_fail2'] = 'No ha seleccionado la opción correcta de la confirmación. No se ha pasado el control anti robots.';
$lang['CCS_fail3'] = 'Escriba sólo en el cuadro especificado.';
// Anti bot question - END
Anti bot question Mod Configuration
Spoiler: [ Show ]
Spoiler: [ Hide ]
You can edit the configuration at the end of the file includes/constants.php
You can change the number of fields displayed. (4 by default, but you can use as many as you want).
You can (you should) change the field name for the text fields
This name is not shown to users, but it is to bots. Don't choose a name like "anti bot question", choose something not known, or an acronym...
You can (you should) change the code (1708 by default)
This is the code that users will have to write. Don't make it very long or it will be very hard to users.
You can change the number of fields displayed. (4 by default, but you can use as many as you want).
You can (you should) change the field name for the text fields
- define('RANDOM_REGISTER_SELECTOR', 'klmcpbb');// Change klmcpbb with anything
You can (you should) change the code (1708 by default)
This is the code that users will have to write. Don't make it very long or it will be very hard to users.
This mod is not a replacement for Visual confirmation. For more security, please activate Visual Confirmation and Accounts activation by the users.
This mod is based on VIP Code mod (the original mod asks you to enter a "VIP Code" on a field, this mod extends its function)
Greets