SMF Development > SMF Coding Discussion

[code] แยกระหว่างหัวข้อติดหมุดกับหัวข้อปกติออกจากกัน

(1/1)

КёngЯacing:
หลายคนอาจจะเคยประสบปัญหาการแยกแยะระหว่างหัวข้อติดหมุดกับหัวข้อปกติ โค้ดตัวนี้ช่วยคุณได้

เปิดไฟล์ Themes/defeult/MessageIndex.template.php

<search for> ค้นหา

--- โค้ด: --- foreach ($context['topics'] as $topic)
{
--- ปิดโค้ด ---
</search for>

<Add after> ใส่ต่อจากที่ค้นหา

--- โค้ด: ---if (isset($previousTopicClass) && strpos($previousTopicClass, 'sticky') !== false && !$topic['is_sticky'])
echo '
<tr class="titlebg" style="font-size: 1ex;">
<td colspan="2">&nbsp;</td>
<td colspan="7">&nbsp;</td>
</tr>';
$previousTopicClass = $topic['class'];
--- ปิดโค้ด ---
</Add after>

ดูตัวอย่างได้ที่ http://rcweb.net/forums-test/?board=2.0

Code from RacingWeb Forum Develop SMF 1.1

TinaCat:
ขอบคุณค่ะ
เอาไปใช้ที่เว็บ JustUsers.net ด้วยแล้ว :)

นำร่อง

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

ไปที่เวอร์ชันเต็ม