22 พฤษภาคม 2555, 16:41:02
ยินดีต้อนรับผู้เยี่ยมชม
  • noavata
  • ยินดีต้อนรับคุณ, ผู้เยี่ยมชม กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน
    เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
Page Rank

ทำเว็บไซต์ | แต่งบอร์ด | ออกแบบ | SMF | Joomla | Drupal | WordPress | JQuery | CMS | ECommerce | Tel. +668-08577477

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: Reason For Editing Mod แก้ไขกระทู้ฉันทำไม?  (อ่าน 1104 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general เมื่อ: 8 กรกฎาคม 2553, 20:21:55
  • ชื่อ: Reason For Editing Mod
  • ผู้เขียน: Nibogo
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: Posting
  • รองรับ: SMF 1.1.xx, 2.0.xx
  • ปรับปรุงล่าสุด: 5 กรกฎาคม 2553
  • ต้นฉบับ: Reason For Editing Mod

รายละเอียด
      เพิ่มเหตุผลของการแก้ไขกระทู้ว่าเพราะเหตุใด สามารถกำหนดสิทธิ์ให้กลุ่มต่างๆ ที่มีสิทธิ์แก้ไขกระทู้ ทั้งที่มีสิทธิ์แก้ไขกระทู้ของตัวเอง และแก้ไขกระทู้ของผู้อื่น

ตัวอย่าง


สำหรับ SMF 1.1.xx

แก้ไขไฟล์:

file $sourcedir/Post.php

ค้นหา -->>
โค๊ด: [Select]
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

แก้เป็น -->>
โค๊ด: [Select]
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
$msgOptions['edit_reason'] = addslashes(strtr(htmlspecialchars(isset($_POST['edit_reason']) ? $_POST['edit_reason'] : ''), array("\r" => '', "\n" => '', "\t" => '')));

file $sourcedir/Display.php

ค้นหา -->>
โค๊ด: [Select]
ID_MSG, icon, subject, posterTime, posterIP, ID_MEMBER, modifiedTime, modifiedName, body,

แก้เป็น -->>
โค๊ด: [Select]
ID_MSG, icon, subject, posterTime, posterIP, ID_MEMBER, modifiedTime, modifiedName, body, edit_reason,

ค้นหา -->>
โค๊ด: [Select]
'timestamp' => forum_time(true, $message['modifiedTime']),

แก้เป็น -->>
โค๊ด: [Select]
'timestamp' => forum_time(true, $message['modifiedTime']),
'edit_reason' => $message['edit_reason'],

file $sourcedir/Subs-Post.php

ค้นหา -->>
โค๊ด: [Select]
$messages_columns[] = "ID_MSG_MODIFIED = $modSettings[maxMsgID]";

แก้เป็น -->>
โค๊ด: [Select]
$messages_columns[] = "ID_MSG_MODIFIED = $modSettings[maxMsgID]";
if (!empty($msgOptions['edit_reason']))
$messages_columns[] = "edit_reason = '$msgOptions[edit_reason]'";
else
$messages_columns[] = "edit_reason = ''";

file $sourcedir/ManagePermissions.php

ค้นหา -->>
โค๊ด: [Select]
'report_any' => false,

แก้เป็น -->>
โค๊ด: [Select]
'report_any' => false,
'reason_edit' => false,

file $themedir/Post.template.php

ค้นหา -->>
โค๊ด: [Select]
// The below function prints the BBC, smileys and the message itself out.
theme_postbox($context['message']);

แก้เป็น -->>
โค๊ด: [Select]
// The below function prints the BBC, smileys and the message itself out.
theme_postbox($context['message']);

        // Reason for Editing Mod
if ((!$context['is_new_post']) && (allowedTo('reason_edit')))
echo '
<tr>
<td valign="top" align="right">
<b>'.$txt['reason_edit'].':</b>
</td>
<td>
<input type="text" name="edit_reason" size="50" value="" />
</td>
</tr>';

file $themedir/Display.template.php

ค้นหา -->>
โค๊ด: [Select]
echo '
&#171; <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> &#187;';

แก้เป็น -->>
โค๊ด: [Select]
echo '
&#171; <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , '  </i> &#187;';

file $languagedir/Modifications.thai-utf8.php

เพิ่ม -->>
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

สร้างไฟล์: db_reason1.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/db_reason1.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?php

/**********************************************************************************
* db_reason1.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                                        *                                            
*                                                                                 *                                                                                 
**********************************************************************************/

    // Verify if we have this column already
    
$request db_query("
SHOW COLUMNS
FROM {$db_prefix}messages"
);

    while (
$row mysql_fetch_row($request))
$found |= $row[0] === 'edit_reason';
    
mysql_free_result($request);

    
// Add the column if not exist 
    
if (!$found)
    db_query("
    ALTER TABLE {$db_prefix}messages
ADD edit_reason tinytext NOT NULL"
__FILE____LINE__);               
?>


การตั้งค่า: ผู้ดูแล -->> แก้ไขการอนุญาต -->> กลุ่มสมาชิก [ขั้นสูง] -->> ให้ใส่เหตุผลการแก้ไข

ลิงค์หัวข้อ: http://dexmore.com/topic/2317
Windows XP    Firefox 3.6.6   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 1 เมื่อ: 8 กรกฎาคม 2553, 20:39:19
สำหรับ SMF 2.0.xx

แก้ไขไฟล์:

file $sourcedir/Post.php

ค้นหา -->>
โค๊ด: [Select]
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';

แก้เป็น -->>
โค๊ด: [Select]
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , '  </em> &#187;';

file $sourcedir/Post.php

ค้นหา -->>
โค๊ด: [Select]
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'];
}

