- ชื่อ: Copy Topics
- ผู้เขียน: vbgamer45
- นำเสนอโดย: DexMoreGroup
- ประเภท: New Feature
- รองรับ: SMF 1.1.xx, 2.0.xx
- ปรับปรุงล่าสุด: 8 มีนาคม 2553
- ต้นฉบับ: Copy Topics
รายละเอียด เคยเห็นมีคนถามถึงถามหากันว่าทำอย่างไรถึงจะคัดลอกกระทู้ได้ครั้งละหลายๆ กระทู้ mod นี้สมใจนึกบางลำภูกันเลยครับ ความสามารถเกินตัวจริงๆ มาดูกันครับ
- กำหนดกลุ่มสมาชิกได้ว่าให้กลุ่มใหนมีสิทธิคัดลอกได้
- คัดลอกกระทู้เดี่ยวๆ จากหน้าอ่านกระทู้ (Display)
- คัดลอกกระทู้คราวละเข่งจากหน้าหัวข้อ (Message Index)
- คัดลอกหัวข้อทั้งหมด
- เพิ่มกระทู้และเลื่อนระดับให้เจ้าของกระทู้ด้วย
- ปรับปรุงสถิติอีกต่างหาก
- คัดลอกปฏิทินและกิจกรรมที่ลิงค์กับหัวข้อ
- คัดลอกโพลล์ให้ด้วย
- ไฟล์แนบก็ไม่เหลือคัดลอกไปหมดเลย
- แต่..ทั้งนี้ทั้งนั้นคัดลอกได้คราวละไม่เกิน 1 M นะ
ตัวอย่าง
สำหรับ SMF 1.1.xxแก้ไขไฟล์:file $boarddir/index.php
ค้นหา -->>
'deletemsg' => array('RemoveTopic.php', 'DeleteMessage'),
เพิ่มไว้ก่อน -->>
'copytopic' => array('CopyTopic.php', 'CopyTopic'),
'copytopic2' => array('CopyTopic.php', 'CopyTopic2'),
file $sourcedir/Subs-Boards.php
ค้นหา -->>
// Only a few possible actions.
$possibleActions = array('markread');
เพิ่มไว้ก่อน -->>
// Start of CopyTopics mod
if (isset($_REQUEST['qaction']) && $_REQUEST['qaction'] == "copy")
{
require_once($sourcedir . '/CopyTopic.php');
CopyMultipleTopics();
$redirect_url = isset($_POST['redirect_url']) ? $_POST['redirect_url'] : (isset($_SESSION['old_url']) ? $_SESSION['old_url'] : '');
redirectexit($redirect_url);
return;
}
// End of CopyTopics mod
file $sourcedir/Display.php
ค้นหา -->>
'can_split' => 'split_any',
เพิ่มไว้หลัง -->>
'can_copy' => 'copy',
file $sourcedir/ManagePermissions.php
ค้นหา -->>
'send_mail',
เพิ่มไว้หลัง -->>
'copy',
ค้นหา -->>
'move' => true,
เพิ่มไว้หลัง -->>
'copy' => false,
file $sourcedir/MessageIndex.php
ค้นหา -->>
$context['can_merge'] = allowedTo('merge_any');
เพิ่มไว้หลัง -->>
$context['can_copy'] = allowedTo('copy');
ค้นหา -->>
'move' => allowedTo('move_any') || ($started && allowedTo('move_own')),
เพิ่มไว้หลัง -->>
'copy' => allowedTo('copy'),
file $themedir/MessageIndex.template.php
ค้นหา -->>
if ($topic['quick_mod']['move'])
echo '<a href="', $scripturl, '?action=movetopic;board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.gif" width="16" alt="', $txt[132], '" title="', $txt[132], '" /></a>';
เพิ่มไว้หลัง -->>
if ($topic['quick_mod']['copy'])
echo '<a href="', $scripturl, '?action=copytopic;board=', $context['current_board'], '.', $context['start'], ';topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_copy.gif" width="16" alt="', $txt['copytopic'], '" title="', $txt['copytopic'], '" /></a>';
ค้นหา -->>
<select name="qaction"', $context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
แก้เป็น -->>
<select name="qaction"', ($context['can_move'] || $context['can_copy']) ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\' && this.options[this.selectedIndex].value != \'copy\' );"' : '', '>
ค้นหา -->>
', $context['can_merge'] ? '<option value="merge">' . $txt['quick_mod_merge'] . '</option>' : '', '
เพิ่มไว้หลัง -->>
', $context['can_copy'] ? '<option value="copy">' . $txt['quick_mod_copy'] . '</option>' : '', '
ค้นหา -->>
if ($context['can_move'])
{
echo '
<select id="moveItTo" name="move_to" disabled="disabled">';
แก้เป็น -->>
if ($context['can_move'] || $context['can_copy'])
{
echo '
<select id="moveItTo" name="move_to" disabled="disabled">';
file $themedir/Display.template.php
ค้นหา -->>
'move' => array('test' => 'can_move', 'text' => 132, 'image' => 'admin_move.gif', 'lang' => true, 'url' => $scripturl . '?action=movetopic;topic=' . $context['current_topic'] . '.0'),
เพิ่มไว้หลัง -->>
'copy' => array('test' => 'can_copy', 'text' => 'copytopic', 'image' => 'admin_copy.gif', 'lang' => true, 'url' => $scripturl . '?action=copytopic;topic=' . $context['current_topic'] . '.0'),
file $languagedir/Modifications.thai-utf8.php
เพิ่ม -->>
$txt['copytopic_copyto'] = 'Copy to';
$txt['quick_mod_copy'] = 'Copy selected to';
$txt['copytopic'] = 'Copy Topic';
$txt['copytopics'] = 'Copy Topics';
$txt['cannot_copy'] = 'You do not have the permissions to allow you to copy a topic';
$txt['copytopic_noboards'] = 'There are no boards to copy this topic to!';
$txt['copytopic_notallowed'] = 'You are not allowed to copy topics to boards you cannot view!';
$txt['permissionname_copy'] = 'Copy Topic';
$txt['permissionhelp_copy'] = 'Copy a topic from one board to the other. Users can only select target boards they are allowed to access.';
$txt['copytopic_negativeseo'] = 'Be aware that there maybe a negative SEO effect by copying topics as it may get detected by Search Engines as duplicated content.';
ดาวโหลด: CopyTopic1.rar
ขออภัย! ส่วนนี้สงวนไว้เฉพาะสมาชิกเท่านั้น กรุณา เข้าสู่ระบบ หรือ ลงทะเบียนแตกไฟล์แล้วอัพโหลดไปไว้ที่
file admin_copy.gif -->> $themedir/images/buttons
file quick_copy.gif -->> $themedir/images/icons
file CopyTopic.php -->> $sourcedir
file CopyTopic.template.php -->> $themesdir/default
การตั้งค่า: ข้อมูลส่วนตัว -->> ปรับแต่งธีมและการวางรูปแบบ -->> แสดงปุ่มเลือกข้อความในหน้าดัชนีข้อความเป็น [เช็คบล๊อค]
ลิงค์หัวข้อ:
http://dexmore.com/topic/1900