หมวดไฟฟ้า/อิเล็กทรอนิกส์/คอมพิวเตอร์ => ห้อง SMF 2.0.X => Programming => ห้องคอมพิวเตอร์ => นานาสาระ SMF => ข้อความที่เริ่มโดย: Sound Man ที่ 18 กุมภาพันธ์ 2567, 10:06:05

หัวข้อ: เพิ่มเมนู กลับหน้าแรก เว็บไซด์ จากบอร์ด 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
ค้นหา ข้อความ


โค๊ด: [Select]
// 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>';
หัวข้อ: เพิ่มเมนู กลับหน้าแรก เว็บไซด์ จากบอร์ด SMF ดูแนวทางประยุกต์ใช้
เริ่มหัวข้อโดย: Sound Man ที่ 18 กุมภาพันธ์ 2567, 10:07:15
   โค้ดหลังจากแก้ไขแล้ว
โค๊ด: [Select]
// 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>';
หัวข้อ: เพิ่มเมนู กลับหน้าแรก เว็บไซด์ จากบอร์ด SMF ดูแนวทางประยุกต์ใช้
เริ่มหัวข้อโดย: Sound Man ที่ 18 กุมภาพันธ์ 2567, 10:09:39
อีก Themes  ครับ  (ตอนนี้ไม่ได้ใช้ ทำลองเฉย)
code เดิม

โค๊ด: [Select]
function template_main_below()
{
   global $context, $settings, $options, $scripturl, $txt;

   echo '
      </td></tr>
   </table>';
-------------------------------------------------------------------------------------------
code ใหม่่ หลังจากแทรก

โค๊ด: [Select]
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>';
หัวข้อ: เพิ่มเมนู กลับหน้าแรก เว็บไซด์ จากบอร์ด SMF ดูแนวทางประยุกต์ใช้
เริ่มหัวข้อโดย: Sound Man ที่ 18 กุมภาพันธ์ 2567, 10:10:39
ตรงนี้มีภาพ! แต่ท่านจะมองไม่เห็น , ท่านต้อง  สมัครสมาชิก หรือ ลงชื่อเข้าระบบ
 (http://www.jaikonjaunt.com/board/index.php?topic=151.0)

  ข้อมูลมาจากที่นี่... (http://www.jaikonjaunt.com/board/index.php?topic=151.0)

 ]]]