How to add forum buttom with simple portal

Started by kpeter23, August 02, 2008, 11:27:33 PM

Previous topic - Next topic

kpeter23

Here is my code what do I have to modify to get the forum buttom on my templete. I have the orangline theme and the forum button doesnt show up.

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   // Work out where we currently are.
   $current_action = 'home';
   if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
      $current_action = 'admin';
   if (in_array($context['current_action'], array('search', 'forum', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

   // Are we using right-to-left orientation?
   if ($context['right_to_left'])
   {
      $first = 'last';
      $last = 'first';
   }
   else
   {
      $first = 'first';
      $last = 'last';
   }

   // Show the start of the tab section.
  echo '
        <div id="stylefour">
           <ul>';

          // Show the [home] button.
               echo '<li><a' , $current_action=='home' ? ' class="chosen"' : '' , ' href="', $scripturl, '"><b>' , $txt[103] , '</b></a></li>';

          // Show the [KickerStore] button.       
               echo '<li><a href="hxxp:astore.amazon.com/kicsblo-20 [nonactive] "><span>KickerStore</span></a></li>';

         
          // Show the [help] button.
                              echo '<li><a' , $current_action=='help' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=help"><b>' , $txt[119] , '</b></a></li>';

         // How about the [search] button?
               if ($context['allow_search'])
                  echo '<li><a' , $current_action=='search' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=search"><b>Search</b></a></li>';

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

       // Is the user allowed to administrate at all? ([admin])
               if ($context['allow_admin'])
                  echo '<li><a' , $current_action=='admin' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=admin"><b>' , $txt[2] , '</b></a></li>';
       // Edit Profile... [profile]
               if ($context['allow_edit_profile'])
                  echo '<li><a' , $current_action=='profile' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=profile"><b>' , $txt[79] , '</b></a></li>';

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

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

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

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

   // Otherwise, they might want to [logout]...
      if ($context['user']['is_logged'])
      echo '<li><a ' , $current_action=='logout' ? ' class="chosen"' : '' , 'href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><b>' , $txt[108] , '</b></a></li>';
   echo '
      </ul>
       </div>';
}

Nathaniel

Try this code:

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   // Work out where we currently are.
   $current_action = 'home';
   if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
      $current_action = 'admin';
   if (in_array($context['current_action'], array('search', 'forum', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'spadmin'])))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
        $current_action = 'search';
    if (isset($_GET['board']) || isset($_GET['topic']))
        $current_action = 'forum';
    if ($context['current_action']=='spadmin')
        $current_action = 'admin';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

   // Are we using right-to-left orientation?
   if ($context['right_to_left'])
   {
      $first = 'last';
      $last = 'first';
   }
   else
   {
      $first = 'first';
      $last = 'last';
   }

   // Show the start of the tab section.
  echo '
        <div id="stylefour">
           <ul>';

          // Show the [home] button.
               echo '<li><a' , $current_action=='home' ? ' class="chosen"' : '' , ' href="', $scripturl, '"><b>' , $txt[103] , '</b></a></li>';

           // Show the [forum] button.
                echo '<li><a' , $current_action=='forum' ? ' class="chosen"' : '' , ' href="', $scripturl, '"?action=forum><b>' , $txt['sp-forum'] , '</b></a></li>';

          // Show the [KickerStore] button.       
               echo '<li><a href="http://astore.amazon.com/kicsblo-20 "><span>KickerStore</span></a></li>';

          // Show the [help] button.
                              echo '<li><a' , $current_action=='help' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=help"><b>' , $txt[119] , '</b></a></li>';

         // How about the [search] button?
               if ($context['allow_search'])
                  echo '<li><a' , $current_action=='search' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=search"><b>Search</b></a></li>';

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

       // Is the user allowed to administrate at all? ([admin])
               if ($context['allow_admin'])
                  echo '<li><a' , $current_action=='admin' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=admin"><b>' , $txt[2] , '</b></a></li>';
       // Edit Profile... [profile]
               if ($context['allow_edit_profile'])
                  echo '<li><a' , $current_action=='profile' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=profile"><b>' , $txt[79] , '</b></a></li>';

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

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

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

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

   // Otherwise, they might want to [logout]...
      if ($context['user']['is_logged'])
      echo '<li><a ' , $current_action=='logout' ? ' class="chosen"' : '' , 'href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><b>' , $txt[108] , '</b></a></li>';
   echo '
      </ul>
       </div>';
}
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

ccbtimewiz

Also, reference this document as it provides a lot of insight of how to modify the template_menu() function.

How do you add custom tabs to the Core (default) theme menu?

And also:

// Show the [KickerStore] button.       
               echo '<li><a href="http://astore.amazon.com/kicsblo-20 "><span>KickerStore</span></a></li>';


Should be

// Show the [KickerStore] button.       
               echo '<li><a href="http://astore.amazon.com/kicsblo-20">KickerStore</a></li>';


<span> tags are not permitted in reference tag in (x)HTML standards.

Advertisement: