Phpbb''ye eklentiler ne kadar teferruatlı işmiş!
Şimdi kardeş, eğer ingilizce bilyorsan, ilgili dosyayı indirdikten sonra,
Forumunda ki 4 dosya için de,
includes/constants.php
includes/usercp_register.php
language/lang_english/lang_main.php (Bu sende Turkish dosya yeri olacak)
templates/subSilver/profile_add_body.tpl
aşağıdaki kodları ara bul yöntemiyle ekleyeceksin,
#
#-----[ OPEN ]--------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]--------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]-------------------------------------
#
// Anti Robotic Register
define('ANTI_ROBOT_TABLE', $table_prefix.'anti_robotic_reg');
#
#-----[ OPEN ]--------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]--------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_CONFIRM_PASSWORD}: * </span><br />
<span class="gensmall">{L_PASSWORD_CONFIRM_IF_CHANGED}</span></td>
<td class="row2">
<input type="password" class="post" style="width: 200px" name="password_confirm" size="25" maxlength="100" value="{PASSWORD_CONFIRM}" />
</td>
</tr>
#
#-----[ AFTER, ADD ]--------------------------------------
#
<!-- BEGIN switch_validation -->
<tr>
<td class="catSides" colspan="2" height="28"> </td>
</tr>
<tr>
<th class="thSides" colspan="2" height="12" valign="middle">{L_VALIDATION}</th>
</tr>
<tr>
<td class="row1" valign="top"><span class="gen">{L_VALIDATION}:<br /></span><span class="gensmall">{L_VALIDATION_EXPLAIN}</span></td>
<td class="row2" align="center"><span class="gen"><img src="{S_ANTI_ROBOT1}" alt="" border="0"><img src="{S_ANTI_ROBOT2}" alt="" border="0"><img src="{S_ANTI_ROBOT3}" alt="" border="0"><img src="{S_ANTI_ROBOT4}" alt="" border="0"><img src="{S_ANTI_ROBOT5}" alt="" border="0"><br /><br /><input type="text" name="reg_key" maxlength="5" size="6"></span></td>
</tr>
<!-- END switch_validation -->
#
#-----[ OPEN ]--------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]--------------------------------------------
#
//
// That's all Folks!
#
#-----[ BEFORE, ADD ]-------------------------------------
#
// Anti Robotic Registration
$lang['Wrong_reg_key'] = 'Anti Robotic Register Validation Error';
$lang['Validation'] = 'Validation';
$lang['Validation_explain'] = 'To make sure you are not a robot, please type what letters you see in the image right';
#
#-----[ OPEN ]--------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]--------------------------------------------
#
if ( !defined('IN_PHPBB') )
{
die("heking attempt");
exit;
}
#
#-----[ AFTER, ADD ]--------------------------------------
#
function gen_reg_key()
{
$key = "";
$max_length_reg_key = 5;
$chars = array(
"a","b","c","d","e","f","g","h","i","j","k","l","m",
"n","o","p","q","r","s","t","u","v","w","x","y","z");
$count = count($chars) - 1;
srand((double)microtime()*1000000);
for($i = 0; $i < $max_length_reg_key; $i++)
{
$key .= $chars[rand(0, $count)];
}
return($key);
}
#
#-----[ FIND ]--------------------------------------------
#
else if ( $mode == 'register' )
{
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
}
#
#-----[ AFTER, ADD ]--------------------------------------
#
//
// Anti Robotic Registration
//
$sql = "SELECT * FROM " . ANTI_ROBOT_TABLE . " WHERE session_id = '" . $userdata['session_id'] . "' LIMIT 1";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain registration information', '', __LINE__, __FILE__, $sql);
}
$anti_robot_row = $db->sql_fetchrow($result);
if (( strtolower($HTTP_POST_VARS['reg_key']) != $anti_robot_row['reg_key'] ) or ($anti_robot_row['reg_key'] == ''))
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Wrong_reg_key'];
}
else
{
$sql = "DELETE FROM " . ANTI_ROBOT_TABLE . " WHERE session_id = '" . $userdata['session_id'] . "'";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete validation key', '', __LINE__, __FILE__, $sql);
}
}
// --------------------------
//
#
#-----[ FIND ]--------------------------------------------
#
$template->assign_vars(array(
'USERNAME' => $username,
'CUR_PASSWORD' => $cur_password,
'NEW_PASSWORD' => $new_password,
#
#-----[ BEFORE, ADD ]-------------------------------------
#
//
// Anti Robotic Registration
//
if ($mode == 'register')
{
$sql = "DELETE FROM " . ANTI_ROBOT_TABLE . " WHERE timestamp < '" . (time() - 3600) . "' OR session_id = '" . $userdata['session_id'] . "'";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not delete validation key', '', __LINE__, __FILE__, $sql);
}
$reg_key = gen_reg_key();
$sql = "INSERT INTO ". ANTI_ROBOT_TABLE . " VALUES ('" . $userdata['session_id'] . "', '" . $reg_key . "', '" . time() . "')";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not check registration information', '', __LINE__, __FILE__, $sql);
}
}
//-----------------------
//
#
#-----[ FIND ]--------------------------------------------
#
'L_EMAIL_ADDRESS' => $lang['Email_address'],
#
#-----[ AFTER, ADD ]--------------------------------------
#
// Anti Robotic Registration MOD
'L_VALIDATION' => $lang['Validation'],
'L_VALIDATION_EXPLAIN' => $lang['Validation_explain'],
'S_ANTI_ROBOT1' => append_sid('antirobot_pic.'.$phpEx.'?id=1'),
'S_ANTI_ROBOT2' => append_sid('antirobot_pic.'.$phpEx.'?id=2'),
'S_ANTI_ROBOT3' => append_sid('antirobot_pic.'.$phpEx.'?id=3'),
'S_ANTI_ROBOT4' => append_sid('antirobot_pic.'.$phpEx.'?id=4'),
'S_ANTI_ROBOT5' => append_sid('antirobot_pic.'.$phpEx.'?id=5'),
#
#-----[ FIND ]--------------------------------------------
#
if ( $board_config['allow_avatar_local'] && file_exists(@phpbb_realpath('./' . $board_config['avatar_gallery_path'])) )
{
$template->assign_block_vars('switch_avatar_block.switch_avatar_local_gallery', array() );
}
}
}
#
#-----[ AFTER, ADD ]--------------------------------------
#
else
{
$template->assign_block_vars('switch_validation', array() );
}
#
#-----[ SQL ]---------------------------------------------
#
CREATE TABLE phpbb_anti_robotic_reg (
session_id char(32) DEFAULT '' NOT lisanssız,
reg_key char(5) NOT lisanssız,
timestamp int(11) unsigned NOT lisanssız,
PRIMARY KEY (session_id));
#
#-----[ COPY ]--------------------------------------------
#
copy antirobot_pic.php to antirobot_pic.php
#
#-----[ COPY ]--------------------------------------------
#
copy images/anti_robotic_reg/anti_robotic_reg_*.gif to images/anti_robotic_reg/
Zaten detaylar dosya içinde var.
Ayrıca bir de databese'te yeni bir tablo yaratman gerekiyor.Yukarıda sql die yazan yerde.Aslında tüm bunları otomatik olarak yapan bir mod var ama...
Şu saatlerde pek bakacak durumda değilim.
Takılmadığın yer olursa sorabilirsin
