SMF & Programmer > Simple Machine Forum

ใส่ระบบแชร์บทความ Share this topic SMF 2.0.2

(1/1)

Admin:
ใส่ระบบแชร์บทความ 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

--- โค๊ด: ---http://custom.simplemachines.org/mods/index.php?mod=1608
--- End code ---

สำหรับใน SMF 2.0.2 ต้องลงแบบแมนวล(Manual)ครับ
***ใน Share this topic SMF Mod - Installation Instructions for 2.0.2 ของต้นฉบับตอนที่ผมไปเอามาโค้ดซ้อนกันเยอะถ้าจะไปเอาต้องระวังด้วยครับ
แต่ถ้าขี้เกียจเข้าไปเอา ก็ตามด้านล่างนี้เลย เรียบเรียงให้เรียบร้อยรวมทั้งแปลภาษาไทยและบอกวิธีเซ็ตค่าให้ด้วย !***

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


--- โค๊ด: --- array('check', 'enable_buddylist'),
--- End code ---


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


--- โค๊ด: --- array('check', 'share_this_topic'),
--- End code ---


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



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


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


--- โค๊ด: ---// 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 />';
--- End code ---


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


--- โค๊ด: ---?>
--- End code ---


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


--- โค๊ด: ---// 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'] = 'คลิกที่นี่ ก็อปปี่โค้ด วางในเว็บไซต์';
--- End code ---



วิธีตั้งค่าง่ายมาก
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 ด้านบน มองหา


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

--- End code ---

แก้เป็น


--- โค๊ด: ---  <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;">
--- End code ---


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

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



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

นำร่อง

[0] ดัชนีข้อความ

Go to full version