แก้เป็น -->>
โค๊ด: [Select]
// 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

ค้นหา -->>
โค๊ด: [Select]
id_msg, icon, subject, poster_time, poster_ip, id_member, modified_time, modified_name, body,

แก้เป็น -->>
โค๊ด: [Select]
id_msg, icon, subject, poster_time, poster_ip, id_member, modified_time, modified_name, body, edit_reason,

ค้นหา -->>
โค๊ด: [Select]
'name' => $message['modified_name'

แก้เป็น -->>
โค๊ด: [Select]
'name' => $message['modified_name'],
'edit_reason' => $message['edit_reason']

file $sourcedir/Subs-Post.php

ค้นหา -->>
โค๊ด: [Select]
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'];
}

แก้เป็น -->>
โค๊ด: [Select]
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

ค้นหา -->>
โค๊ด: [Select]
$groupLevels['global']['standard'] = array_merge($groupLevels['global']['restrict'], array(

แก้เป็น -->>
โค๊ด: [Select]
$groupLevels['global']['standard'] = array_merge($groupLevels['global']['restrict'], array(
'reason_edit',

ค้นหา -->>
โค๊ด: [Select]
'post_new' => array(false, 'topic', 'make_posts'),

แก้เป็น -->>
โค๊ด: [Select]
'reason_edit' => array(false, 'topic', 'make_posts', 'make_posts'),
'post_new' => array(false, 'topic', 'make_posts'),

file $themedir/Post.template.php

ค้นหา -->>
โค๊ด: [Select]
// 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>';

แก้เป็น -->>
โค๊ด: [Select]
// 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

ค้นหา -->>
โค๊ด: [Select]
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';

แก้เป็น -->>
โค๊ด: [Select]
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], !empty($message['modified']['edit_reason']) ? ', '.$txt['reason'].': ' . $message['modified']['edit_reason'] : '' , '  </em> &#187;';

file $languagedir/Modifications.thai-utf8.php

เพิ่ม -->>
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

สร้างไฟล์: db_reason2.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/db_reason2.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?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
Windows XP    Firefox 3.6.6   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
ส่งหัวข้อนี้พิมพ์ หน้า: 1 
กระโดดไป:  

Creative Commons License

SMF Thai Translation Powered by SMF © 2006–2012, Simple Machines LLC

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : วันนี้ เวลา 01:28:10

jQuery Plugin Copyright © 2551-2555 Themes Design & Hosting by DexMoreGroup

Sitemap | Thai Simple Machines Forum support SMF Thai

Web Begining | SMF Modifications | SMF Thai Translation Web Begining

Drupal | WordPress | CMS Joomla | jQuery Plugin | Web Graphics CMS Joomla