admin
01-08-07, 03:27 PM
هذا الهاك يجعل بمقدور المشرفين وضع رقم سري لأي مشاركة بأي قسم بالمنتدي
ازرع هذه الأوامر بقاعده البيانات
SQL QUERIES
ALTER TABLE thread ADD (
password VARCHAR(50) NOT NULL DEFAULT ''
)
في لوحة التحكم تذهب الي اللغات و العبارات
ونختار العبارات و المرادفات ونختار اضافة عباره جديد
التصنيف: Front-End Error Messages
اسم المتغير : threadpasswordmissing
النص:
<p>مشرف المنتدي قد وضع كلمة مرور لهذه المشاركه . ارجو وضع كلمة السر <br />
<form action="showthread.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="do" value="doenterpwd">
<input type="hidden" name="url" value="$scriptpath">
<input type="hidden" name="forumid" value="$forumid">
<input type="hidden" name="threadid" value="$threadid">
$postvars
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" align="center">
<tr>
<td><b>Contraseٌa: $thread[password]-$thread[threadid]</b></td>
<td><input type="password" class="bginput" name="newthreadpwd" /></td>
<td><input type="submit" class="button" value="Enter to Thread" accesskey="s" /></td>
</tr>
</table>
</form>
التصنيف: Front-End Error Messages
اسم المتغير: threadpasswordincorrect
النص:
<p>;كلمة السر التي ادخلتها غير صحيحة ز ارجو اعاده المحاوله<br />
<form action="showthread.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="do" value="doenterpwd">
<input type="hidden" name="url" value="$scriptpath">
<input type="hidden" name="forumid" value="$thread[forumid]">
<input type="hidden" name="threadid" value="$thread[threadid]">
$postvars
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" align="center">
<tr>
<td><b>Contraseٌa:</b></td>
<td><input type="password" class="bginput" name="newthreadpwd" /></td>
<td><input type="submit" class="button" value="Enter to Thread" accesskey="s" /></td>
</tr>
</table>
</form>
التصنيف: Front-End Error Messages
اسم المتغير: threadpasswordcorrect
النص:
تم ادخال الكله السريه بنجاح . ارجو الأنتظار حتي يتم تحويلك للمشاركة
التصنيف: Front-End Error Messages
اسم المتغير: noarchivepass
النص:
<center>هذه المشاركة محميه بكلمة سر لايمكنك ان تطلع عليها من الأرشيف<b> <a href="$vboptions[bburl]/showthread.php?$session[sessionurl]t=$threadinfo[threadid]">Clic here</a> to view the original thread .</center>
افتح ملف forumdisplay.php
ابحث عن
deletionlog.username AS del_username, deletionlog.reason AS del_reason") . "
أضف بعده
, thread.password
افتح ملف functions.php
ابحث عن
// ###################### Start checkforumpwd #######################
اضف فوقه
// ###################### Start check thread password netzoner #######################
function verify_thread_password($forumid, $threadid, $password, $showerror = true)
{
global $permissions, $bbuserinfo, $stylevar, $scriptpath;
if (!$password OR ($permissions['adminpermissions'] & CANCONTROLPANEL) OR ($permissions['adminpermissions'] & ISMODERATOR) OR can_moderate($forumid))
{
return true; //Si es Administrador, Super Moderador o Moderador, pasa por alto la contraseٌa
}
if ($temp = fetch_bbarray_****ie('threadpwd', $threadid) AND $temp == md5($bbuserinfo['userid'] . $password))
{
return true;
}
// didn't match the password in any ****ie
if ($showerror)
{
// thread password is bad - show error
$postvars = construct_post_vars_html();
eval(print_standard_error('error_threadpasswordmis sing'));
}
else
{
// thread password is bad - return false
return false;
}
}
افتح ملف showthread.php
ابحث عن
// ************************************************** *******************************
// check if there is a forum password and if so, ensure the user has it set netzoner
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
اضف فوقه
// ############################### start enter password ###############################
if ($_REQUEST['do'] == 'doenterpwd')
{
globalize($_REQUEST, array('forumid' => INT, 'threadid' => INT, 'newthreadpwd' => STR, 'url' => STR, 'postvars'));
if ($thread['password'] == $newthreadpwd)
{
// set a temp ****ie for guests
if (!$bbuserinfo['userid'])
{
set_bbarray_****ie('threadpwd', $thread['threadid'], md5($bbuserinfo['userid'] . $newthreadpwd));
}
else
{
set_bbarray_****ie('threadpwd', $thread['threadid'], md5($bbuserinfo['userid'] . $newthreadpwd), 1);
}
$url = "showthread.php?$session[sessionurl]t=$thread[threadid]";
// Allow POST based redirection...
if ($postvars)
{
$temp = unserialize($postvars);
if ($temp['do'] != 'doenterpwd')
{ // ...but prevent an infinite loop
$postvars = construct_hidden_var_fields($postvars);
$formfile = $url;
}
else
{
$postvars = '';
}
}
eval(print_standard_redirect('threadpasswordcorrec t'));
}
else
{
$postvars = construct_post_vars_html();
eval(print_standard_error('threadpasswordincorrect '));
}
}
// Verify if the thread has a password
verify_thread_password($thread['forumid'], $thread['threadid'], $thread['password'], $showerror = true);
افتح ملف newreply.php
ابحث عن
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
اضف فوقه
// Verify if the thread has a password
verify_thread_password($threadinfo['forumid'], $threadinfo['threadid'], $thread['password'], $showerror = true);
افتح ملف showpost.php
ابحث عن
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
اضف بعده
// Verify if the thread has a password netzoner
verify_thread_password($threadinfo['forumid'], $threadinfo['threadid'], $thread['password'], $showerror = true);
افتح ملف archive/index.php
ابحث عن
كود PHP:
$threadinfo = fetch_threadinfo($t);
اضف بعده
if($threadinfo['password'])
{
eval('$error_message = "' . fetch_phrase('error_noarchivepass', PHRASETYPEID_ERROR, 'error_') . '";');
$do = 'error';
}
افتح ملف printhread.php
ابحث عن
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
اضف فوقه
// Verify if the thread has a password
verify_thread_password($threadinfo['forumid'], $threadinfo['threadid'], $thread['password'], $showerror = true);
افتح ملف sendmessage.php
ابحث عن
P // check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']); :
اضف فوقه
// Verify if the thread has a password
verify_thread_password($threadinfo['forumid'], $threadinfo['threadid'], $thread['password'], $showerror = true);
افتح ملف postings.php
ابحث عن
'splitthread' => array('threadadmin_splitthread'),
ضع تحته
'editpass' => array('threadadmin_editpass'),
ابحث عن
case 'removeredirect':
اضف بعده
case 'editpassword';
ابحث عن
// ############################### all done, do shell template ###############################
اضف فوقه
// ############################### start edit thread password ###############################
if ($_POST['do'] == 'editpassword')
{
// permission check
if (!can_moderate($threadinfo['forumid'], 'canopenclose'))
{
$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & CANVIEW) OR !($forumperms & CANOPENCLOSE))
{
print_no_permission();
}
else
{
if (!is_first_poster($threadid))
{
print_no_permission();
}
}
}
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
if(empty($_POST['dopass']))
{
$templatename = 'threadadmin_editpass';
}else{
$logaction = "Control de Contraseٌa";
if ($_POST['password'])
{
$action = "Edicion/Control de Contraseٌa";
}else{
$action = "Eliminacion de Contraseٌa";
}
log_moderator_action($threadinfo, $logaction);
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET password = '" . addslashes($_POST['password']) . "' WHERE threadid = $threadid");
$_REQUEST['forceredirect'] = 1;
$url = "showthread.php?$session[sessionurl]t=$threadid";
eval(print_standard_redirect('redirect_openclose') );
}
}
التعديل علي التمبلت
تمبلت SHOWTHREAD
ابحث عن
<if condition="$show['editpoll']"><div><label for="ao_edp"><input type="radio" name="do" id="ao_edp" value="editpoll" />$vbphrase[edit_poll]</label></div></if>
اضف بعده
<div><label for="ao_etp"><input type="radio" name="do" id="ao_etp" value="editpassword" /><if condition="$thread['password']">Editar/Quitar Contraseٌa<else />Agregar Contraseٌa</if></label></div>
تمبلت threadbit
ابحث عن
:$thread[preview]
استبدله بالتالي
<if condition="!$thread['password']">$thread[preview]<else />Password Protected Thread</if>
اضافه تمبلت جديد
اسم التمبلت: threadadmin_editpass
ضع التالي به
<form action="postings.php" method="post" name="vbform">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="do" value="editpassword" />
<input type="hidden" name="dopass" value="1" />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Add a password to thread. To <b>remove password</b> let the text box blank</td>
</tr>
<tr>
<td class="thead">$vbphrase[title]: <span style="font-weight:normal">$threadinfo[title]</span></td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
<div class="fieldset">
Password management
</div>
<div class="fieldset">
Contraseٌa:<br />
<input type="password" class="bginput" name="password" value="" size="50" maxlength="50" />
</div>
</div>
<div style="margin-top:$stylevar[cellpadding]px">
<input type="submit" class="button" value="<if condition="$threadinfo['password']">Edit password<else />Apply password</if>" accesskey="s" />
<input type="reset" class="button" value="$vbphrase[reset_fields]" accesskey="r" />
</div>
</td>
</tr>
</table>
</form>
ومبروك علي الهاك
ازرع هذه الأوامر بقاعده البيانات
SQL QUERIES
ALTER TABLE thread ADD (
password VARCHAR(50) NOT NULL DEFAULT ''
)
في لوحة التحكم تذهب الي اللغات و العبارات
ونختار العبارات و المرادفات ونختار اضافة عباره جديد
التصنيف: Front-End Error Messages
اسم المتغير : threadpasswordmissing
النص:
<p>مشرف المنتدي قد وضع كلمة مرور لهذه المشاركه . ارجو وضع كلمة السر <br />
<form action="showthread.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="do" value="doenterpwd">
<input type="hidden" name="url" value="$scriptpath">
<input type="hidden" name="forumid" value="$forumid">
<input type="hidden" name="threadid" value="$threadid">
$postvars
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" align="center">
<tr>
<td><b>Contraseٌa: $thread[password]-$thread[threadid]</b></td>
<td><input type="password" class="bginput" name="newthreadpwd" /></td>
<td><input type="submit" class="button" value="Enter to Thread" accesskey="s" /></td>
</tr>
</table>
</form>
التصنيف: Front-End Error Messages
اسم المتغير: threadpasswordincorrect
النص:
<p>;كلمة السر التي ادخلتها غير صحيحة ز ارجو اعاده المحاوله<br />
<form action="showthread.php" method="post">
<input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="do" value="doenterpwd">
<input type="hidden" name="url" value="$scriptpath">
<input type="hidden" name="forumid" value="$thread[forumid]">
<input type="hidden" name="threadid" value="$thread[threadid]">
$postvars
<table cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" align="center">
<tr>
<td><b>Contraseٌa:</b></td>
<td><input type="password" class="bginput" name="newthreadpwd" /></td>
<td><input type="submit" class="button" value="Enter to Thread" accesskey="s" /></td>
</tr>
</table>
</form>
التصنيف: Front-End Error Messages
اسم المتغير: threadpasswordcorrect
النص:
تم ادخال الكله السريه بنجاح . ارجو الأنتظار حتي يتم تحويلك للمشاركة
التصنيف: Front-End Error Messages
اسم المتغير: noarchivepass
النص:
<center>هذه المشاركة محميه بكلمة سر لايمكنك ان تطلع عليها من الأرشيف<b> <a href="$vboptions[bburl]/showthread.php?$session[sessionurl]t=$threadinfo[threadid]">Clic here</a> to view the original thread .</center>
افتح ملف forumdisplay.php
ابحث عن
deletionlog.username AS del_username, deletionlog.reason AS del_reason") . "
أضف بعده
, thread.password
افتح ملف functions.php
ابحث عن
// ###################### Start checkforumpwd #######################
اضف فوقه
// ###################### Start check thread password netzoner #######################
function verify_thread_password($forumid, $threadid, $password, $showerror = true)
{
global $permissions, $bbuserinfo, $stylevar, $scriptpath;
if (!$password OR ($permissions['adminpermissions'] & CANCONTROLPANEL) OR ($permissions['adminpermissions'] & ISMODERATOR) OR can_moderate($forumid))
{
return true; //Si es Administrador, Super Moderador o Moderador, pasa por alto la contraseٌa
}
if ($temp = fetch_bbarray_****ie('threadpwd', $threadid) AND $temp == md5($bbuserinfo['userid'] . $password))
{
return true;
}
// didn't match the password in any ****ie
if ($showerror)
{
// thread password is bad - show error
$postvars = construct_post_vars_html();
eval(print_standard_error('error_threadpasswordmis sing'));
}
else
{
// thread password is bad - return false
return false;
}
}
افتح ملف showthread.php
ابحث عن
// ************************************************** *******************************
// check if there is a forum password and if so, ensure the user has it set netzoner
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
اضف فوقه
// ############################### start enter password ###############################
if ($_REQUEST['do'] == 'doenterpwd')
{
globalize($_REQUEST, array('forumid' => INT, 'threadid' => INT, 'newthreadpwd' => STR, 'url' => STR, 'postvars'));
if ($thread['password'] == $newthreadpwd)
{
// set a temp ****ie for guests
if (!$bbuserinfo['userid'])
{
set_bbarray_****ie('threadpwd', $thread['threadid'], md5($bbuserinfo['userid'] . $newthreadpwd));
}
else
{
set_bbarray_****ie('threadpwd', $thread['threadid'], md5($bbuserinfo['userid'] . $newthreadpwd), 1);
}
$url = "showthread.php?$session[sessionurl]t=$thread[threadid]";
// Allow POST based redirection...
if ($postvars)
{
$temp = unserialize($postvars);
if ($temp['do'] != 'doenterpwd')
{ // ...but prevent an infinite loop
$postvars = construct_hidden_var_fields($postvars);
$formfile = $url;
}
else
{
$postvars = '';
}
}
eval(print_standard_redirect('threadpasswordcorrec t'));
}
else
{
$postvars = construct_post_vars_html();
eval(print_standard_error('threadpasswordincorrect '));
}
}
// Verify if the thread has a password
verify_thread_password($thread['forumid'], $thread['threadid'], $thread['password'], $showerror = true);
افتح ملف newreply.php
ابحث عن
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
اضف فوقه
// Verify if the thread has a password
verify_thread_password($threadinfo['forumid'], $threadinfo['threadid'], $thread['password'], $showerror = true);
افتح ملف showpost.php
ابحث عن
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
اضف بعده
// Verify if the thread has a password netzoner
verify_thread_password($threadinfo['forumid'], $threadinfo['threadid'], $thread['password'], $showerror = true);
افتح ملف archive/index.php
ابحث عن
كود PHP:
$threadinfo = fetch_threadinfo($t);
اضف بعده
if($threadinfo['password'])
{
eval('$error_message = "' . fetch_phrase('error_noarchivepass', PHRASETYPEID_ERROR, 'error_') . '";');
$do = 'error';
}
افتح ملف printhread.php
ابحث عن
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
اضف فوقه
// Verify if the thread has a password
verify_thread_password($threadinfo['forumid'], $threadinfo['threadid'], $thread['password'], $showerror = true);
افتح ملف sendmessage.php
ابحث عن
P // check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']); :
اضف فوقه
// Verify if the thread has a password
verify_thread_password($threadinfo['forumid'], $threadinfo['threadid'], $thread['password'], $showerror = true);
افتح ملف postings.php
ابحث عن
'splitthread' => array('threadadmin_splitthread'),
ضع تحته
'editpass' => array('threadadmin_editpass'),
ابحث عن
case 'removeredirect':
اضف بعده
case 'editpassword';
ابحث عن
// ############################### all done, do shell template ###############################
اضف فوقه
// ############################### start edit thread password ###############################
if ($_POST['do'] == 'editpassword')
{
// permission check
if (!can_moderate($threadinfo['forumid'], 'canopenclose'))
{
$forumperms = fetch_permissions($threadinfo['forumid']);
if (!($forumperms & CANVIEW) OR !($forumperms & CANOPENCLOSE))
{
print_no_permission();
}
else
{
if (!is_first_poster($threadid))
{
print_no_permission();
}
}
}
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);
if(empty($_POST['dopass']))
{
$templatename = 'threadadmin_editpass';
}else{
$logaction = "Control de Contraseٌa";
if ($_POST['password'])
{
$action = "Edicion/Control de Contraseٌa";
}else{
$action = "Eliminacion de Contraseٌa";
}
log_moderator_action($threadinfo, $logaction);
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET password = '" . addslashes($_POST['password']) . "' WHERE threadid = $threadid");
$_REQUEST['forceredirect'] = 1;
$url = "showthread.php?$session[sessionurl]t=$threadid";
eval(print_standard_redirect('redirect_openclose') );
}
}
التعديل علي التمبلت
تمبلت SHOWTHREAD
ابحث عن
<if condition="$show['editpoll']"><div><label for="ao_edp"><input type="radio" name="do" id="ao_edp" value="editpoll" />$vbphrase[edit_poll]</label></div></if>
اضف بعده
<div><label for="ao_etp"><input type="radio" name="do" id="ao_etp" value="editpassword" /><if condition="$thread['password']">Editar/Quitar Contraseٌa<else />Agregar Contraseٌa</if></label></div>
تمبلت threadbit
ابحث عن
:$thread[preview]
استبدله بالتالي
<if condition="!$thread['password']">$thread[preview]<else />Password Protected Thread</if>
اضافه تمبلت جديد
اسم التمبلت: threadadmin_editpass
ضع التالي به
<form action="postings.php" method="post" name="vbform">
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="t" value="$threadid" />
<input type="hidden" name="do" value="editpassword" />
<input type="hidden" name="dopass" value="1" />
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">Add a password to thread. To <b>remove password</b> let the text box blank</td>
</tr>
<tr>
<td class="thead">$vbphrase[title]: <span style="font-weight:normal">$threadinfo[title]</span></td>
</tr>
<tr>
<td class="panelsurround" align="center">
<div class="panel">
<div style="width:$stylevar[formwidth]" align="$stylevar[left]">
<div class="fieldset">
Password management
</div>
<div class="fieldset">
Contraseٌa:<br />
<input type="password" class="bginput" name="password" value="" size="50" maxlength="50" />
</div>
</div>
<div style="margin-top:$stylevar[cellpadding]px">
<input type="submit" class="button" value="<if condition="$threadinfo['password']">Edit password<else />Apply password</if>" accesskey="s" />
<input type="reset" class="button" value="$vbphrase[reset_fields]" accesskey="r" />
</div>
</td>
</tr>
</table>
</form>
ومبروك علي الهاك