ติดต่อลงโฆษณา [email protected]

ผู้เขียน หัวข้อ: จะเพิ่มเมนูยังไงครับ  (อ่าน 6014 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ dekhong2

  • New Member
  • *
  • กระทู้: 3
    • ดูรายละเอียด
จะเพิ่มเมนูยังไงครับ
« เมื่อ: 20/12/08, 12:25:55 »
ผมจะเพิ่มเมนูตามรูปภาพนี้ยังไงครับ



ขอบคุณท่านผู้รู้ล่วงหน้าครับ




ออฟไลน์ YoTa

  • Full Member
  • ***
  • กระทู้: 226
  • เพศ: ชาย
    • ดูรายละเอียด
    • โยธาท้องถิ่น
Re: จะเพิ่มเมนูยังไงครับ
« ตอบ #1 เมื่อ: 20/12/08, 15:21:02 »
ผมอธิบายแล้วนะครับ  ลองหาดู

ออฟไลน์ dekhong2

  • New Member
  • *
  • กระทู้: 3
    • ดูรายละเอียด
Re: จะเพิ่มเมนูยังไงครับ
« ตอบ #2 เมื่อ: 20/12/08, 17:28:12 »
ผมเพิ่มเมนูตามที่ค้นหาเจอแล้วครับ แต่ประสบปัญหาครับ
เมนูส่วนเดิมตกลงมาข้างล่างหมดเลยครับ ขอวิธีแก้ไขด้วยครับ

ตัวอย่างตามภาพครับ

ออฟไลน์ YoTa

  • Full Member
  • ***
  • กระทู้: 226
  • เพศ: ชาย
    • ดูรายละเอียด
    • โยธาท้องถิ่น
Re: จะเพิ่มเมนูยังไงครับ
« ตอบ #3 เมื่อ: 20/12/08, 21:54:31 »
ผมเพิ่มเมนูตามที่ค้นหาเจอแล้วครับ แต่ประสบปัญหาครับ
เมนูส่วนเดิมตกลงมาข้างล่างหมดเลยครับ ขอวิธีแก้ไขด้วยครับ

ตัวอย่างตามภาพครับ



ขอดูโค๊ด เมนู  ทั้งหมดด้วยครับ  จะได้บอกถูก

ออฟไลน์ dekhong2

  • New Member
  • *
  • กระทู้: 3
    • ดูรายละเอียด
Re: จะเพิ่มเมนูยังไงครับ
« ตอบ #4 เมื่อ: 21/12/08, 13:42:42 »
โค้ด index.template.php ตามนี้ครับ (ผมได้แนบไฟล์มาให้ด้วยนะครับ)




   // Show the start of the tab section.

   echo '
   <ul>';


   // Show the [main] button.
   echo ($current_action=='MainSite' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'MainSite' ? 'active_back' : 'back' , '">
               <a href="../">', $txt['MainSite'] ,'[/url]
            </td>' , $current_action == 'MainSite' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


   // Show the [home] button.
   echo   '<li><a href="', $scripturl, '">' , $txt[103] , '[/url]</li>';
      
   // Show the [help] button.
   echo   '<li><a href="', $scripturl, '?action=help">' , $txt[119] , '[/url]</li>';

   // How about the [search] button?
   if ($context['allow_search'])
      echo '<li><a href="', $scripturl, '?action=search">' , $txt[182] , '[/url]</li>';

   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo   '<li><a href="', $scripturl, '?action=admin">' , $txt[2] , '[/url]</li>';

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo '<li><a href="', $scripturl, '?action=profile">' , $txt[79] , '[/url]</li>';

   // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo '<li><a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '[/url]</li>';

   // The [calendar]!
   if ($context['allow_calendar'])
      echo '<li><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '[/url]</li>';

   // the [member] list button
   if ($context['allow_memberlist'])
      echo '<li><a href="', $scripturl, '?action=mlist">' , $txt[331] , '[/url]</li>';


   // If the user is a guest, show [login] button.
   if ($context['user']['is_guest'])
      echo '<li><a href="', $scripturl, '?action=login">' , $txt[34] , '[/url]</li>';


   // If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
      echo '<li><a href="', $scripturl, '?action=register">' , $txt[97] , '[/url]</li>';


   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo '<li><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '[/url]</li>';

   echo '</ul>';


}

// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
   global $settings, $buttons, $context, $txt, $scripturl;

   // Create the buttons...
   foreach ($button_strip as $key => $value)
   {
      if (isset($value['test']) && empty($context[$value['test']]))
      {
         unset($button_strip[$key]);
         continue;
      }
      elseif (!isset($buttons[$key]) || $force_reset)
         $buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '[/url]';

      $button_strip[$key] = $buttons[$key];
   }

   if (empty($button_strip))
      return '<td>&nbsp;</td>';

   echo '
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
      <td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}
?>

ออฟไลน์ YoTa

  • Full Member
  • ***
  • กระทู้: 226
  • เพศ: ชาย
    • ดูรายละเอียด
    • โยธาท้องถิ่น
Re: จะเพิ่มเมนูยังไงครับ
« ตอบ #5 เมื่อ: 22/12/08, 20:14:53 »
ลองแบบผมดูนะครับ  น่าจะแก้ไขได้  เพราะผมก็ทำเช่นนี้

ตามภาพเลยผมแก้ไขดังนี้
 
โค้ด: [เลือก]
// Show the [home] button.
   echo ($current_action=='MainSite' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'MainSite' ? 'active_back' : 'back' , '">
               <a href="../">' , $txt[103] , '[/url]
            </td>' , $current_action == 'MainSite' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [webboard] button.
   echo ($current_action=='webboard' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'webboard' ? 'active_back' : 'back' , '">
               <a href="../">webboard[/url]
            </td>' , $current_action == 'webboard' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


ลองดูนะครับแล้วแจ้งผลหน่อย  เพราะไม่ได้แก้ไขของจริงเลยไม่แน่ใจ  แต่แนวทางน่าจะเป็นแบบนี้