:: GPStt.com ::

หมวด บอร์ดทั่วไป
=> สารพันความรู้ - เทคโนโลยี => ข้อความที่เริ่มโดย: ลุงเปี๊ยก ที-เน็ตเวิร์ค (อ.สากเหล็ก) ที่ 19 เมษายน 2557, เวลา 23:35:41 น.

หัวข้อ: smf คลิกหน้าหรือกระทู้ ให้เปิดหน้าต่างใหม่
เริ่มหัวข้อโดย: ลุงเปี๊ยก ที-เน็ตเวิร์ค (อ.สากเหล็ก) ที่ 19 เมษายน 2557, เวลา 23:35:41 น.
[attach=1]
smf คลิกหน้าหรือกระทู้ ให้เปิดหน้าต่างใหม่

ในขั้นตอนการทำจะมีสองส่วน ดูว่าเราจะเลือกเปิดหน้าใหม่ส่วนไหน เลือกเอาอย่างใดอย่างนึงหรือเลือกทั้งสอง ตามสะดวก
1. เปิดหน้า Index ก็หมายถึงหน้าหลัก คือหน้าแรก และหน้าเว็บบอร์ด
2. คลิกกระทู้ แล้วเปิดหน้าต่างใหม่


ขั้นตอนการทำ ข้อ1.  (แบบเปิดหน้า Index ใหม่)

เข้าไปที่...
./ Themes/ ธีมที่ใช้/ BoardIndex.template.php

ค้นหาคำว่า... ประมาณบรรทัด 581
/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '

แล้วเพิ่มโค้ดสีแดงนี้ลงไป...
<base target="_blank">

จะได้เป็น...
/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '<base target="_blank">




ขั้นตอนการทำ ข้อ2.  (คลิกกระทู้ แล้วเปิดหน้าต่างใหม่)

เข้าไปที่...
./ Sources/ MessageIndex.php

ค้นหาคำว่า...
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['firstSubject'] . '[/url]'

แล้วเพิ่มโค้ดสีแดงนี้ลงไป...
target="_blank"

จะได้เป็น...
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0" target="_blank">' . $row['firstSubject'] . '[/url]'




ที่มาข้อมูล...ขอบคุณ
ข้อที่ 1.  http://www.welovethailand.com/webboard/index.php?topic=200.0 (http://www.welovethailand.com/webboard/index.php?topic=200.0)
ข้อที่ 2.  http://www.gotoknow.org/posts/432929 (http://www.gotoknow.org/posts/432929)