NoSpam!
"NoSpam!" позволяет Вам определять ряд вопросов, на которые пользователи обязаны правильно ответить при регистрации, устраняя способность спамящих ботов регистрироваться на ваших форумах и оставлять нежелательные сообщения (Перевод: Romchik® v.1.0.4)
4.0
http://www.vbulletin.org/forum/showthread.php?t=183329
]]>
Cache the NoSpam! template
cache_templates
options['nospam_onoff'])
{
switch (THIS_SCRIPT) {
case 'register':
if ($vbulletin->options['nospam_use_reg']) {
$globaltemplates[] = 'nospam';
}
break;
case 'search':
if ($vbulletin->options['nospam_use_search']) {
$globaltemplates[] = 'nospam';
}
break;
case 'newreply':
case 'newthread':
if ($vbulletin->options['nospam_use_post']) {
$globaltemplates[] = 'nospam';
}
break;
case 'sendmessage':
if ($vbulletin->options['nospam_use_contactus']) {
$globaltemplates[] = 'nospam';
}
break;
}
}]]>
Check if NoSpam! question has been answered correctly
newpost_process
input->clean_array_gpc('p', array(
'nospamnumber' => TYPE_UINT,
'nospam' => TYPE_STR,
));
if ($vbulletin->options['nospam_onoff'] AND !$vbulletin->userinfo['userid'] AND $vbulletin->options['nospam_use_post'])
{
$nospamnumber = $vbulletin->GPC['nospamnumber'];
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$qanda = explode(":", strtolower($questions["$nospamnumber"]));
unset($qanda[0]);
function trim_array(&$answer)
{
$answer = trim($answer);
}
array_walk($qanda, 'trim_array');
if (!in_array(strtolower(trim($vbulletin->GPC['nospam'])), $qanda))
{
eval(standard_error(fetch_error('nospam_wrong_answer')));
}
}]]>
Generate and insert NoSpam! question
newreply_form_complete
options['nospam_onoff'] AND !$vbulletin->userinfo['userid'] AND $vbulletin->options['nospam_use_post'])
{
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$nospamnumber = array_rand($questions);
$qanda = explode(":",$questions["$nospamnumber"]);
$nospamquestion = $qanda[0];
eval('$human_verify .= "' . fetch_template('nospam') . '";');
}]]>
Generate and insert NoSpam! question
newthread_form_complete
options['nospam_onoff'] AND $vbulletin->options['nospam_use_post'] AND !$vbulletin->userinfo['userid'])
{
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$nospamnumber = array_rand($questions);
$qanda = explode(":",$questions["$nospamnumber"]);
$nospamquestion = $qanda[0];
eval('$human_verify .= "' . fetch_template('nospam') . '";');
}]]>
Check if NoSpam! question has been answered correctly
register_addmember_process
input->clean_array_gpc('p', array(
'nospamnumber' => TYPE_UINT,
'nospam' => TYPE_STR,
));
if ($vbulletin->options['nospam_onoff'] AND $vbulletin->options['nospam_use_reg'])
{
$nospamnumber = $vbulletin->GPC['nospamnumber'];
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$qanda = explode(":", strtolower($questions["$nospamnumber"]));
unset($qanda[0]);
function trim_array(&$answer)
{
$answer = trim($answer);
}
array_walk($qanda, 'trim_array');
if (!in_array(strtolower(trim($vbulletin->GPC['nospam'])), $qanda))
{
$userdata->error('nospam_wrong_answer');
}
}]]>
Generate and insert NoSpam! question
register_form_complete
options['nospam_onoff'] AND !$vbulletin->userinfo['userid'] AND $vbulletin->options['nospam_use_reg'])
{
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$nospamnumber = array_rand($questions);
$qanda = explode(":",$questions["$nospamnumber"]);
$nospamquestion = $qanda[0];
eval('$human_verify .= "' . fetch_template('nospam') . '";');
}]]>
Generate and insert NoSpam! question
search_complete
options['nospam_onoff'] AND !$vbulletin->userinfo['userid'] AND $vbulletin->options['nospam_use_search'])
{
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$nospamnumber = array_rand($questions);
$qanda = explode(":",$questions["$nospamnumber"]);
$nospamquestion = $qanda[0];
eval('$human_verify .= "' . fetch_template('nospam') . '";');
}]]>
Check if NoSpam! question has been answered correctly
search_process_start
input->clean_array_gpc('p', array(
'nospamnumber' => TYPE_UINT,
'nospam' => TYPE_STR,
));
if ($vbulletin->options['nospam_onoff'] AND !$vbulletin->userinfo['userid'] AND $vbulletin->options['nospam_use_search'])
{
$nospamnumber = $vbulletin->GPC['nospamnumber'];
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$qanda = explode(":", strtolower($questions["$nospamnumber"]));
unset($qanda[0]);
function trim_array(&$answer)
{
$answer = trim($answer);
}
array_walk($qanda, 'trim_array');
if (!in_array(strtolower(trim($vbulletin->GPC['nospam'])), $qanda))
{
eval(standard_error(fetch_error('nospam_wrong_answer')));
}
}]]>
Generate and insert NoSpam! question
sendmessage_contactus_complete
options['nospam_onoff'] AND !$vbulletin->userinfo['userid'] AND $vbulletin->options['nospam_use_contactus'])
{
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$nospamnumber = array_rand($questions);
$qanda = explode(":",$questions["$nospamnumber"]);
$nospamquestion = $qanda[0];
eval('$human_verify .= "' . fetch_template('nospam') . '";');
}]]>
Check if NoSpam! question has been answered correctly
sendmessage_docontactus_process
input->clean_array_gpc('p', array(
'nospamnumber' => TYPE_UINT,
'nospam' => TYPE_STR,
));
if ($vbulletin->options['nospam_onoff'] AND !$vbulletin->userinfo['userid'] AND $vbulletin->options['nospam_use_contactus'])
{
$nospamnumber = $vbulletin->GPC['nospamnumber'];
$questions = explode("\n", $vbulletin->options['nospam_questions']);
$qanda = explode(":", strtolower($questions["$nospamnumber"]));
unset($qanda[0]);
function trim_array(&$answer)
{
$answer = trim($answer);
}
array_walk($qanda, 'trim_array');
if (!in_array(strtolower(trim($vbulletin->GPC['nospam'])), $qanda))
{
eval(standard_error(fetch_error('nospam_wrong_answer')));
}
}]]>
Вопрос:Ответ1:Ответ2:Ответ3 и т.д. Примеры:
2 + 2 равняется...:4:четыре
Пожалуйста, напечатайте без кавычек слово "Вася" в поле снизу:Вася
Имя первого космонавта Гагарина (по-русски)?:Юрий:Юра
Введите набор из вопроса и ответа(-ов) в каждой строчке. Имейте ввиду, ответы не чувствительны к регистру, и, поскольку двоеточия используются для отделения вопроса и ответа(-ов), то не должно быть никаких двоеточий в самих вопросах или ответах.]]>
boolean
yesno
0
free
textarea
boolean
yesno
1
boolean
yesno
1
boolean
yesno
1
boolean
yesno
1