หมวดไฟฟ้า/อิเล็กทรอนิกส์/คอมพิวเตอร์ => ห้อง SMF 2.0.X => Programming => ห้องคอมพิวเตอร์ => นานาสาระ SMF => ข้อความที่เริ่มโดย: Sound Man ที่ 18 กุมภาพันธ์ 2567, 10:06:05
-
เทคนิคการ เพิ่มปุ่ม Home ฉบับลูกทุ่งๆ ..
เนื่องจาก ตอนทำครั้งแรกนั้น Search หาวิธีแล้ว มีแต่คนเขียนไว้สำหรับ SMF 1.x
แต่เอามาใช้กับ บอร์ดรุ่นใหม่ที่โหลดมาไม่เป็น จึงต้อง Mod กันนิดหน่อย
ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง สมัครสมาชิก หรือ ลงชื่อเข้าระบบ
(http://www.jaikonjaunt.com/board/index.php?topic=151.0)
วิธีการทำ อ้างอิง Themes defaults ตามบอร์ดที่ผมใช้นะครับ
เปิดไฟล์ defaults/index.template.php
ค้นหา ข้อความ
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
-------------------------------------------------------------------------
แทรก code ต่อท้าย
echo '
<div id="main_menu">
<ul class="dropmenu" id="menu_nav">';
echo' <li id="button_index">
<a class="firstlevel" href="http://www.jaikonjaunt.com/index.php">
<span class="firstlevel">home</span>
[/url]
</li>';
-
โค้ดหลังจากแก้ไขแล้ว
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
<div id="main_menu">
<ul class="dropmenu" id="menu_nav">';
echo' <li id="button_index">
<a class="firstlevel" href="http://www.jaikonjaunt.com/index.php">
<span class="firstlevel">home</span>
</a>
</li>';
-
อีก Themes ครับ (ตอนนี้ไม่ได้ใช้ ทำลองเฉย)
code เดิม
function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
</td></tr>
</table>';
-------------------------------------------------------------------------------------------
code ใหม่่ หลังจากแทรก
function template_main_below()
{
global $context, $settings, $options, $scripturl, $txt;
echo '
<div id="main_menu">
<ul class="dropmenu" id="menu_nav">';
echo' <li id="button_index">
<a class="firstlevel" href="http://www.jaikonjaunt.com/index.php">
<span class="firstlevel">home</span>
</a>
</li>';
echo '
</td></tr>
</table>';
-
ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง สมัครสมาชิก หรือ ลงชื่อเข้าระบบ
(http://www.jaikonjaunt.com/board/index.php?topic=151.0)
ข้อมูลมาจากที่นี่... (http://www.jaikonjaunt.com/board/index.php?topic=151.0)
]]]