SimplePortal

Customization => Themes and Graphics => Topic started by: ChubZz on February 14, 2011, 09:41:26 PM

Title: Adding FORUMS Button to navigation Bar
Post by: ChubZz on February 14, 2011, 09:41:26 PM
Hello Simpleportal comunity

I recently set up a site with MSF and Simpleportal and simple portal looked really cool,i installed my theme "Zone 99" From Deziner studio but noticed there was no FORUM button in the Navigation bar

Probibly a simple fix but i looked through the Admin section so many times.

I dont know how to attach the index.template so ill upload it to media fire

Website:
ta1pgaming.com (http://ta1pgaming.com)

Thank yous all!

Title: Re: Adding FORUMS Button to navigation Bar
Post by: AngelinaBelle on February 15, 2011, 08:12:16 AM
Hi ChubZz,
 
There is no administrative option for adding the forum button.
This is something that usually gets taken care of at install time.
 
I'm guessing that this is a custom theme, not the one in /Themes/default
At install time, there is actually an option to add the forum button to every theme the installer can figure out.
 
But if you did not select that option, you can do it yourself right now.
Please follow, step by step, the tuturial at: http://simpleportal.net/index.php?topic=148.0 (http://simpleportal.net/index.php?topic=148.0)
 
It will tell you exactly how to add the forum button and how to add code to set the current action to forum.
Title: Re: Adding FORUMS Button to navigation Bar
Post by: ChubZz on February 15, 2011, 10:14:56 AM
Hey

Thanks for the reply but i have tried this but coldnt figure out where to put

if (empty($context['disable_sp']) && in_array($modSettings['sp_portal_mode'], array(1, 3)))

Any idea?

Thanks
Title: Re: Adding FORUMS Button to navigation Bar
Post by: AngelinaBelle on February 15, 2011, 10:55:28 AM
First, make a new 'forum' button. Then, put that "before your new 'forum' button".
 
This means your new forum button, which started as an extra copy of your help button, will look like (with that special "only do this if simpleportal is turned on" line of code:
 
Code: [Select]
   // Show the [forum] button.
   if (empty($context['disable_sp']) && in_array($modSettings['sp_portal_mode'], array(1, 3)))
      echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'forum' ? 'active_back' : 'back' , '">
               <a href="', $scripturl . ($modSettings['sp_portal_mode'] == 1 ? '?action=forum' : ''), '">', empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'], '</a>
            </td>' , $current_action=='forum' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

 
Title: Re: Adding FORUMS Button to navigation Bar
Post by: ChubZz on February 15, 2011, 11:22:57 AM
Hey thanks for the help but i just cant seam to do it lkol, i attaced the index.template.php to my 1st post, maby you could take a look and see where it needs to go?

Thanks alot i really appreciate it  :nervous-happy:
Title: Re: Adding FORUMS Button to navigation Bar
Post by: AngelinaBelle on February 16, 2011, 12:37:09 PM
I think you can handle this. You are smart.
 
Your theme is a LITTLE different than the example -- it uses <li> instead of <td>. But still.
 
First, you can find function template_menu()
Then, you can go down and find the help button.  Use your editor's "find" feature to find that
Code: [Select]
   echo '<li><a' , $current_action=='help' ? ' class="active"' : '' , ' href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';

After that, it is pretty easy to take a second copy of it:
Code: [Select]
   echo '<li><a' , $current_action=='help' ? ' class="active"' : '' , ' href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';

   echo '<li><a' , $current_action=='help' ? ' class="active"' : '' , ' href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';

And start working on turning the first 'help' into your forum button, just like the tutorial says:
Code: [Select]
   if (empty($context['disable_sp']) && in_array($modSettings['sp_portal_mode'], array(1, 3)))
       echo '<li><a' , $current_action=='forum' ? ' class="active"' : '' , ' href="', $scripturl . ($modSettings['sp_portal_mode'] == 1 ? '?action=forum' : ''), '">', empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'], '</a></li>';

   echo '<li><a' , $current_action=='help' ? ' class="active"' : '' , ' href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';
Title: Re: Adding FORUMS Button to navigation Bar
Post by: ChubZz on February 16, 2011, 04:50:23 PM
Thanks got it working!  :nervous-happy:

Cheers  :applause:
Title: Re: Adding FORUMS Button to navigation Bar
Post by: ccbtimewiz on February 16, 2011, 04:56:18 PM
I was about to suggest using the new hooks system until I realized you're on 1.1.12. :P
Title: Re: Adding FORUMS Button to navigation Bar
Post by: AngelinaBelle on February 16, 2011, 06:23:42 PM
We are so not going there, Chris!
SimplePortal 2.3.8 © 2008-2024, SimplePortal