ผู้เขียน หัวข้อ: ใส่ระบบแชร์บทความ Share this topic SMF 2.0.2  (อ่าน 3881 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ Admin

  • Administrator
  • *****
  • กระทู้: 1415
  • Level:
    0%
  • Thank : 61
  • เพศ: ชาย
    • ดูรายละเอียด
    • สะกิดข่าว
ใส่ระบบแชร์บทความ Share this topic SMF 2.0.2
« เมื่อ: ตุลาคม 13, 2012, 11:49:25 pm »
ใส่ระบบแชร์บทความ Share this topic SMF 2.0.2

เป็นระบบแชร์บทความแต่ละหัวข้อของบทความ เป็นโค้ดแบบ BBCode และ HTML
ดูตัวอย่างของจริงที่ด้านล่างสุดของกระทู้

Mod Name: Share this topic SMF Mod
Created By: Dzonny
Latest Version: 1.3
Compatible With: 1.1.7, 1.1.8, 1.1.12, 2.0 Beta 4, 2.0 RC1, 2.0 RC4
โค๊ด: [Select]
http://custom.simplemachines.org/mods/index.php?mod=1608
สำหรับใน SMF 2.0.2 ต้องลงแบบแมนวล(Manual)ครับ
***ใน Share this topic SMF Mod - Installation Instructions for 2.0.2 ของต้นฉบับตอนที่ผมไปเอามาโค้ดซ้อนกันเยอะถ้าจะไปเอาต้องระวังด้วยครับ
แต่ถ้าขี้เกียจเข้าไปเอา ก็ตามด้านล่างนี้เลย เรียบเรียงให้เรียบร้อยรวมทั้งแปลภาษาไทยและบอกวิธีเซ็ตค่าให้ด้วย !***

File Edits : ./Sources/ManageSettings.php
Find: ค้นหา

โค๊ด: [Select]
array('check', 'enable_buddylist'),

Add After : เติมหลังที่หา

โค๊ด: [Select]
array('check', 'share_this_topic'),

เปิดไฟล์ ./Themes/default *หรือธีมที่ใช้ในปัจจุบัน/Display.template.php
Find : ค้นหา


โค๊ด: [Select]
if ($context['can_reply'] && !empty($options['display_quick_reply']))
{
echo '


Add Before : เติมก่อนที่หา

โค๊ด: [Select]
// Share this topic - SMF Mod
$share_this_topic = 1;
if (isset($modSettings['share_this_topic']) && $modSettings['share_this_topic'] == 1)

  echo'
  <div class="tborder" style="margin-top: 0;">
  <div class="catbg" style="padding: 6px; vertical-align: middle; text-align: left; ">
  ',$txt['stt_1'],'
  </div>
    <table class="windowbg2" width="100%">
      <tr>
        <td width="13%" style="padding:5px;">', $txt['stt_2'] ,'</td>
        <td><textarea style="overflow:hidden;padding:0;margin:0;" readonly="readonly" rows="2" cols="50" onclick="this.select();" title="', $txt['stt_t_1'] ,'">
[url=http://www.system-4x.com/go.php?' . $scripturl . '?topic=' . $context['current_topic'] .'.0]', $context['subject'], '[/url]
          </textarea></td>
      </tr>
      <tr>
        <td width="13%" style="padding:5px;">', $txt['stt_3'] ,'</td>
        <td><textarea style="overflow:hidden;padding:0;margin:0;" readonly="readonly" rows="2" cols="50" onclick="this.select();" title="', $txt['stt_t_2'] ,'">
<a href="' . $scripturl . '?topic=' . $context['current_topic'] .'.0">', $context['subject'], '</a>
            </textarea></td>
        </tr>
    </table>
  </div><br />';


เปิดไฟล์ภาษา ./Themes/default/languages/Modifications.thai-utf8.php
Find : ค้นหา

โค๊ด: [Select]
?>

Add Before : วางก่อนที่หา

โค๊ด: [Select]
// Share this topic SMF Mod - Translate by RavacDS
$txt['share_this_topic'] = 'Enable Share This Topic (เปิดแชร์บทความ)';
$txt['stt_1'] = 'แชร์บทความ...';
$txt['stt_2'] = '<b>โค้ดแบบ forum</b><br /><small>(BBCode)</small>';
$txt['stt_3'] = '<b>โค้ดแบบ site/blog</b><br /><small>(HTML)</small>';
$txt['stt_t_1'] = 'คลิกที่นี่ ก็อปปี่โค้ด วางในฟอรั่ม';
$txt['stt_t_2'] = 'คลิกที่นี่ ก็อปปี่โค้ด วางในเว็บไซต์';



วิธีตั้งค่าง่ายมาก
admin/ปรับแต่งบอร์ด /Features and Options/ทั่วไป /Enable Share This Topic (เปิดแชร์บทความ) ติ๊กถ้าต้องการแชร์


แก้ปัญหาสำหรับท่านที่ใช้  Display.template.php ของ /Themes/default/ คือธีมที่ไม่มี Display.template.php เป็นของตนเอง***
และปัญหานี้แก้ด้วยการก็อปไฟลฺ Display.template.php จาก /Themes/default/Display.template.php
มาใส่ลงยัง  /Themes/ธีมปัจจุบันของเรา/Display.template.php ก็ไม่หาย

หรือจะใช้วิธีแบบดิบๆก็ตามด้านล่างนี้เลย
ปัญหาคือ ขอบบาร์หาย เพราะ index.css ของ default มันหาไฟล์ main_block.png ใน /ธีมปัจจุบันของเรา/images/theme/main_block.png ไม่เจอ


ให้แก้ไขโดยเขียนพาธไฟล์เต็มใส่ลงไปดังนี้
จากโค้ด Display.template.php ด้านบน มองหา

โค๊ด: [Select]
<div class="catbg" style="padding: 6px; vertical-align: middle; text-align: left; ">

แก้เป็น

โค๊ด: [Select]
  <div class="catbg" style="padding: 6px; vertical-align: middle; text-align: left; background: url(http://www.เว็บของคุณ.com/webboard/Themes/โฟลเดอร์ชื่อธีมปัจจุบันของเรา/images/theme/main_block.png) no-repeat -10px -280px;">

สรุปคือเพิ่ม background: url(http://www.เว็บของคุณ.com/webboard/Themes/โฟลเดอร์ชื่อธีมปัจจุบันของเรา/images/theme/main_block.png) no-repeat -10px -280px;"> เติมลงไปนั่นเอง ระวังใส่ url ให้ถูกตามรูปแบบเว็บของแต่ละท่าน

หลังแก้ไขแล้ว



ขอบคุณรูปภาพจาก welovethailand มากครับ

 
แชร์บทความ...
โค้ดแบบ forum
(BBCode)
โค้ดแบบ site/blog
(HTML)