- การแสดงชื่อกล่องเมาส์บนแถบเมนู
อันนี้ที่ทำเป็นตัวอย่างคือธีม
Default ของ SMF เค้าน่ะครับ...
เปิดไฟล์
[ฟอรั่ม]/Themes/default/index.template.php เลย
จากนั้นให้หาโค้ด
$current_action = 'admin';
เราก็จะเจอโค้ดแถว ๆ นี้ครับ
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
จากนั้นให้ใส่ โค้ด
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm' , 'dtchat'))) สังเกต
, 'dtchat' ที่เพิ่มมาครับ
ยังไม่จบหรอก อิอิ หาโค้ด
// Show the [home] button.
ให้ใส่ โค้ดนี้ลงไป
// Show the [DtChat] button.
if ($context['user']['is_logged'])
echo ($current_action == 'dtchat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'dtchat' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=dtchat">' , 'กล่องเมาส์' , '</a>
</td>' , $current_action == 'dtchat' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
โดยจะต้องอยู่หลังโค้ด นี้...
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
อันนี้เป็นวิธีแบบ Step By Step สำหรับคนที่ยังไม่ค่อยรู้เรื่องก็ถามได้ครับ