SimplePortal

Customization => Themes and Graphics => Custom Theme Tutorials => Topic started by: gamerxgirl on January 26, 2009, 06:28:50 PM

Title: Passion by Crip (Outdated)
Post by: gamerxgirl on January 26, 2009, 06:28:50 PM
This tutorial is for the Passion (http://custom.simplemachines.org/themes/index.php?lemma=439) theme by Crip (http://custom.simplemachines.org/themes/index.php?action=profile;u=28329).


Adding Custom Tabs
Open index.template.php located in your Themes/passion folder (if you already installed theme on your forum).

Find:
Code: [Select]
   if ($context['current_action'] == 'search2')
      $current_action = 'search';

After on the next line add:
Code: [Select]
   if ($context['current_action'] == 'LINKNAME')
      $current_action = 'LINKNAME';

Replace LINK NAME with the name of your link.

Then Find:
Code: [Select]
echo '<ul id="menubox">
<li><a' , $current_action=='home' ? ' class="chosen"' : '' , ' href="', $scripturl, '">' , $txt[103] , '</a></li>';

After it add:
Code: [Select]
  echo '<li><a' , $current_action=='LINK ACTION' ? ' class="current"' : '' , ' href="', $scripturl, '?action=forum"><span>' , 'LINK NAME' , '</span></a></li>';
Replace LINK NAME with the name of your link and LINK ACTION with the name of your action, for example 'forum'.

External URL
Or if you're going to be using a non-smf/external url you would use the following:
Code: [Select]
  echo '<li><a href="URL"><span>URL NAME</span></a></li>'; 
Replace URL with the url you'd like to link to, and URL NAME to what you'd like to name your url.

Tab Link in a New Window
If you'd like the link to open in a new window you would add:
Code: [Select]
target="new"or
Code: [Select]
target="_blank"
like so:
Code: [Select]
  echo '<li><a href="URL" target="new"><span>URL NAME</span></a></li>'; 


Title: Re: [Custom Theme Tutorial] Passion by Crip
Post by: [SiNaN] on February 03, 2009, 10:52:28 AM
Thanks gamerxgirl! Maybe you can make it SimplePortal specific, to make it more easier.
Title: Re: [Custom Theme Tutorial] Passion by Crip
Post by: Nathaniel on February 04, 2009, 12:55:22 AM
Thanks for making this tutorial gamerxgirl. :)

Below are some more specific instructions for this theme, if anyone needs more specific instructions.


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

Replace with
Code: [Select]
if(!empty($context['portalactive']))
   echo '<li><a' , $current_action=='forum' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=forum">' , $txt['sp-forum'] , '</a></li>';
  echo '<li><a' , $current_action=='help' ? ' class="chosen"' : '' , ' href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';

Search for
Code: [Select]
$current_action = 'search';
Replace with
Code: [Select]
$current_action = 'search';
   if ((isset($_GET['board']) || isset($_GET['topic']) || in_array($context['current_action'], array('unread', 'unreadreplies'))) && !empty($context['portalactive']))
      $current_action = 'forum';
   if ($context['current_action']=='spadmin')
      $current_action = 'admin';

Search for
Code: [Select]
, 'login', 'help', 'pm'
Replace with
Code: [Select]
, 'login', 'help', 'pm', 'forum', 'spadmin'

Moved to the 'Custom Theme Tutorials' board.
SimplePortal 2.3.8 © 2008-2024, SimplePortal