หัวใจออนทัวร์

แนะนำ ถามให้หายข้องใจ => ประสปการณ์คนทำเวป => Topic started by: Phoenix on July 28, 2011, 02:04:42 PM

Title: เพิ่มเมนู กลับหน้าแรก เว็บไซด์ จากบอร์ด SMF
Post by: Phoenix on July 28, 2011, 02:04:42 PM
เทคนิคการ เพิ่มปุ่ม Home ฉบับลูกทุ่งๆ ..
เนื่องจาก ตอนทำครั้งแรกนั้น  Search หาวิธีแล้ว มีแต่คนเขียนไว้สำหรับ SMF 1.x แต่เอามาใช้กับ บอร์ดรุ่นใหม่ที่โหลดมาไม่เป็น จึงต้อง  Mod กันนิดหน่อย
Title: Re: เพิ่มเมนู กลับหน้าแรก เว็บไซด์ จากบอร์ด SMF
Post by: Phoenix on July 28, 2011, 03:11:04 PM
วิธีการทำ อ้างอิง 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  ต่อท้าย
Quote
   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>';
Title: Re: เพิ่มเมนู กลับหน้าแรก เว็บไซด์ จากบอร์ด SMF
Post by: Phoenix on July 28, 2011, 03:12:05 PM
code หลังจากการแก้ไข

Quote
// 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>';
Title: Re: เพิ่มเมนู กลับหน้าแรก เว็บไซด์ จากบอร์ด SMF
Post by: Phoenix on July 28, 2011, 03:22:58 PM
อีก Themes  ครับ  (ตอนนี้ไม่ได้ใช้ ทำลองเฉย)
code เดิม
Quote
function template_main_below()
{
   global $context, $settings, $options, $scripturl, $txt;

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