Computer Tips, IT Tips, SMF, Web Design

[SMF] การแสดงหัวข้อหรือกระทู้ล่าสุด (RecentTopics) บนหน้าแรกของบอร์ด

อ่าน: 3,203 ครั้ง
Advertising

บอร์ด SMF แสดงกระทู้ล่าสุดบนหน้าแรก (Recent Topics)

 

คำเตือน ก่อนมีการแก้ไขใดๆควรcopyไฟล์ที่ต้องการแก้ไขเก็บไว้ก่อนกันพลาด

 

1. ไปที่ /Themes/defaults/BoardIndex.template.php

 

2. แก้ไขไฟล์ BoardIndex.template.php
หา

<?php

เพิ่มtagข้างล่าง หลังที่หา (tagข้างล่างนี้ของใครของมัน)

require("/home/xxx/domains/xxx.com/public_html/forum/SSI.php");

3. หา

// List all the lines of the news for display.
 var smfFadeContent = new Array(
 "', implode('",
 "', $context['fader_news_lines']), '"
 );
 // ]]>

';
 }

เพิ่มTagข้างล่าง หลังที่หา 

echo '
 <div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">
 <div id="upshrinkHeaderIC">

<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
 <tr>
 <td class="titlebg" colspan="2">หัวข้อล่าสุด </td>
 </tr>
 <td class="windowbg2">
 <table cellpadding="0" cellspacing="0" width="100%" border="0">
 <tr>
 <td class="middletext" valign="top">';
 ssi_recentTopics(10); /*ให้แก้ไขตัวเลขในวงเล็บว่าจะให้แสดงกี่หัวข้อ*/
 echo '</td>
 </tr>
 </table>
 </td>
 </tr></tr></table> ';

ดูตัวอย่างที่นี่ >>>เว็บตัวอย่างแสดงหัวข้อล่าสุด

เท่านี้ท่านก็สามารถทำ SMF หัวข้อล่าสุด หรือ กระทู้ล่าสุดมาแสดงไว้ที่หน้าแรกได้แล้ว

Advertising

Advertising