SMF Development > SMF Coding Discussion

ถึงคุณ КёngЯacing เรื่อง [code] แยกระหว่างหัวข้อติดหมุดกับหัวข้อปกติออกจากกัน

(1/1)

mapandy:
จากที่เข้าไปที่กระทู้  http://smf.rcweb.net/index.php?topic=89.0

ผมลองแก้ไฟล์ดู  ปรากฏว่าเปลี่ยนยังไงก็แสดงผลเหมือนเดิมครับ  เลยขอความกระจ่างอีกครั้ง

1. ค้นหาโค๊ด 

foreach ($context['topics'] as $topic)
   {

2. ใส่โค๊ดต่อ

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'];

อยากถามว่าต่อตรงไหนครับ 
ระหว่าง 1
foreach ($context['topics'] as $topic)
   {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'];

หรือ 2
foreach ($context['topics'] as $topic) 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'];
   {

หรือแบบอื่นครับ  ยังไงขอความอนุเคราะห์ให้ความกระจ่างด้วยครับ

КёngЯacing:
ใส่ต่อ หมายถึงขึ้นบรรทัดใหม่ ของ {

นำร่อง

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

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