สำหรับ SMF 2.0.xxแก้ไขไฟล์:file $sourcedir/Post.php
ค้นหา -->>
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> »';
แก้เป็น -->>
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , ' </em> »';
file $sourcedir/Post.php
ค้นหา -->>
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = $user_info['name'];
}
แก้เป็น -->>
// Have admins allowed people to hide their screwups?
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = $user_info['name'];
}
// Reason for Editing Mod
$msgOptions['edit_reason'] = addslashes(strtr(htmlspecialchars(isset($_POST['edit_reason']) ? $_POST['edit_reason'] : ''), array("\r" => '', "\n" => '', "\t" => '')));
file $sourcedir/Display.php
ค้นหา -->>
id_msg, icon, subject, poster_time, poster_ip, id_member, modified_time, modified_name, body,
แก้เป็น -->>
id_msg, icon, subject, poster_time, poster_ip, id_member, modified_time, modified_name, body, edit_reason,
ค้นหา -->>
'name' => $message['modified_name'
แก้เป็น -->>
'name' => $message['modified_name'],
'edit_reason' => $message['edit_reason']
file $sourcedir/Subs-Post.php
ค้นหา -->>
if (!empty($msgOptions['modify_time']))
{
$messages_columns['modified_time'] = $msgOptions['modify_time'];
$messages_columns['modified_name'] = $msgOptions['modify_name'];
$messages_columns['id_msg_modified'] = $modSettings['maxMsgID'];
}
แก้เป็น -->>
if (!empty($msgOptions['modify_time']))
{
$messages_columns['modified_time'] = $msgOptions['modify_time'];
$messages_columns['modified_name'] = $msgOptions['modify_name'];
$messages_columns['id_msg_modified'] = $modSettings['maxMsgID'];
// Reason for Editing Mod
if (isset($msgOptions['edit_reason']))
$messages_columns['edit_reason'] = $msgOptions['edit_reason'];
}
file $sourcedir/ManagePermissions.php
ค้นหา -->>
$groupLevels['global']['standard'] = array_merge($groupLevels['global']['restrict'], array(
แก้เป็น -->>
$groupLevels['global']['standard'] = array_merge($groupLevels['global']['restrict'], array(
'reason_edit',
ค้นหา -->>
'post_new' => array(false, 'topic', 'make_posts'),
แก้เป็น -->>
'reason_edit' => array(false, 'topic', 'make_posts', 'make_posts'),
'post_new' => array(false, 'topic', 'make_posts'),
file $themedir/Post.template.php
ค้นหา -->>
// If this message has been edited in the past - display when it was.
if (isset($context['last_modified']))
echo '
<div class="padding smalltext">
<strong>', $txt['last_edit'], ':</strong>
', $context['last_modified'], '
</div>';
แก้เป็น -->>
// Reason for Editing Mod
if ((!$context['is_new_post']) && (allowedTo('reason_edit')))
echo '
<div class="padding smalltext">
<strong>'.$txt['reason_edit'].':</strong>
<input type="text" name="edit_reason" size="50" value="" />
</div>';
// If this message has been edited in the past - display when it was.
if (isset($context['last_modified']))
echo '
<div class="padding smalltext">
<strong>', $txt['last_edit'], ':</strong>
', $context['last_modified'], '
</div>';
file $themedir/Display.template.php
ค้นหา -->>
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> »';
แก้เป็น -->>
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , ' </em> »';
file $languagedir/Modifications.thai-utf8.php
เพิ่ม -->>
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Comสร้างไฟล์: db_reason2.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/db_reason2.php -->> Enter เสร็จแล้วลบทิ้ง
<?php
/**********************************************************************************
* db_reason2.php *
***********************************************************************************
* *
* Reason for Editing Mod *
* Copyright (c) 2009 by NIBOGO. All rights reserved. *
* Powered by www.mundo-se.com *
* Created by NIBOGO for Simplemachines.org *
* *
**********************************************************************************/
global $smcFunc, $db_prefix, $context;
db_extend('packages');
// Add the new column
$smcFunc['db_add_column'] ('{db_prefix}messages', array(
'name' => 'edit_reason',
'type' => 'tinytext',
'null' => false
));
?>
ลิงค์หัวข้อ:
http://dexmore.com/topic/2317