توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : یک سوال و مشکل درمورد بسته Anti-Bot Registration Puzzles
reza_pa48
11-24-2009, 05:54 PM
سلام
این بسته رو طبق توصیه دوستان اینجا برای رفع شر اسپمر ها نصب کردم و اون تغییری که گفته بود بو فایل egister.template.php دادم اصولا بایستی یه سری سوال در هنگام عضویت بپرسه ولی من همچین صفحه ای دارم برای عضویت
<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b> (<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>)
سلام
آیا شما تغییرات را در register.template.php قالب خودتون اعمال کردید یا قالب پیش فرض؟
موفق باشید
reza_pa48
11-25-2009, 04:00 PM
سلام
من تغییرات در قالب پیش فرض دادم
همونطور که می بینید یک باکس اضافه هست در رجیستر
ایا باید تغییر دیگری هم داد؟
شما باید تغییرات را در فایل register.template.php قالب خودتون بدید
موفق باشید
reza_pa48
11-25-2009, 07:06 PM
عذر می خوام اشتباهی گفتم
تغییرات رو در قالب پیش فرض انجام دادم
باید روی قالب خودتون تغییر بدید
reza_pa48
11-26-2009, 07:41 PM
رو قالب خودم هم تغییر دادم
ولی باز فرقی نکرد و اسپمرها هجوم آوردند
اگر روی قالب خودتون تغییر داده باشید باید فعال شود.
آیا در بقیه فایل ها هم که مشخص شده بود تغییر دادید یا فقط فایل قالب را تغییر دادید؟
reza_pa48
11-27-2009, 08:24 AM
سلام
من فقط فایل register.template.pp رو تغییر دادم
دیگر چی را باید تغییر بدم؟
فایل xml بسته را باز کنید تا ببنید چه فایل های دیگری را نیز باید تغییر دهید
موفق باشید
reza_pa48
11-28-2009, 12:06 PM
سلام
فایل xml محتویاتش اینه
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "">
<package-info xmlns="<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b> xmlns:smf="<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>
<name>Anti-Bot Registration Puzzles</name>
<id>karlbenson:antibotregistrationpuzzles</id>
<type>modification</type>
<version>1.2</version>
<install>
<readme type="file" parsebbc="true">readme.txt</readme>
<modification>install.xml</modification>
</install>
<uninstall>
<modification reverse="true">install.xml</modification>
</uninstall>
</package-info>
فایل install.xml را باز کنید
reza_pa48
11-29-2009, 02:23 PM
شرمنده همه فايل رو ژيست مي كنم اينجا آخه من نفهمسدم چس رو بايد اضافه كنم به چه فايلي
<?xml version="1.0" ?>
<!DOCTYPE modification (View Source for full doctype...)>
- <modification xmlns="<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b> xmlns:smf="<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>
<name>Anti-Bot Registration Puzzles</name>
<id>karlbenson:antibotregistrationpuzzles</id>
<version>1.2</version>
<homepage><b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>
- <file name="$sourcedir/Register.php" error="fatal">
- <operation error="fatal">
- <search position="after" regexp="false" whitespace="exact">
- <![CDATA[ // Are they under age, and under age users are banned?
]]>
</search>
- <add>
- <![CDATA[
// Start of Anti-bot Registration Puzzles Mod
// Checks whether field was completed, if not it goes to an error screen
if(empty($_SESSION['puzzle_dynamic_input']) || empty($_POST[$_SESSION['puzzle_dynamic_input']]))
fatal_lang_error('puzzle_incomplete', false);
// If puzzle was answered incorrectly
elseif (md5(strtolower($_POST[$_SESSION['puzzle_dynamic_input']])) != $_SESSION['puzzle_code'])
fatal_lang_error('puzzle_incorrect', false);
// End of Anti-bot Registration Puzzles Mod
]]>
</add>
</operation>
- <operation error="fatal">
- <search position="before" regexp="false" whitespace="exact">
- <![CDATA[
// Under age restrictions?
if (!empty($modSettings['coppaAge']))
{
$context['show_coppa'] = true;
$context['coppa_desc'] = sprintf($txt['register_age_confirmation'], $modSettings['coppaAge']);
}
]]>
</search>
- <add>
- <![CDATA[
// Start of Anti-bot Registration Puzzles Mod
$puzzles = array(
'shapes' => create_function('', '
$a = array(0 => "sides", 1 => "corners");
$b = rand(0,1);
$c = array(\'square\' => 4, \'rectangle\' => 4, \'pentagon\' => 5,
\'hexagon\' => 6, \'heptagon\' => 7, \'octagon\' => 8);
$d = array_rand($c); // randomly select a shape
$e = $c[$d]; // the answer
global $txt;
$txt[\'puzzle_shapes\'] = sprintf(($d == \'octagon\' ? $txt[\'puzzle_shapes2\'] : $txt[\'puzzle_shapes\']), $txt[\'puzzle_\'.$a[$b]], $txt[\'puzzle_\'.$d]);
return array(\'shapes\', \'\', md5($e));
'),
'math' => create_function('', '
$a = array();
$a[0] = rand(5,19);
$a[1] = rand(1,$a[0]-2);
$a[2] = rand(1,($a[0]-$a[1]-2));
$a[3] = array("+","-");
$a[4] = $a[3][array_rand($a[3])];
$a[5] = $a[3][array_rand($a[3])];
$d = "$a[0]$a[4] $a[1] $a[5] $a[2]";
eval("\$d=" . $d . ";");
return array(\'math\', "<span style=\"font-weight:bold;\">$a[0] $a[4] $a[1] $a[5] $a[2] =</span>", md5($d));
'),
'math2' => create_function('', '
$a = array();
$a[0] = rand(5,19);
$a[1] = rand(1,$a[0]-2);
$a[2] = rand(1,($a[0]-$a[1]-2));
$a[3] = array("+","-");
$a[4] = $a[3][array_rand($a[3])];
$a[5] = $a[3][array_rand($a[3])];
$c = array(rand(0,1),rand(0,1),rand(0,1));
$d = "$a[0]$a[4] $a[1] $a[5] $a[2]";
// Whats the sum/answer
eval("\$d=" . $d . ";");
// Access txt strings
global $txt;
return array(\'math\', \'<span style="font-weight:bold;">\'.($c[0] ? $a[0] : $txt[\'puzzle_\'.$a[0]]).\' \'.$a[4].\' \'.($c[1] ? $a[1] : $txt[\'puzzle_\'.$a[1]]).\' \'.$a[5].\' \'.($c[2] ? $a[2] : $txt[\'puzzle_\'.$a[2]]).\' = </span>\', md5($d));
'),
'colors' => create_function('', '
$a = array(\'red\' => \'#FF0033\', \'orange\' => \'#FF6600\', \'yellow\' => \'#FFFF33\', \'green\' => \'#006600\', \'blue\' => \'#0033FF\', \'purple\' => \'#663366\', \'pink\' => \'#FF9999\', \'black\' => \'#000000\', \'grey\' => \'#999999\');
// Select them randomly
$b = array_rand($a,8);
$c = $b[rand(0,7)]; // the answer
$d = \'\';
// Access txt strings
global $txt;
for($i=0;$i<=7;$i++)
{
// Color or hex? randomly change
$e = rand(0,1);
$j = $i+1;
if($c == $b[$i] || $c == $b[$j])
$d .= \'<span style="font-weight:bold;color:\'. ($e ? $a[$c] : $c ) .\'">\'. $txt[\'puzzle_\'.$c] .\'</span> \';
else
$d .= \'<span style="font-weight:bold;color:\'. ($e ? $a[$b[$i]] : $b[$i] ) .\'">\'. $txt[\'puzzle_\'.$b[$j]] .\'</span> \';
$i++;
}
unset($a,$b,$e,$i,$j);
return array(\'colors\', $d, md5(strtolower($txt[\'puzzle_\'.$c])));
'),
);
// Generate a new puzzle code every time
$_SESSION['puzzle_dynamic_input'] = $_SESSION['puzzle_code'] = '';
// Generate Random field name
$range1 = range('a', 'z');
$range2 = range(0, 9);
// Must start with a letter not a digit
$_SESSION['puzzle_dynamic_input'] = $range1[array_rand($range1)];
// Length over 8
$rand = rand(8,12);
for($i=0;$i<=$rand;$i++)
$_SESSION['puzzle_dynamic_input'] .= (rand(0, 1) == 0) ? $range1[array_rand($range1)] : $range2[array_rand($range2)];
unset($range1, $range2, $rand);
// Choose a puzzle
$context['puzzle'] = $puzzles[array_rand($puzzles)]();
$_SESSION['puzzle_code'] = $context['puzzle'][2];
$context['puzzle'][2] = $_SESSION['puzzle_dynamic_input'];
unset($puzzles);
// End of Anti-bot Registration Puzzles Mod
]]>
</add>
</operation>
</file>
- <file name="$themedir/Register.template.php" error="fatal">
- <operation error="fatal">
- <search position="after" regexp="false" whitespace="exact">
- <![CDATA[
// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
]]>
</search>
- <add>
- <![CDATA[
// Start of Anti-bot Registration Puzzles Mod
echo '<tr valign="top">
<td width="40%" valign="top">
<b>'.$txt['puzzle_'.$context['puzzle'][0]].'</b><br />
'.$txt['puzzle_antibot'].'
</td>
<td>
'. ( empty($context['puzzle'][1]) ? '' : $context['puzzle'][1].'<br />' ) .'
<input type="text" name="'.$context['puzzle'][2].'" size="30" value="" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
// End of Anti-bot Registration Puzzles Mod
]]>
</add>
</operation>
</file>
- <file name="$themedir/languages/Modifications.english.php" error="fatal">
- <operation error="fatal">
<search position="end" regexp="false" whitespace="exact" />
- <add>
- <![CDATA[
$txt['puzzle_colors'] = 'Which word is the same as its color';
$txt['puzzle_math'] = 'What is the sum of (as a number)';
$txt['puzzle_shapes'] = 'How many %s does a %s have?';
$txt['puzzle_shapes2'] = 'How many %s does an %s have?';
$txt['puzzle_sides'] = 'sides';
$txt['puzzle_corners'] = 'corners';
$txt['puzzle_incomplete'] = 'You did not complete the anti-bot puzzle. Please try again.';
$txt['puzzle_incorrect'] = 'You incorrectly answered the anti-bot puzzle. Please try again.';
$txt['puzzle_antibot'] = 'Anti-bot measure';
$txt['puzzle_red'] = 'Red';
$txt['puzzle_orange'] = 'Orange';
$txt['puzzle_yellow'] = 'Yellow';
$txt['puzzle_green'] = 'Green';
$txt['puzzle_blue'] = 'Blue';
$txt['puzzle_purple'] = 'Purple';
$txt['puzzle_pink'] = 'Pink';
$txt['puzzle_black'] = 'Black';
$txt['puzzle_grey'] = 'Grey';
$txt['puzzle_triange'] = 'Triangle';
$txt['puzzle_square'] = 'Square';
$txt['puzzle_rectangle'] = 'Rectangle';
$txt['puzzle_pentagon'] = 'Pentagon';
$txt['puzzle_hexagon'] = 'Hexagon';
$txt['puzzle_heptagon'] = 'Heptagon';
$txt['puzzle_octagon'] = 'Octagon';
$txt['puzzle_1'] = 'ONE';
$txt['puzzle_2'] = 'TWO';
$txt['puzzle_3'] = 'THREE';
$txt['puzzle_4'] = 'FOUR';
$txt['puzzle_5'] = 'FIVE';
$txt['puzzle_6'] = 'SIX';
$txt['puzzle_7'] = 'SEVEN';
$txt['puzzle_8'] = 'EIGHT';
$txt['puzzle_9'] = 'NINE';
$txt['puzzle_10'] = 'TEN';
$txt['puzzle_11'] = 'ELEVEN';
$txt['puzzle_12'] = 'TWELVE';
$txt['puzzle_13'] = 'THIRTEEN';
$txt['puzzle_14'] = 'FOURTEEN';
$txt['puzzle_15'] = 'FIFTEEN';
$txt['puzzle_16'] = 'SIXTEEN';
$txt['puzzle_17'] = 'SEVENTEEN';
$txt['puzzle_18'] = 'EIGHTEEN';
$txt['puzzle_19'] = 'NINETEEN';
]]>
</add>
</operation>
</file>
- <file name="$themedir/languages/Modifications.english-utf8.php" error="skip">
- <operation error="fatal">
<search position="end" regexp="false" whitespace="exact" />
- <add>
- <![CDATA[
$txt['puzzle_colors'] = 'Which word is the same as its color';
$txt['puzzle_math'] = 'What is the sum of (as a number)';
$txt['puzzle_shapes'] = 'How many %s does a %s have?';
$txt['puzzle_shapes2'] = 'How many %s does an %s have?';
$txt['puzzle_sides'] = 'sides';
$txt['puzzle_corners'] = 'corners';
$txt['puzzle_incomplete'] = 'You did not complete the anti-bot puzzle. Please try again.';
$txt['puzzle_incorrect'] = 'You incorrectly answered the anti-bot puzzle. Please try again.';
$txt['puzzle_antibot'] = 'Anti-bot measure';
$txt['puzzle_red'] = 'Red';
$txt['puzzle_orange'] = 'Orange';
$txt['puzzle_yellow'] = 'Yellow';
$txt['puzzle_green'] = 'Green';
$txt['puzzle_blue'] = 'Blue';
$txt['puzzle_purple'] = 'Purple';
$txt['puzzle_pink'] = 'Pink';
$txt['puzzle_black'] = 'Black';
$txt['puzzle_grey'] = 'Grey';
$txt['puzzle_triange'] = 'Triangle';
$txt['puzzle_square'] = 'Square';
$txt['puzzle_rectangle'] = 'Rectangle';
$txt['puzzle_pentagon'] = 'Pentagon';
$txt['puzzle_hexagon'] = 'Hexagon';
$txt['puzzle_heptagon'] = 'Heptagon';
$txt['puzzle_octagon'] = 'Octagon';
$txt['puzzle_1'] = 'ONE';
$txt['puzzle_2'] = 'TWO';
$txt['puzzle_3'] = 'THREE';
$txt['puzzle_4'] = 'FOUR';
$txt['puzzle_5'] = 'FIVE';
$txt['puzzle_6'] = 'SIX';
$txt['puzzle_7'] = 'SEVEN';
$txt['puzzle_8'] = 'EIGHT';
$txt['puzzle_9'] = 'NINE';
$txt['puzzle_10'] = 'TEN';
$txt['puzzle_11'] = 'ELEVEN';
$txt['puzzle_12'] = 'TWELVE';
$txt['puzzle_13'] = 'THIRTEEN';
$txt['puzzle_14'] = 'FOURTEEN';
$txt['puzzle_15'] = 'FIFTEEN';
$txt['puzzle_16'] = 'SIXTEEN';
$txt['puzzle_17'] = 'SEVENTEEN';
$txt['puzzle_18'] = 'EIGHTEEN';
$txt['puzzle_19'] = 'NINETEEN';
]]>
</add>
</operation>
</file>
- <file name="$themedir/languages/Modifications.english_british.php" error="skip">
- <operation error="fatal">
<search position="end" regexp="false" whitespace="exact" />
- <add>
- <![CDATA[
$txt['puzzle_colors'] = 'Which word is the same as its color';
$txt['puzzle_math'] = 'What is the sum of (as a number)';
$txt['puzzle_shapes'] = 'How many %s does a %s have?';
$txt['puzzle_shapes2'] = 'How many %s does an %s have?';
$txt['puzzle_sides'] = 'sides';
$txt['puzzle_corners'] = 'corners';
$txt['puzzle_incomplete'] = 'You did not complete the anti-bot puzzle. Please try again.';
$txt['puzzle_incorrect'] = 'You incorrectly answered the anti-bot puzzle. Please try again.';
$txt['puzzle_antibot'] = 'Anti-bot measure';
$txt['puzzle_red'] = 'Red';
$txt['puzzle_orange'] = 'Orange';
$txt['puzzle_yellow'] = 'Yellow';
$txt['puzzle_green'] = 'Green';
$txt['puzzle_blue'] = 'Blue';
$txt['puzzle_purple'] = 'Purple';
$txt['puzzle_pink'] = 'Pink';
$txt['puzzle_black'] = 'Black';
$txt['puzzle_grey'] = 'Grey';
$txt['puzzle_triange'] = 'Triangle';
$txt['puzzle_square'] = 'Square';
$txt['puzzle_rectangle'] = 'Rectangle';
$txt['puzzle_pentagon'] = 'Pentagon';
$txt['puzzle_hexagon'] = 'Hexagon';
$txt['puzzle_heptagon'] = 'Heptagon';
$txt['puzzle_octagon'] = 'Octagon';
$txt['puzzle_1'] = 'ONE';
$txt['puzzle_2'] = 'TWO';
$txt['puzzle_3'] = 'THREE';
$txt['puzzle_4'] = 'FOUR';
$txt['puzzle_5'] = 'FIVE';
$txt['puzzle_6'] = 'SIX';
$txt['puzzle_7'] = 'SEVEN';
$txt['puzzle_8'] = 'EIGHT';
$txt['puzzle_9'] = 'NINE';
$txt['puzzle_10'] = 'TEN';
$txt['puzzle_11'] = 'ELEVEN';
$txt['puzzle_12'] = 'TWELVE';
$txt['puzzle_13'] = 'THIRTEEN';
$txt['puzzle_14'] = 'FOURTEEN';
$txt['puzzle_15'] = 'FIFTEEN';
$txt['puzzle_16'] = 'SIXTEEN';
$txt['puzzle_17'] = 'SEVENTEEN';
$txt['puzzle_18'] = 'EIGHTEEN';
$txt['puzzle_19'] = 'NINETEEN';
]]>
</add>
</operation>
</file>
- <file name="$themedir/languages/Modifications.english_british-utf8.php" error="skip">
- <operation error="fatal">
<search position="end" regexp="false" whitespace="exact" />
- <add>
- <![CDATA[
$txt['puzzle_colors'] = 'Which word is the same as its color';
$txt['puzzle_math'] = 'What is the sum of (as a number)';
$txt['puzzle_shapes'] = 'How many %s does a %s have?';
$txt['puzzle_shapes2'] = 'How many %s does an %s have?';
$txt['puzzle_sides'] = 'sides';
$txt['puzzle_corners'] = 'corners';
$txt['puzzle_incomplete'] = 'You did not complete the anti-bot puzzle. Please try again.';
$txt['puzzle_incorrect'] = 'You incorrectly answered the anti-bot puzzle. Please try again.';
$txt['puzzle_antibot'] = 'Anti-bot measure';
$txt['puzzle_red'] = 'Red';
$txt['puzzle_orange'] = 'Orange';
$txt['puzzle_yellow'] = 'Yellow';
$txt['puzzle_green'] = 'Green';
$txt['puzzle_blue'] = 'Blue';
$txt['puzzle_purple'] = 'Purple';
$txt['puzzle_pink'] = 'Pink';
$txt['puzzle_black'] = 'Black';
$txt['puzzle_grey'] = 'Grey';
$txt['puzzle_triange'] = 'Triangle';
$txt['puzzle_square'] = 'Square';
$txt['puzzle_rectangle'] = 'Rectangle';
$txt['puzzle_pentagon'] = 'Pentagon';
$txt['puzzle_hexagon'] = 'Hexagon';
$txt['puzzle_heptagon'] = 'Heptagon';
$txt['puzzle_octagon'] = 'Octagon';
$txt['puzzle_1'] = 'ONE';
$txt['puzzle_2'] = 'TWO';
$txt['puzzle_3'] = 'THREE';
$txt['puzzle_4'] = 'FOUR';
$txt['puzzle_5'] = 'FIVE';
$txt['puzzle_6'] = 'SIX';
$txt['puzzle_7'] = 'SEVEN';
$txt['puzzle_8'] = 'EIGHT';
$txt['puzzle_9'] = 'NINE';
$txt['puzzle_10'] = 'TEN';
$txt['puzzle_11'] = 'ELEVEN';
$txt['puzzle_12'] = 'TWELVE';
$txt['puzzle_13'] = 'THIRTEEN';
$txt['puzzle_14'] = 'FOURTEEN';
$txt['puzzle_15'] = 'FIFTEEN';
$txt['puzzle_16'] = 'SIXTEEN';
$txt['puzzle_17'] = 'SEVENTEEN';
$txt['puzzle_18'] = 'EIGHTEEN';
$txt['puzzle_19'] = 'NINETEEN';
]]>
</add>
</operation>
</file>
</modification>
سلام
راهنمای زیر را مطالعه نمایید
<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>
reza_pa48
12-06-2009, 02:51 PM
سلام
طبق راهنمایی هایی که فرمودین من شروع کردم به نصب دستی مد
چند سطر اولشو اینجا می ذارم
<file name="$sourcedir/Register.php">
<operation>
<search position="after"><![CDATA[// Are they under age, and under age users are banned?
]]></search>
<add><![CDATA[
// Start of Anti-bot Registration Puzzles Mod
// Checks whether field was completed, if not it goes to an error screen
if(empty($_SESSION['puzzle_dynamic_input']) || empty($_POST[$_SESSION['puzzle_dynamic_input']]))
fatal_lang_error('puzzle_incomplete', false);
// If puzzle was answered incorrectly
elseif (md5(strtolower($_POST[$_SESSION['puzzle_dynamic_input']])) != $_SESSION['puzzle_code'])
fatal_lang_error('puzzle_incorrect', false);
// End of Anti-bot Registration Puzzles Mod
]]></add>
</operation>
خوب مشکل اول اینه
1-در دایرکتوری فروم فایلی به اسم register.php وجود ندارد که من اونو ویرایش کنم
سلام
نوشته قبلش پوشه source
reza_pa48
12-07-2009, 06:32 PM
خوب منظورش از source پوشه تمپلت هست یا روت فروم؟
چون تو روت فوروم که چیزی نیست تو روت تمپلت هم register.template.php هست
reza_pa48
12-09-2009, 08:23 PM
کسی نمی خواد جواب بده؟تا من از شر این اسپم ها خلاص شم؟
مهدی.
12-09-2009, 10:56 PM
سلام
شما از SMF استفاده میکنید ؟!
کلاً 6 پوشه در روت SMF هست که یکیش sources هست! و البته داخلش فایل مربوطه هست!
پاییزتان پر مهر
prin.ir
01-11-2010, 08:19 PM
با سلام
تغییراتی که باید اعمال کنید اینگونه است
در پوشه Sources فایل Register.php را باز کنید و این کد را پیدا کنید:
// Are they under age, and under age users are banned?
و قبل از آن کد زیر را قرار دهید
// Start of Anti-bot Registration Puzzles Mod
// Checks whether field was completed, if not it goes to an error screen
if(empty($_SESSION['puzzle_dynamic_input']) || empty($_POST[$_SESSION['puzzle_dynamic_input']]))
fatal_lang_error('puzzle_incomplete', false);
// If puzzle was answered incorrectly
elseif (md5(strtolower($_POST[$_SESSION['puzzle_dynamic_input']])) != $_SESSION['puzzle_code'])
fatal_lang_error('puzzle_incorrect', false);
// End of Anti-bot Registration Puzzles Mod
این کد را پیدا کنید:
// Under age restrictions?
if (!empty($modSettings['coppaAge']))
{
$context['show_coppa'] = true;
$context['coppa_desc'] = sprintf($txt['register_age_confirmation'], $modSettings['coppaAge']);
}
وبعد از آن این کد را قرار دهید:
// Start of Anti-bot Registration Puzzles Mod
$puzzles = array(
'shapes' => create_function('', '
$a = array(0 => "sides", 1 => "corners");
$b = rand(0,1);
$c = array(\'square\' => 4, \'rectangle\' => 4, \'pentagon\' => 5,
\'hexagon\' => 6, \'heptagon\' => 7, \'octagon\' => 8);
$d = array_rand($c); // randomly select a shape
$e = $c[$d]; // the answer
global $txt;
$txt[\'puzzle_shapes\'] = sprintf(($d == \'octagon\' ? $txt[\'puzzle_shapes2\'] : $txt[\'puzzle_shapes\']), $txt[\'puzzle_\'.$a[$b]], $txt[\'puzzle_\'.$d]);
return array(\'shapes\', \'\', md5($e));
'),
'math' => create_function('', '
$a = array();
$a[0] = rand(5,19);
$a[1] = rand(1,$a[0]-2);
$a[2] = rand(1,($a[0]-$a[1]-2));
$a[3] = array("+","-");
$a[4] = $a[3][array_rand($a[3])];
$a[5] = $a[3][array_rand($a[3])];
$d = "$a[0]$a[4] $a[1] $a[5] $a[2]";
eval("\$d=" . $d . ";");
return array(\'math\', "<span style=\"font-weight:bold;\">$a[0] $a[4] $a[1] $a[5] $a[2] =</span>", md5($d));
'),
'math2' => create_function('', '
$a = array();
$a[0] = rand(5,19);
$a[1] = rand(1,$a[0]-2);
$a[2] = rand(1,($a[0]-$a[1]-2));
$a[3] = array("+","-");
$a[4] = $a[3][array_rand($a[3])];
$a[5] = $a[3][array_rand($a[3])];
$c = array(rand(0,1),rand(0,1),rand(0,1));
$d = "$a[0]$a[4] $a[1] $a[5] $a[2]";
// Whats the sum/answer
eval("\$d=" . $d . ";");
// Access txt strings
global $txt;
return array(\'math\', \'<span style="font-weight:bold;">\'.($c[0] ? $a[0] : $txt[\'puzzle_\'.$a[0]]).\' \'.$a[4].\' \'.($c[1] ? $a[1] : $txt[\'puzzle_\'.$a[1]]).\' \'.$a[5].\' \'.($c[2] ? $a[2] : $txt[\'puzzle_\'.$a[2]]).\' = </span>\', md5($d));
'),
'colors' => create_function('', '
$a = array(\'red\' => \'#FF0033\', \'orange\' => \'#FF6600\', \'yellow\' => \'#FFFF33\', \'green\' => \'#006600\', \'blue\' => \'#0033FF\', \'purple\' => \'#663366\', \'pink\' => \'#FF9999\', \'black\' => \'#000000\', \'grey\' => \'#999999\');
// Select them randomly
$b = array_rand($a,8);
$c = $b[rand(0,7)]; // the answer
$d = \'\';
// Access txt strings
global $txt;
for($i=0;$i<=7;$i++)
{
// Color or hex? randomly change
$e = rand(0,1);
$j = $i+1;
if($c == $b[$i] || $c == $b[$j])
$d .= \'<span style="font-weight:bold;color:\'. ($e ? $a[$c] : $c ) .\'">\'. $txt[\'puzzle_\'.$c] .\'</span> \';
else
$d .= \'<span style="font-weight:bold;color:\'. ($e ? $a[$b[$i]] : $b[$i] ) .\'">\'. $txt[\'puzzle_\'.$b[$j]] .\'</span> \';
$i++;
}
unset($a,$b,$e,$i,$j);
return array(\'colors\', $d, md5(strtolower($txt[\'puzzle_\'.$c])));
'),
);
// Generate a new puzzle code every time
$_SESSION['puzzle_dynamic_input'] = $_SESSION['puzzle_code'] = '';
// Generate Random field name
$range1 = range('a', 'z');
$range2 = range(0, 9);
// Must start with a letter not a digit
$_SESSION['puzzle_dynamic_input'] = $range1[array_rand($range1)];
// Length over 8
$rand = rand(8,12);
for($i=0;$i<=$rand;$i++)
$_SESSION['puzzle_dynamic_input'] .= (rand(0, 1) == 0) ? $range1[array_rand($range1)] : $range2[array_rand($range2)];
unset($range1, $range2, $rand);
// Choose a puzzle
$context['puzzle'] = $puzzles[array_rand($puzzles)]();
$_SESSION['puzzle_code'] = $context['puzzle'][2];
$context['puzzle'][2] = $_SESSION['puzzle_dynamic_input'];
unset($puzzles);
// End of Anti-bot Registration Puzzles Mod
درون پوشه قالب سایتتون اگه فایل Register.template.php هست این تغییرات را در آن ایجاد کنید و اگر نیست در پوشه فالب پیش فرض در فایل Register.template.php این تغییرات را اعمال کنید.
کد زیر را پیدا کنید:
// Are there age restrictions in place?
if (!empty($modSettings['coppaAge']))
و قبل از آن این کد را قرار دهید
// Start of Anti-bot Registration Puzzles Mod
echo '<tr valign="top">
<td width="40%" valign="top">
<b>'.$txt['puzzle_'.$context['puzzle'][0]].'</b><br />
'.$txt['puzzle_antibot'].'
</td>
<td>
'. ( empty($context['puzzle'][1]) ? '' : $context['puzzle'][1].'<br />' ) .'
<input type="text" name="'.$context['puzzle'][2].'" size="30" value="" tabindex="', $context['tabindex']++, '" />
</td>
</tr>';
// End of Anti-bot Registration Puzzles Mod
در آخرین مرحله در فایل Modifications.english.php در پوشه languages در داخل پوشه قالب پیش فرض این تغییرات را ایجاد کنید
قبل از کد
?>
این کد را قرار بدهید
$txt['puzzle_colors'] = 'Which word is the same as its color';
$txt['puzzle_math'] = 'What is the sum of (as a number)';
$txt['puzzle_shapes'] = 'How many %s does a %s have?';
$txt['puzzle_shapes2'] = 'How many %s does an %s have?';
$txt['puzzle_sides'] = 'sides';
$txt['puzzle_corners'] = 'corners';
$txt['puzzle_incomplete'] = 'You did not complete the anti-bot puzzle. Please try again.';
$txt['puzzle_incorrect'] = 'You incorrectly answered the anti-bot puzzle. Please try again.';
$txt['puzzle_antibot'] = 'Anti-bot measure';
$txt['puzzle_red'] = 'Red';
$txt['puzzle_orange'] = 'Orange';
$txt['puzzle_yellow'] = 'Yellow';
$txt['puzzle_green'] = 'Green';
$txt['puzzle_blue'] = 'Blue';
$txt['puzzle_purple'] = 'Purple';
$txt['puzzle_pink'] = 'Pink';
$txt['puzzle_black'] = 'Black';
$txt['puzzle_grey'] = 'Grey';
$txt['puzzle_triange'] = 'Triangle';
$txt['puzzle_square'] = 'Square';
$txt['puzzle_rectangle'] = 'Rectangle';
$txt['puzzle_pentagon'] = 'Pentagon';
$txt['puzzle_hexagon'] = 'Hexagon';
$txt['puzzle_heptagon'] = 'Heptagon';
$txt['puzzle_octagon'] = 'Octagon';
$txt['puzzle_1'] = 'ONE';
$txt['puzzle_2'] = 'TWO';
$txt['puzzle_3'] = 'THREE';
$txt['puzzle_4'] = 'FOUR';
$txt['puzzle_5'] = 'FIVE';
$txt['puzzle_6'] = 'SIX';
$txt['puzzle_7'] = 'SEVEN';
$txt['puzzle_8'] = 'EIGHT';
$txt['puzzle_9'] = 'NINE';
$txt['puzzle_10'] = 'TEN';
$txt['puzzle_11'] = 'ELEVEN';
$txt['puzzle_12'] = 'TWELVE';
$txt['puzzle_13'] = 'THIRTEEN';
$txt['puzzle_14'] = 'FOURTEEN';
$txt['puzzle_15'] = 'FIFTEEN';
$txt['puzzle_16'] = 'SIXTEEN';
$txt['puzzle_17'] = 'SEVENTEEN';
$txt['puzzle_18'] = 'EIGHTEEN';
$txt['puzzle_19'] = 'NINETEEN';
در صورتی که میخواهید این مد به صورت کاملا فارسی نمایش داده شود تغییرات مرحله آخر را در فایل Modifications.persian.php نیز انجام داده و عبارات آن را ترجمه کنید برای مثال
$txt['puzzle_math'] = 'What is the sum of (as a number)';
$txt['puzzle_math'] = 'حاصل عددی عبارت مقابل چیست؟ ';
موفق باشید.
vBulletin® v4.2.5, Copyright ©2000-2026, Jelsoft Enterprises Ltd.