Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: JayBachatero on December 31, 2005, 04:21:57 PM

Title: [1.1] How to add tabs to Core (NDT)?
Post by: JayBachatero on December 31, 2005, 04:21:57 PM
For a more up to date version of this please see the doc site (http://docs.simplemachines.org/index.php?topic=564.msg927#msg927)
SMF 2.0? See here (http://www.simplemachines.org/community/index.php?topic=261880.0) instead

The way you add links to the menu has changed in the new default theme.  You will need to make several other steps in order to make the tabs work like they should.  Here are the steps required to add a menu item.  For this tutorial we are going to be adding a chat link.

1. In index.template.php
There are two ways to do this.  This first method is the recomemded one.

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


Code (Add After) Select
if ($context['current_action'] == 'chat')
$current_action = 'chat';


Second Method
Code (Find) Select
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))

As you can see it has a list of the actions in the menu.  What we are going to do is add , 'chat' after 'pm'.  Each action in the array is separated by a comma and enclosed in single quotes (').  It should look like this.

if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'chat')))


The next step is adding the link itself.  This is an example of the home menu.

2. In the same file

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




This is how it should look with the made changes.


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



If you want to be neat about it and add support for other languages add this string to /Themes/default/languages/index.english.php and to any other language file that you want to add it to.  ie. /Themes/default/languages/index.{language}.php and change Chat to the translated string.
$txt['chat'] = 'Chat';


EDIT
I cleaned this tutorial up a bit.

If you find it a bit confusing please let me know so that I can recide it :)

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: J. Williams on December 31, 2005, 07:13:17 PM
Best sticky this as its very important
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on December 31, 2005, 07:15:20 PM
Meh too many stickies in this board.  Let it float around.  People will find it and it's not that difficult to add them ;)

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: J. Williams on December 31, 2005, 08:03:51 PM
Theres only 4
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on December 31, 2005, 08:07:36 PM
Yea they were just moved :)  Also this topic was added to http://www.simplemachines.org/community/index.php?topic=11481.msg100701#msg100701.

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: J. Williams on December 31, 2005, 08:19:00 PM
Ok
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on December 31, 2005, 08:27:39 PM
If it becomes an issue it will be put as a sticky for a week or two :)

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: Simplemachines Cowboy on December 31, 2005, 10:53:54 PM
Mine is close:
// Show the [chat] button.
if ($context['user']['is_logged'])
echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=chat">' , $txt[100] , '</a>
</td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


You'll notice I made a new $txt[100] that says 'Chat' & put it in index.english

Cowboy
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on December 31, 2005, 10:55:23 PM
Yeah it's better to add it to the language files than hardcoding the text to the link :)  make sure that $txt[100] is not used some where else.

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: Simplemachines Cowboy on December 31, 2005, 11:11:14 PM
Since I'm currently on a test board I didn't scan EVERYWHERE for another $txt[100] but it seems to work.

A little OT but I plan to do a tutorial showing how to add everything to integrate Flashchat into RC 2. It's time to update the old one.
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on December 31, 2005, 11:33:32 PM
For things like this I would suggest that you use custom strings like $txt['chat_1'] and so on.  To prevent errors and so on.

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: russ skinner on January 01, 2006, 06:14:58 PM
I would like to add a gallery button to link to a coppermine gallery (to open in a seperate window) and have the button only visible once the user has logged on to the forum. In index.template.php I've modified the list of actions as follows:

Quoteif (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'gallery')))

but I am unsure how to code the link.

My forum is at http://www.srcmc.co.uk/forum/index.php and my gallery at http://www.srcmc.co.uk/gallery/index.php

Can anybody please help.

Many thanks
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 01, 2006, 06:21:16 PM
Add if ($context['user']['is_logged']) Before the button like this.


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

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: russ skinner on January 01, 2006, 06:49:44 PM
Many thanks.

It works perfectly.

Russell
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 01, 2006, 06:50:34 PM
You're welcome.

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: TarantinoArchives on January 05, 2006, 06:41:58 PM
nice tutorial. greetings.
Title: Re: How to add tabs to Core (NDT).
Post by: Gargoyle on January 08, 2006, 01:40:32 PM
How do I make it link to an offsite URL... Like a Gallery or another website all together ?
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 08, 2006, 02:30:26 PM
Just edit the href tag. <a href="', $scripturl, '?action=chat">Chat</a>.  If you are making it to an outside site you dont have to do the action stuff in if (in_array($context['current_action'], array('search',...

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: Gargoyle on January 08, 2006, 02:59:28 PM
Thanks for the info!!
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 08, 2006, 03:11:11 PM
You're welcome.

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: marinelife on January 08, 2006, 09:26:41 PM
hey I am trying to link to a outside website
I edited the text to this
   // Show the [aggreement] button...
      echo ($current_action == 'agreement' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'agreement' ? 'active_back' : 'back' , '">
               <a href='http://www.westernohioreef.com/other/agreement.htm'</a>
            </td>' , $current_action == 'agreement' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

I get this error
parse error, unexpected T_STRING, expecting ',' or ';'

What do I need to remove to make it work
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 08, 2006, 09:31:24 PM
You need to use " not '

   // Show the [aggreement] button...
      echo ($current_action == 'agreement' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'agreement' ? 'active_back' : 'back' , '">
               <a href="http://www.westernohioreef.com/other/agreement.htm">Agreement</a>
            </td>' , $current_action == 'agreement' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: marinelife on January 08, 2006, 10:10:37 PM
thanks that worked, but any way to split them to a second line
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 09, 2006, 09:01:28 AM
You want to add a second line of tabs?

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: marinelife on January 09, 2006, 09:06:36 AM
Yeah I have a good amount and tabs I need
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 09, 2006, 09:21:50 AM
That I don't know how to do.  Sorry.

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: marinelife on January 09, 2006, 09:47:50 AM
that is ok, I just added a few main ones for now, I will have to play around or maybe someone will know. Thanks for the help you did give!
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 09, 2006, 02:51:10 PM
You're welcome.  There is a topic around here with a version that does sub tabs almost like you want it.  Look around and you will find it. :)

-JayBachatero
Title: Re: How to add tabs to Core (NDT).
Post by: Reason on January 10, 2006, 12:06:28 PM
Is this procedure different when I want to place a tab before the Home tab? I can place them just fine after Home but the one I'd like before Home doesn't show up.

If it would be the same thing I probably just screwed up somewhere and I need to review my code, but looking at:
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
I get the feeling that I'd need to do something different when I want to place a tab before Home. would you happen to know what I need to do for that?
Title: Re: How to add tabs to Core (NDT).
Post by: JayBachatero on January 10, 2006, 02:49:24 PM
Well the in the line you provided you can put the action anywhere always in this format though 'home', To place the link before home just place it above this line // Show the [home] button.

-JayBachatero
Title: Re: How to add tabs to Core (NDT)?
Post by: haktanir2 on January 25, 2006, 04:05:04 PM
Sorry, how do you put something in the menu which is formed of two words?

for example I wanted to write MY HOMEPAGE, but got an error because of the space between the two words.
Title: Re: How to add tabs to Core (NDT)?
Post by: haktanir2 on January 25, 2006, 04:12:06 PM
And where can you define where the $txt[103]  (or whatever number) should be?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on January 25, 2006, 04:15:36 PM
Try this


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

in Modifications.english.php  you pick what you want to add if its text it MUST be in ' '
Title: Re: How to add tabs to Core (NDT)?
Post by: haktanir2 on January 25, 2006, 04:19:02 PM
Thanks I'll try that.
Title: Re: How to add tabs to Core (NDT)?
Post by: haktanir2 on January 26, 2006, 03:53:20 AM
Thank you very much, it worked. :)
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on January 26, 2006, 12:56:04 PM
You're welcome.  Glad to hear it worked for you.

-JayBachatero
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on January 30, 2006, 06:14:47 PM

**removed**


Any way to make the tab active?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on January 30, 2006, 09:26:32 PM
I believe it can be done.  I'll hit you up tom from school when  I get a chance :)
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on January 31, 2006, 05:09:15 AM
Quote from: JayBachatero on January 30, 2006, 09:26:32 PM
I believe it can be done.  I'll hit you up tom from school when  I get a chance :)

ahh ok thanks :D whats up tom :/ ???

edit:
Nico ... ... Welcome to Paradise ... zegt:
who is tom?
JayBachatero - KevMundial.com zegt:
Tom = tomorrow

thanks ;)
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on January 31, 2006, 05:43:43 PM
External Page activation:
the difficult way to do it in ssi:

the ssi most be called at the top
<?php require_once('SSI.php'); ?>

end the css is need for the tabs

<? echo '
   <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />'; ?>

Now the tabs (edit: out of the index.template.php):

copy from line 470 $current_action = 'home';

until
line 588 </table>';

past it in the destination file. dont forget to put the <?php at the begining and the ?> at the end of the code. (Note this code is a replacement for <? ssi_menubar(); ?>)

To make a tab active change this code at the top:
$current_action = 'home';

Change home to the tab you wand.



I hope there is simpler way of doing this :D
To bad this doesnt work :(
<?php $current_action 'home'?>
<?php require_once('SSI.php'); ?>
<?php echo '<link rel="stylesheet" type="text/css" href="'$settings['theme_url'], '/style.css?rc2" />'?>
<?php ssi_menubar(); ?>
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on January 31, 2006, 08:19:34 PM
acf I will take a look at the files you sent me later on today :).
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on February 01, 2006, 05:21:23 AM
Quote from: JayBachatero on January 31, 2006, 08:19:34 PM
acf I will take a look at the files you sent me later on today :).

okay thanks :)
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 01, 2006, 10:28:47 PM
I'm trying to do this as well... Let meknow what you find... I have a home page that is outside the main SMF directory and I'd like the tab for the homepage to be active when on the homepage.

Thanks!!
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 01, 2006, 11:27:44 PM
How are you calling the tabs?  Are you using the ssi call or copied from default?

I can take a look into this more in depth next week.  I'm real busy this week.  Sorry. :(
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on February 02, 2006, 06:15:55 AM
Quote from: JayBachatero on February 01, 2006, 11:27:44 PM
How are you calling the tabs?  Are you using the ssi call or copied from default?

I can take a look into this more in depth next week.  I'm real busy this week.  Sorry. :(

the example shows that i copied it from the default template (added the text to say so :P)

ive added the difrent header of the gallary for you :) So the one without the <?php ssi_menubar(); ?> but with the stuff kopied directly from the template (cant fail :P). You have the file including <?php ssi_menubar(); ?>.
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 02, 2006, 08:54:18 PM
I am using the ssi call.. :D
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 02, 2006, 10:14:26 PM
Remind me again next week so that I can give it a shot.
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on February 03, 2006, 07:18:41 AM
Quote from: Gargoyle on February 02, 2006, 08:54:18 PM
I am using the ssi call.. :D

ssi call.. how do you mean?
just calling <? ssi_menubar(); ?> wil not get you a ative tab...
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on February 03, 2006, 08:05:08 AM
Index.template.php
find:
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.
$current_action = 'home';


replace:
function template_menu($current_action = 'home')
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.



and the ssi:
<?
template_menu($current_action = 'gallery');
?>


hmm much  beter :D
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 03, 2006, 06:28:26 PM
I think I am missing something.... I have active tabs everywhere the menu is displayed except for the home page. The home page is outside of the forum folder and I use ssi to call the menu. Could you explain a little more please ??
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 03, 2006, 06:31:58 PM
Can you please provide a link to take a look at?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 03, 2006, 11:25:08 PM
Quote from: JayBachatero on February 03, 2006, 06:31:58 PM
Can you please provide a link to take a look at?

It's in my signature... Would you like the actual page code ?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 03, 2006, 11:38:48 PM
You can give me the page code or just give me temp admn access to edit the theme template.
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 04, 2006, 08:46:12 PM
O'kay now I am really confused.... I understand how the page code would help but I have no clue how you would be able to edit which tab is active by editing the themes template since the page in question is not even SMF code or in the SMF directory... It does use ssi but that is about the extent of it...

I am really confused now... Is there an e-mail that I could send the page to ? I can send the theme template page as well if you would like that also.. I think that would be index_template.php correct ?

Thanks for the help thus far. ;D
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 05, 2006, 05:41:44 PM
WOW for a min there I though that was an addition of the forum silly me :P  Send me the indextesting.php file and the index.template.php
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 05, 2006, 05:50:41 PM
Files have been sent to your e-mail acount..

Thanks!!
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 05, 2006, 06:12:44 PM
Change
if (in_array($context['current_action'], array('forum', 'search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'unread', 'who', 'gallery', 'store', 'arcade')))

to
if (in_array($context['current_action'], array('forum', 'search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'unread', 'who', 'gallery', 'store', 'arcade','indextesting')))

and
<?php
$ssi_ban 
true;
$ssi_theme '10';
$ssi_layers = array('main');
?>


to
<?php
$ssi_ban 
true;
$ssi_theme '10';
$ssi_layers = array('main');
$current_action 'indextesting';
?>


Not sure if it will work though.  I didn't see the call for the menu with SSI.
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 05, 2006, 06:49:30 PM
Nope it didn't do it....

The menu is called along with the header parts with $ssi_layers = array('main');

I also tried adding the current action code above that but that didn't work either... Seem to be on the right track though.. Or at least it makes sense to me. ;D
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 05, 2006, 07:27:55 PM
Well I added it to the array in index.php and that had mixed results...

While the tab worked because I could call the page using the same lingo as the other defind links in index_template.php the file could not load the main_template which caused the page to display incorrectly.

So even though I could specify the page in the index.php file I could not get it to load right.... But the tab worked as it should...  ::)
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 05, 2006, 07:42:24 PM
I'll take a closer look into this when I get a chance.
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 05, 2006, 10:46:25 PM
I think I figured it out... The URL needs to have an action attached to it in order for the menu to pick up on which tab to highlight. So I manually added the action to the URL and that has seemed to do the trick.

Thanks for your help and if you come up with a better way to do this please let me know as I would be interested in making this a bit better. ;D
Title: Re: How to add tabs to Core (NDT)?
Post by: aussieholden on February 06, 2006, 04:26:24 AM
I can't find this file "index.template.php" were is it located. ?
Title: Re: How to add tabs to Core (NDT)?
Post by: aussieholden on February 06, 2006, 05:45:24 AM
No Worries Found It  ;D
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on February 06, 2006, 08:15:08 AM
Quote from: JayBachatero on February 05, 2006, 07:42:24 PM
I'll take a closer look into this when I get a chance.

I geuss its shooting the variable in the header and change the header like if it where the ssi file and changing the tabs area will doo it. :P
still have to find out if it works :D
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on February 06, 2006, 09:36:07 AM
the ssi file with header with active tabs:
<?php
require_once('SSI.php');
template_main_above($current_action 'gallery')
?>


index.template.php

find:
function template_main_above()

replace:
function template_main_above($current_action = 'home')

find:
global $context, $settings, $options, $scripturl, $txt, $modSettings;

replace:
global $context, $settings, $options, $scripturl, $txt, $modSettings;

$current_action = $current_action;


find:
// Show the menu here, according to the menu sub template.
template_menu();


replace:
// Show the menu here, according to the menu sub template.
template_menu($current_action = $current_action);


find:
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.
$current_action = 'home';


replace:
function template_menu($current_action = 'home')
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.



this should do it ;)
Title: Re: How to add tabs to Core (NDT)?
Post by: IceBear on February 07, 2006, 05:12:59 PM
I managed to add a new button at www.nim.se/smf
But the button does not have the blue background ??
What did I do wrong ?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 07, 2006, 06:03:25 PM
Can you please post the block of code in the template_menu funtion?
Title: Re: How to add tabs to Core (NDT)?
Post by: IceBear on February 07, 2006, 06:11:56 PM
Is it this you mean ?

// Show the [main] button.
   echo ($current_action=='main' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'main' ? 'active_back' : 'main' , '">
               <a href="http://www.nim.se">Hem</a>
            </td>' , $current_action == 'main' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 07, 2006, 06:13:03 PM
Yea the whole section of code.
Title: Re: How to add tabs to Core (NDT)?
Post by: IceBear on February 07, 2006, 06:46:59 PM
Might be better if I email you the file :)


// 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', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'main')))
$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 '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

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

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

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

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
</td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>
</tr>
</table>';

}


EDIT: Used the code tag
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 07, 2006, 09:58:48 PM
You have
<td valign="top" class="maintab_' , $current_action == 'main' ? 'active_back' : 'main' , '">
supposed to be
<td valign="top" class="maintab_' , $current_action == 'main' ? 'active_back' : 'back' , '">


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



   // Show the [main] button.
   echo ($current_action=='main' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'main' ? 'active_back' : 'back' , '">
               <a href="http://www.nim.se">Hem</a>
            </td>' , $current_action == 'main' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: IceBear on February 08, 2006, 02:29:47 AM
Ahh, I missed that, may eyes must have been sour...

Thank you :)
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 08, 2006, 02:21:46 PM
Yea it happens.  The first time I saw it iI couldn't spot the difference then I found it :)

-JayBachatero
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 08, 2006, 11:01:31 PM
ACF ....

Was your post directed at me ?
Title: Re: How to add tabs to Core (NDT)?
Post by: Acf on February 09, 2006, 02:45:41 PM
Quote from: Gargoyle on February 08, 2006, 11:01:31 PM
ACF ....

Was your post directed at me ?

jup it was but i know what you meant.

You post inspired me to look for better solution... and i did find it :)
Title: Re: How to add tabs to Core (NDT)?
Post by: ladyshanae on February 09, 2006, 04:39:15 PM
Is there a way to make the tabs stretch with longer names instead of drop down to a second line and have the tabs looking short and fat versus long and skinny?

Does that make sense? lol
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 09, 2006, 05:52:49 PM
It shouldn't go to a second line.  How long is the text?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gargoyle on February 09, 2006, 06:03:47 PM
Quote from: ÂŞcF on February 09, 2006, 02:45:41 PM
Quote from: Gargoyle on February 08, 2006, 11:01:31 PM
ACF ....

Was your post directed at me ?

jup it was but i know what you meant.

You post inspired me to look for better solution... and i did find it :)


Well thank you... ;D
Title: Re: How to add tabs to Core (NDT)?
Post by: ladyshanae on February 10, 2006, 04:40:37 PM
The longest text I had said:

HPRPG Official Store

I finally shortened it to store until I can work out how to keep it from dropping down.
Title: Re: How to add tabs to Core (NDT)?
Post by: Redeye on February 11, 2006, 06:25:12 AM
I've made all the changes to index.template.php and index.english.php and it worked OK.
I now have the menu item showing correctly.
The menu item I have created is for a gallery and it is using the action=gallery in the code.
How to I create this gallery "action" so that it will go to my Coppermine album?
TIA
Title: Re: How to add tabs to Core (NDT)?
Post by: ladyshanae on February 11, 2006, 08:35:10 AM
Redeye -

I'm going to guess your code looks something like this:

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

You want to replace this:

<a href="', $scripturl, '?action=gallery">Chat</a>

With this:

<a href="insert_gallery_url_here">Gallery</a>

Obviously where 'insert_gallery_url_here' is the link to your gallery.

Hope that helps!
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 11, 2006, 11:47:16 AM
Actually take a look at Photo Gallery.... (http://www.simplemachines.org/community/index.php?topic=19518.0)  It shows you how to do it so that it will work with the action=gallery.  Take a look at my website.  I have it like that too.  http://www.kevmundial.com/board/index.php?action=gallery
Title: Re: How to add tabs to Core (NDT)?
Post by: Dazzler on February 12, 2006, 02:06:46 PM
Just a quick and really simple one guys...

I am running the default theme in RC2, i have my button for my gallery working fine, but i have lost the "light blue" colour when pressed--- i am very new to this i am sure this is a two second fix.

Link to site www.minidirectory.co.uk/forum.

Thanks for the great support so far guys.
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 12, 2006, 11:04:52 PM
Use this.

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

if ($context['current_action'] == 'coppermine')
$current_action = 'search';
Title: Re: How to add tabs to Core (NDT)?
Post by: Dazzler on February 14, 2006, 03:18:47 PM
Hi there... i tried above (if that was for me) and it didnt work..

this is my code.... in index.template

Quote// Show the [gallery] button.

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


my site is www.minidirectory.co.uk/forum
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 14, 2006, 04:13:12 PM
Small mistake.
Code (find) Select

if ($context['current_action'] == 'coppermine')
$current_action = 'search';

Code (replace) Select

if ($context['current_action'] == 'coppermine')
$current_action = 'coppermine';


Also paste that Above where the other statments for current action are.
Title: Re: How to add tabs to Core (NDT)?
Post by: Dazzler on February 14, 2006, 05:23:37 PM
Hi jay again.... if i use your posted code even with the amendments i loose the button of my nav bar... with the code i posted above the button shows and works fine, it just doesnt change to "light blue" when pressed.

Any ideas? am i editing the right file index.template?

Title: Adding Arcade/Shop buttons again
Post by: Veej on February 21, 2006, 04:38:27 PM
After installing TP and using their given index.template.php file I hve lost the arcade and shop buttons.

Will this method make it so that they are highlighted when the user is in the shop like the admin button bg sort of enlarges like a tab when you are in the ACP?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 21, 2006, 07:02:58 PM
Doggy sorry for the late response must have missed this one by mistake.  Did you add the code I gave you BEFORE the button?  Under the search one?

Veej yes this method will make the tabs active.  Just follow the steps and you will be fine :)
Title: Re: How to add tabs to Core (NDT)?
Post by: Dazzler on February 21, 2006, 08:54:39 PM
jay.. would you mind if i sent you my "Index.template" for 2 mins of your attention..

Daz
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 21, 2006, 09:11:42 PM
Sure why not.  My email is [email protected].
Title: Re: How to add tabs to Core (NDT)?
Post by: Dazzler on February 21, 2006, 09:16:24 PM
email sent.. you might want to delete you mail before you get hundreds of requests... thanks for your time... Daz
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 21, 2006, 09:40:07 PM
Ok here you go.  You where mis this

        if ($context['current_action'] == 'coppermine')
$current_action = 'coppermine';


Also I don't really care if people email me stuff as long as I ask for it and they are polite about it ;)
Title: Re: How to add tabs to Core (NDT)?
Post by: thetzfreak on February 26, 2006, 01:16:38 PM
For some reason my template.index.php doesn't have this line =\

if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
Maybe it's in another file? My template is SMFone. Thanks for the help in advance.

Thanks.
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on February 26, 2006, 01:35:34 PM
This method is only for Core, Amber and PnPn.  Those themes are using this tab method.
Title: Re: How to add tabs to Core (NDT)?
Post by: tarkhorani on March 04, 2006, 01:17:04 AM
I want to add an menu option named as "Banner Exchange"
I want to show the forum header and footer and it show a page named as banner.htm between header and footer , what can I do?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 04, 2006, 01:30:40 AM
To add a menu item take a look at first post.  To add something to header and footer add include('banner.htm');  Add it to the template_main_above and teplate_main_bellow functions in index.template.php
Title: Re: How to add tabs to Core (NDT)?
Post by: tarkhorani on March 04, 2006, 01:39:36 AM
thanks, I understand how to add option, but I want when click on it show this:

page = {
Header of forum
banner.htm
footer of forum
}
Title: Re: How to add tabs to Core (NDT)?
Post by: bloc on March 04, 2006, 03:49:58 AM
You physically get that displayed you mean?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 04, 2006, 02:46:55 PM
You can use this

if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'blah')
{
   include('blah.txt');
}
Title: Re: How to add tabs to Core (NDT)?
Post by: tarkhorani on March 04, 2006, 05:07:59 PM
Thank You!
another , if the blah.txt be blah.php, will it parse the php file or do with it like a txt file?
Title: Re: How to add tabs to Core (NDT)?
Post by: tarkhorani on March 04, 2006, 05:58:24 PM
Quote from: JayBachatero on March 04, 2006, 02:46:55 PM
You can use this

if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'blah')
{
   include('blah.txt');
}


also I added this to site but where I must add above?

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

Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 04, 2006, 06:13:31 PM
Yea it should parse the PHP file.
This is how it should look
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'banner')
{
   include('blah.php');
}
Title: Re: How to add tabs to Core (NDT)?
Post by: tarkhorani on March 05, 2006, 02:06:11 AM
Quote from: JayBachatero on March 04, 2006, 06:13:31 PM
Yea it should parse the PHP file.
This is how it should look
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'banner')
{
   include('blah.php');
}

where I must add above?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 05, 2006, 02:46:08 AM
You add that in the template_main_above area or where ever you want it to appear.
Title: Re: How to add tabs to Core (NDT)?
Post by: tarkhorani on March 05, 2006, 08:49:10 AM
Quote from: JayBachatero on March 05, 2006, 02:46:08 AM
You add that in the template_main_above area or where ever you want it to appear.

This is template_main_above fuction where I add it ; sorry ; :'(


// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
<meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
<meta name="description" content="', $context['page_title'], '" />
<meta name="keywords" content="e-Gold, PayPal, 2Checkout, 2CO, HYIP, autosurf, EMO, Moneybookers, stormpay, epay, epayment, forum" />
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?rc2p"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "', $settings['theme_url'], '";
var smf_images_url = "', $settings['images_url'], '";
var smf_scripturl = "', $scripturl, '";
// ]]></script>
<title>', $context['page_title'], '</title>';

// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?rc2" />
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?rc2" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="', $scripturl, '?action=help" target="_blank" />
<link rel="search" href="' . $scripturl . '?action=search" />
<link rel="contents" href="', $scripturl, '" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

function shrinkHeader(mode)
{';

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>';

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';

function shrinkHeaderIC(mode)
{';

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>';

echo '
<div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">';

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">', $context['forum_name'], '</span>';
else
echo '
<img src="', $settings['header_logo_url'], '" style="margin: 4px;" alt="', $context['forum_name'], '" />';

echo '
</td>
<td align="right" class="catbg">
<A HREF="http://www.mypagerank.net/" target="_blank">
<IMG SRC="http://www.mypagerank.net/srank.php?site=epaytalk.com" BORDER="0" ALT="This is my Google PageRank™ - SmE Rank free service Powered by Scriptme"></A>
<script type="text/javascript"><!--
google_ad_client = "pub-8487819260492031";
google_ad_width = 110;
google_ad_height = 32;
google_ad_format = "110x32_as_rimg";
google_cpa_choice = "CAAQ2ZCazgEaCCvPXrFfpg_0KPmNxXQ";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


</td>
</tr>
</table>';


// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>';

if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>
</td>';

// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' , $context['current_time'], '</span>';

// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>';

if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>', $txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
', $txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

<form action="', $scripturl, '?action=login2" method="post" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">', $txt['smf53'], '</option>
<option value="1440">', $txt['smf47'], '</option>
<option value="10080">', $txt['smf48'], '</option>
<option value="302400">', $txt['smf49'], '</option>
<option value="-1" selected="selected">', $txt['smf50'], '</option>
</select>
<input type="submit" value="', $txt[34], '" /><br />
<span class="middletext">', $txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}

echo '
</td>
</tr>
</table>
</td>
</tr>
</table>';

echo '
<table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>';

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
</td>';
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="', $scripturl, '?action=search2" method="post" style="margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
</div>';


// Show the menu here, according to the menu sub template.
template_menu();



if ($modSettings['ad_management_index'] && allowedTo('ad_manageperm'))
echo '<br /><div align="center">',$modSettings['ad_management_content'],'</div>';
// The main content should go here.


echo '
<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">';
}


EDIT: Changed PHP tag to Code
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 05, 2006, 01:01:55 PM
Add it after

// Show the menu here, according to the menu sub template.
template_menu();

That way it shows under the menu.
Title: Re: How to add tabs to Core (NDT)?
Post by: tarkhorani on March 06, 2006, 03:11:05 AM
I placed and can see the menu Banner Exchange but after click on it only see forum home page.
please take a look at http://www.ePayTalk.com and you can see the link above the forum.
here is the my index.template.php file:

<?php
// Version: 1.1 RC2; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1 RC2';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />
<meta name="keywords" content="e-Gold, PayPal, 2Checkout, 2CO, HYIP, autosurf, EMO, Moneybookers, stormpay, epay, epayment, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?rc2p"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc2" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?rc2" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>'
;

echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' '''>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">'
;

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">'
$context['forum_name'], '</span>';
else
echo '
<img src="'
$settings['header_logo_url'], '" style="margin: 4px;" alt="'$context['forum_name'], '" />';

echo '
</td>
<td align="right" class="catbg">
<A HREF="http://www.mypagerank.net/" target="_blank">
<IMG SRC="http://www.mypagerank.net/srank.php?site=epaytalk.com" BORDER="0" ALT="This is my Google PageRank™ - SmE Rank free service Powered by Scriptme"></A>
<script type="text/javascript"><!--
google_ad_client = "pub-8487819260492031";
google_ad_width = 110;
google_ad_height = 32;
google_ad_format = "110x32_as_rimg";
google_cpa_choice = "CAAQ2ZCazgEaCCvPXrFfpg_0KPmNxXQ";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


</td>
</tr>
</table>'
;


// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>'
;

if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> '
$txt['hello_member_ndt'], ' <b>'$context['user']['name'] , '</b></span>
</td>'
;

// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' 
$context['current_time'], '</span>';

// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>'
;

if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">'
$context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">'
;

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a> <br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
<span class="middletext">'
$txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}

echo '
</td>
</tr>
</table>
</td>
</tr>
</table>'
;

echo '
<table id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"'' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>'
$txt[102], '</b>: '$context['random_news_line'], '</span>
</td>'
;
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="'
$scripturl'?action=search2" method="post" style="margin: 0;">
<a href="'
$scripturl'?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />'
;

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
</div>'
;


// Show the menu here, according to the menu sub template.
template_menu();

if (isset(
$_REQUEST['action']) && $_REQUEST['action'] == 'banner')
{
   include(
'bannerex.htm');
}


if (
$modSettings['ad_management_index'] && allowedTo('ad_manageperm'))
echo '<br /><div align="center">',$modSettings['ad_management_content'],'</div>';
// The main content should go here.


echo '
<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt$modSettings;

if (
$modSettings['ad_management_bot_index'] && allowedTo('ad_manageperm'))
echo '<br /><div align="center">',$modSettings['ad_management_content'],'</div>';

echo '
</div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'right' 'left''">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), '
</td>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'left' 'right''">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

echo '
</div>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// 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';
  // Affiliate mod changes

if ($_POST["action"] == "affiliateadmin")
$context['current_action'] = $_POST["action"];

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''affiliateadmin')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm''affiliateuser''advertise''banner')))


$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 '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' 
$first '">&nbsp;</td>';

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

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

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'admin' 'active_back' 'back' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</td>' 
$current_action == 'admin' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'profile' 'active_back' 'back' '">
<a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
</td>' 
$current_action == 'profile' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

  // Affiliate mod changes

// Go to affiliate center
//if ($context['user']['is_logged'] )
{
echo ($current_action == 'affiliateuser' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'affiliateuser' 'active_back' 'back' '">
<a href="'
$scripturl'?action=affiliateuser">' 'Affiliate' '</a>
</td>' 
$current_action == 'affiliateuser' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
}
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'pm' 'active_back' 'back' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</td>' 
$current_action == 'pm' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</td>' 
$current_action == 'calendar' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</td>' 
$current_action == 'mlist' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
// Show the [advertise] button.
echo ($current_action=='advertise' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'advertise' 'active_back' 'back' '">
<a href="'
$scripturl'">Advertise in ePayTalk</a>
</td>' 
$current_action == 'advertise' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
// Show the [banner exchange] button.
echo ($current_action=='banner' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'banner' 'active_back' 'back' '">
<a href="'
$scripturl'">Banner Exchange</a>
</td>' 
$current_action == 'banner' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'login' 'active_back' 'back' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</td>' 
$current_action == 'login' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'register' 'active_back' 'back' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</td>' 
$current_action == 'register' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'logout' 'active_back' 'back' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</td>' 
$current_action == 'logout' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The end of tab section.
echo '
<td class="maintab_' 
$last '">&nbsp;</td>
</tr>
</table>'
;

}

// 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']] . '</a>';

$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>';
}

?>

Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 06, 2006, 09:15:23 AM
Use the full path or URL for the file.  It's looking for it on the forum root dir.
Title: Re: How to add tabs to Core (NDT)?
Post by: tarkhorani on March 06, 2006, 04:19:21 PM
Quote from: JayBachatero on March 06, 2006, 09:15:23 AM
Use the full path or URL for the file.  It's looking for it on the forum root dir.

I placed the full path and palced the file on it but not work see: http://www.epaytalk.com/index.php?action=banner

// Show the menu here, according to the menu sub template.
template_menu();
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'banner')
{
   include('/public_html/bannerex.htm');
}


here is the file compeletely after changes:

<?php
// Version: 1.1 RC2; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1 RC2';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />
<meta name="keywords" content="e-Gold, PayPal, 2Checkout, 2CO, HYIP, autosurf, EMO, Moneybookers, stormpay, epay, epayment, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?rc2p"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc2" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?rc2" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>'
;

echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' '''>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">'
;

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">'
$context['forum_name'], '</span>';
else
echo '
<img src="'
$settings['header_logo_url'], '" style="margin: 4px;" alt="'$context['forum_name'], '" />';

echo '
</td>
<td align="right" class="catbg">
<A HREF="http://www.mypagerank.net/" target="_blank">
<IMG SRC="http://www.mypagerank.net/srank.php?site=epaytalk.com" BORDER="0" ALT="This is my Google PageRank™ - SmE Rank free service Powered by Scriptme"></A>
<script type="text/javascript"><!--
google_ad_client = "pub-8487819260492031";
google_ad_width = 110;
google_ad_height = 32;
google_ad_format = "110x32_as_rimg";
google_cpa_choice = "CAAQ2ZCazgEaCCvPXrFfpg_0KPmNxXQ";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


</td>
</tr>
</table>'
;


// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>'
;

if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> '
$txt['hello_member_ndt'], ' <b>'$context['user']['name'] , '</b></span>
</td>'
;

// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' 
$context['current_time'], '</span>';

// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>'
;

if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">'
$context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">'
;

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a> <br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
<span class="middletext">'
$txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}

echo '
</td>
</tr>
</table>
</td>
</tr>
</table>'
;

echo '
<table id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"'' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>'
$txt[102], '</b>: '$context['random_news_line'], '</span>
</td>'
;
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="'
$scripturl'?action=search2" method="post" style="margin: 0;">
<a href="'
$scripturl'?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />'
;

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
</div>'
;


// Show the menu here, according to the menu sub template.
template_menu();
if (isset(
$_REQUEST['action']) && $_REQUEST['action'] == 'banner')
{
   include(
'/public_html/bannerex.htm');
}


if (
$modSettings['ad_management_index'] && allowedTo('ad_manageperm'))
echo '<br /><div align="center">',$modSettings['ad_management_content'],'</div>';
// The main content should go here.


echo '
<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt$modSettings;

if (
$modSettings['ad_management_bot_index'] && allowedTo('ad_manageperm'))
echo '<br /><div align="center">',$modSettings['ad_management_content'],'</div>';

echo '
</div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'right' 'left''">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), '
</td>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'left' 'right''">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

echo '
</div>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// 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';
  // Affiliate mod changes

if ($_POST["action"] == "affiliateadmin")
$context['current_action'] = $_POST["action"];

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''affiliateadmin')))
$current_action 'admin';
if (in_array($context['current_action'], array('search''admin''calendar''profile''mlist''register''login''help''pm''affiliateuser''advertise''banner')))


$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 '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' 
$first '">&nbsp;</td>';

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

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

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'admin' 'active_back' 'back' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</td>' 
$current_action == 'admin' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'profile' 'active_back' 'back' '">
<a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
</td>' 
$current_action == 'profile' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

  // Affiliate mod changes

// Go to affiliate center
//if ($context['user']['is_logged'] )
{
echo ($current_action == 'affiliateuser' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == '
'active_back' 'back' '">
<a href="'
$scripturl'?action=affiliateuser">' 'Affiliate' '</a>
</td>' 
$current_action == 'affiliateuser' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
}
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'pm' 'active_back' 'back' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</td>' 
$current_action == 'pm' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</td>' 
$current_action == 'calendar' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</td>' 
$current_action == 'mlist' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
// Show the [advertise] button.
echo ($current_action=='advertise' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'advertise' 'active_back' 'back' '">
<a href="'
$scripturl'">Advertise in ePayTalk</a>
</td>' 
$current_action == 'advertise' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
// Show the [banner exchange] button.
echo ($current_action=='banner' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'banner' 'active_back' 'back' '">
<a href="'
$scripturl,'?action=banner">Banner Exchange</a>
</td>' 
$current_action == 'banner' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'login' 'active_back' 'back' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</td>' 
$current_action == 'login' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'register' 'active_back' 'back' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</td>' 
$current_action == 'register' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'logout' 'active_back' 'back' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</td>' 
$current_action == 'logout' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The end of tab section.
echo '
<td class="maintab_' 
$last '">&nbsp;</td>
</tr>
</table>'
;

}

// 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']] . '</a>';

$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>';
}

?>


Title: Re: How to add tabs to Core (NDT)?
Post by: Delayed on March 10, 2006, 08:48:04 PM
Would having Tiny Portal installed have any change on how I would add a tab.  I followed the instructions from the first post but they are not showing up.

Thanks
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 10, 2006, 09:20:05 PM
It should be the same way to add tabs in TP.  I use TP and I use this format.
Title: Re: How to add tabs to Core (NDT)?
Post by: Delayed on March 11, 2006, 03:21:30 AM
Okay this is weird.  I had to go to work so I put the original file back on the server.  When I got back home  I re uploaded the edited files that I did before because I know that I did them the exact same way as the instructions and it irritated me.

Earlier it didn't work and I swear I cleaned my cache and cookies etc.  I came home got my computer uploaded the edited file and tried it and it worked.  So I am not sure what happened but I know I uploaded the files and I wasn't drinking then, like I am now.  The button I wanted is there.   

The only thing that I did different from earlier (I know you are going to say I must not have uploaded the right file, but I know I did) is try it on a different browser (IE) and then went to my Mozilla Browser.  I did this becasue my IE had not been used on this page so maybe Mozilla wasn't clearing out my cache like it was supposed to.

Anyway Thanks
Title: Re: How to add tabs to Core (NDT)?
Post by: perplexed on March 11, 2006, 01:57:13 PM
Quote from: JayBachatero on December 31, 2005, 04:21:57 PM
The way you add links to the menu has changed in the new default theme.  You will need to make several other steps in order to make the tabs work like they should.  Here are the steps required to add a menu item.  For this tutorial we are going to be adding a chat link.

1. In index.template.php

Find
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))


As you can see it has a list of the actions in the menu.  What we are going to do is add , 'chat' after 'pm'.  Each action in the array is separated by a comma and enclosed in single quotes (').  It should look like this.

if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'chat')))


The next step is adding the link itself.  This is an example of the home menu.

2. In the same file

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



  • $current_action=='home' - is what sets the tab for the current actions.  As you can see it is defined in 3 instances.  You will need to change it for all three of them.
  • ' , $txt[103] , ' - is the text string that 'Home'.  As you see the variable is insde ' , , '.  The reason for this is because it's inside an echo.  If you are going to hard code the name in the menu you do not need to put ' , , ' around it.

This is how it should look with the made changes.


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


If you want to be neat about it and add support for other languages add this string to /Themes/default/languages/index.english.php and to any other language file that you want to add it to.  ie. /Themes/default/languages/index.{language}.php and change Chat to the translated string.
$txt['chat'] = 'Chat';


EDIT
There is another way to make a tab active and you don't need to edit the if (in_array($context['current_action'], line.  All you have to do is...

Code (this) Select
if ($context['current_action'] == 'chat')
$current_action = 'chat';


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


If you find it a bit confusing please let me know so that I can revide it :)

-JayBachatero

I think I understand that, but how do you make a button for something that is outside the forum eg a coppermine gallery or a blog etc

how do you format the 'path' (is that the right expression) to point it to the gallery or blog or whatever?

~thanks
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 11, 2006, 02:15:20 PM
In the href tag use the full url.  http://blah//com/blah.php

Glad to hear it's working delayed.
Title: Re: How to add tabs to Core (NDT)?
Post by: marian0 on March 11, 2006, 02:21:03 PM
Hi..
I'd like to add a link in the tab menu, i did it but i want to add a link to another page and it page will be include inside the forum theme...
I saw that tarkhorani could do that on his website and i cant find how to do that...
This is an example about that im saying

http://www.epaytalk.com/index.php?action=advertise (http://www.epaytalk.com/index.php?action=advertise)

He added a tag in the page and put a link to a different one with the forum theme...

well... i hope you can help me


thanks

Marian0
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 11, 2006, 02:56:02 PM
He did this on the index.template.php.  On the include part change that to the file you want to include.  Follow the steps to add the tabs.


function template_banner()
{
     //Load the main_above template.  This is the header part
     template_main_above();
     //Load the file needed to be loaded
     include('banner.txt');
     //Load the copyright and so on.
     template_main_below();
}
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'blah')
{
     //Make use of SMF's layer system
     $context['template_layers'] = array();
     $context['sub_template'] = 'banner';
}
Title: Re: How to add tabs to Core (NDT)?
Post by: perplexed on March 11, 2006, 04:54:45 PM
Quote from: JayBachatero on March 11, 2006, 02:15:20 PM
In the href tag use the full url.  http://blah//com/blah.php

Glad to hear it's working delayed.

Sorry I'm not a coder lol

do you mean instead of

<a href="', $scripturl, '">' , $txt[103] , '</a>


you would have

<a href="', /mysite.com/galleryl, '">' , $txt[103] , '</a>

could I use that or do you need to remove some of the punctuation?


Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on March 11, 2006, 05:14:59 PM
you need to remove ' , , '
<a href="http://mysite.com/galleryl">' , $txt[103] , '</a>
Title: Re: How to add tabs to Core (NDT)?
Post by: crazie on March 29, 2006, 11:48:42 AM
Jay,

Many thanks for the write-up!  Worked on the first attempt!  :)
Title: Re: How to add tabs to Core (NDT)?
Post by: dunx on April 07, 2006, 09:59:11 AM
I need help with making a button so users can click off the main menu, to the paid subscription.

I have looked over the code and it baffles me completely can anyone help me?

The button URL would be

http://www.sellyourholiday.com/forum/index.php?action=profile;sa=subscriptions

I will make a small custom button but its the code to put it into my website which confuses the hell out of me..

Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on April 07, 2006, 02:08:08 PM
Did you follow the tutorial step by step?  Just replace action=chat with action=profile;sa=subscriptions
Title: Re: How to add tabs to Core (NDT)?
Post by: dunx on April 07, 2006, 07:43:26 PM
i tried and failed completely, nothing happens.

i made the button the code etc, nothing showed up, the problem is there are sooo many differnt versions of the code i didnt know which ones to use.  im still confused.

could u post an example I could copy?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on April 07, 2006, 10:00:52 PM
This is the wrong tutorial.  You need the button tutorial not tabs.
How to add buttons (http://www.simplemachines.org/community/index.php?action=search2;search=How%20to%20add%20buttons)
Title: Re: How to add tabs to Core (NDT)?
Post by: dunx on April 09, 2006, 06:36:26 AM
The how to make buttons search you gave me almost all of them lead back to here so i tried to modify my calender code but again nothing happens, here is my code:

// The [subscriptions]!
   if ($context['allow_subscriptions'])
      echo ($current_action == 'profile;sa=subscriptions' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'profile;sa=subscriptions' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=profile;sa=subscriptions">' , $txt['calendar24'] , '</a>
            </td>' , $current_action == 'profile;sa=subscriptions' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on April 10, 2006, 03:21:00 PM
Do this

Add this on top

if (isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'subsciptions')
$current_action = 'subscriptions';


Then for the button itself use this.

// The [subscriptions]!
   if ($context['allow_subscriptions'])
      echo ($current_action == 'subscriptions' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'subscriptions' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=profile;sa=subscriptions">Subscriptions</a>
            </td>' , $current_action == 'subscriptions' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on April 16, 2006, 05:13:25 PM
Jay how would you go about changing the rest of the files to convert the buttons to tabs?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on April 17, 2006, 12:02:41 AM
In your index.template.php file there is an option that says usetabs.  You can try that out.
Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on April 17, 2006, 09:05:24 AM
tried

// Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1 RC2';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = false;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}


and // Initialize the template... mainly little settings.
function template_init()
{
global $context, $settings, $options, $txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1 RC2';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}


But still it doesnt show the tabs outside of the index.template
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on April 18, 2006, 12:39:42 AM
Take a look and see how it's one in Memberlist.template.php.
Title: Re: How to add tabs to Core (NDT)?
Post by: cj morin on April 28, 2006, 03:53:09 AM
okay i got the tab working but how do you make it load inside i am using 1.1rc2 and tp0.8.6(i think).  right now it opens a new page in the same window, but i want it to open in the same page kind of like this http://www.timodonnell.co.uk/index.php?action=coppermine. (http://www.timodonnell.co.uk/index.php?action=coppermine.)  i am sorry if this is not the place to post, but i have tried searching here and at coppermine.  i hope i have explained this correctly any help would be appreciated
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on April 28, 2006, 09:35:29 AM
Photo Gallery.... (http://www.simplemachines.org/community/index.php?topic=19518.0)
Title: Re: How to add tabs to Core (NDT)?
Post by: nitecrawler on May 05, 2006, 03:40:04 AM
I've followed the tab button procedure. However the problem I face is slightly different from it.

In this case, I do not have a fixed url for which the button should point. It is an 'Add to Del.icio.us' Button.

// The [Add to Del.iciou.us] Button!
echo ($current_action == 'delicious' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'delicious' ? 'active_back' : 'back' , '">
               <a href="[color=red][b]<URL>[/b][/color]">Add to Del.icio.us</a>
            </td>' , $current_action == 'delicious' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


I want the <URL> to be like: http://del.icio.us/post?url=Curent Document Location&title=Current Document Title

I've the javascript code for it.

Quote<script language='javascript'>
document.write("<a href='http://del.icio.us/post?url="+encodeURIComponent(document.location.href)+ "&title="+encodeURIComponent(document.title)+"'>Add to Del.icio.us</a>")
</script>

But how do i have this url set in the place of the button hyperlink?  ::)

Can anyone help me with the code? I am not sure how to embed this js into php.
Title: Re: How to add tabs to Core (NDT)?
Post by: nitecrawler on May 05, 2006, 11:13:00 AM
I thought i finally got it after hours of searching, but it isn't working..

// Show the [Add to Del.icio.us] button.
echo ($current_action == 'delicious' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'delicious' ? 'active_back' : 'back' , '">
<a href="http://del.icio.us/post?url=' . {$_REQUEST['url']} . '&title=' . {$_REQUEST['title']}. '">Add to Del.icio.us</a>"
</td>' , $current_action == 'delicious' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Am i missing something here?  :'(
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on May 05, 2006, 06:22:56 PM
Try replacing

<a href="http://del.icio.us/post?url=' . {$_REQUEST['url']} . '&title=' . {$_REQUEST['title']}. '">Add to Del.icio.us</a>"


with

<script language="javascript">
document.write("<a href=\'http://del.icio.us/post?url="+encodeURIComponent(document.location.href)+ "&title="+encodeURIComponent(document.title)+"\'>Add to Del.icio.us</a>")
</script>
Title: Re: How to add tabs to Core (NDT)?
Post by: nitecrawler on May 05, 2006, 10:42:27 PM
Thank you, thank you, thank you! It worked  :D

My presumption that the js embedded like that in PHP made it all wrong... I acknowledge that at times being completely unaware is better than being slightly aware!..  8)
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on May 06, 2006, 03:26:20 AM
The JS has ' and you must escape them to echo them.  Escaping them mean change ' to \'
Title: Re: How to add tabs to Core (NDT)?
Post by: Penelope on June 04, 2006, 06:02:42 PM
Thanks for all the info!  :D

I have only one question. I made a new menu item "Hall of Fame" and when i go on that page, the "Home" and "Hall of Fame" button are selected, which should only be the "Hall of Fame" button.

Any idea what is wrong? Hope someone can help me!

in the index.template i have this:

//Hall of fame menu button
if ($context['current_action'] == 'halloffame')
$current_action = 'halloffame';
echo ($current_action=='halloffame' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'halloffame' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=halloffame">Hall of Fame</a>
</td>' , $current_action == 'halloffame' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


in the halloffame.php file i have this:

<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
halloffame() {
// This is gonna be needed...
loadTemplate('halloffame');
}


in the halloffame.template i have this:

<?php
// Version: 1.1 RC2; Gallery

function template_main()
{
global $context$settings$options$txt$scripturl;

echo '
<script language="JavaScript" type="text/javascript"><!--
function checkAll(onOff)
{
for (var i = 0; i < document.searchform.elements.length; i++)
{
if (document.searchform.elements[i].name.substr(0, 3) == "brd")
document.searchform.elements[i].checked = onOff;
}
}
// --></script>
<form action="'
$scripturl'?action=search2" method="post" name="searchform" id="searchform">

 <script type="text/javascript"><!--

/***********************************************
* IFrame SSI script II- Â© Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don\'t support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

// --></script>

<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>Hall of Fame</td>
</tr><tr>
<td class="windowbg">'
;

/*   
 *   Podium Hall of Fame
 *   
 *   
 */

echo ' <center><table border="0" width="95%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr class="catbg">
<td align="center" colspan = 3>
<img src="">
<a href="'
.$scripturl.'?action=arcade">Hero Members</a><img src="">
</td>
</tr>
<tr align="center">
'
;
if(!empty($data_1[2]["name"])){
echo'
<td class="windowbg" width="33%">
<img src="" border="0" /> <br />
'
.$data_1[2]["avatar"].' <br/>
<a href="'
.$scripturl.'?action=profile;u='.$data_1[2]["id"].'">'.$data_1[2]["name"].'</a> <br/>
(<b>'
.$data_1[2]["count"].'</b> Highscores)
</td>
'
;
}else{
echo'
<td class="windowbg" width="33%">
&nbsp;
</td>



<td class="windowbg" width="33%">
<img src="" border="0" /> <br />

<a href=""></a> <br/>

</td>
<td class="windowbg" width="33%">
&nbsp;
</td>
'
;
}
if(!empty($data_1[3]["name"])){
echo'
<td class="windowbg" width="33%">
<img src="" border="0" /> <br />
'
.$data_1[3]["avatar"].' <br/>
<a href="'
.$scripturl.'?action=profile;u='.$data_1[3]["id"].'">'.$data_1[3]["name"].'</a> <br/>
(<b>'
.$data_1[3]["count"].'</b> Highscores)
</td>
'
;
}else{
echo'

'
;
}
echo'
</tr>
</table></center>
'
;


/*
 * End podium Hall of Fame
 *
 *
 */






echo '
</td>
</tr>
</table>
</form>'
;
}

?>
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 04, 2006, 06:06:28 PM
This is your problem.
$current_action = 'halloffame';

Refer to step one.
Title: Re: How to add tabs to Core (NDT)?
Post by: Penelope on June 04, 2006, 06:18:41 PM
Thanks for your fast reply, but can you please be more specific :-[  :D

I am not an experienced php'er  ;)  :-[ :D
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 04, 2006, 06:31:14 PM
http://www.simplemachines.org/community/index.php?topic=63203.msg437231#msg437231

This step "1. In index.template.php".  Use the first method and remove the other $current_action you added.
Title: Re: How to add tabs to Core (NDT)?
Post by: Penelope on June 04, 2006, 06:56:29 PM
BIG thanks JayBachatero!!  ;D :D :D :D
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 05, 2006, 03:30:38 AM
it's not working for me :(
i got this
// Show the [shop] button...
      echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
               <<a href="', $scripturl, '?action=shop">shop</a>
            </td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : ''

yet no shop tab is appearing
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 05, 2006, 02:43:33 PM
You seem to be missing a (;) at the end of the last line.
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 06, 2006, 09:09:52 AM
still not working
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 06, 2006, 09:27:40 AM
<<a href="', $scripturl, '?action=shop">shop</a>

Remove the extra <
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 07, 2006, 04:04:27 AM
still not working
my code again
// Show the [shop] button...
      echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=shop">shop</a>
            </td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 07, 2006, 10:52:04 AM
The tab is not showing at all or what?
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 08, 2006, 04:05:51 AM
well from the start the tab button (shop) has been showing but not in any other themes.
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 08, 2006, 04:17:26 PM
You need to edit the rest of your themes to add the buttons/tabs.
Title: Re: How to add tabs to Core (NDT)?
Post by: Jen Smith on June 08, 2006, 10:30:12 PM
Great tutorial, added a few tabs with no problems... except one, and I'm not sure what all I'm doing wrong.

Using TinyPortal, and want to add a tab for the download page.  (The action is tpmod;dl=0).

So, I modified this line:
if (in_array($context['current_action'], array('Bookmarks','chat','tpmod;dl=0','search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'pm', 'forum', 'tpadmin')))

And added this further down:
// Add a download tab (tpmod;dl=0)
echo ($current_action == 'tpmod;dl=0' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tpmod;dl=0' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl=0">Files</a>
</td>' , $current_action == 'tpmod;dl=0' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


It does work.  I see the tab, and it sends me to the right page.  What it's not doing is showing as the "active tab" if you get me.  The others that I've added work properly (bookmarks, chat and so on.)

I'm sure it's something stupid, but I'm missing it -- anyone have an idea?
Title: Re: How to add tabs to Core (NDT)?
Post by: Jen Smith on June 08, 2006, 11:15:47 PM
Gah, I found my problem.  Apparently TP does a lil switcheroo on the actions somewhere.

Slight modification got it working:
// Add a download tab tpmod;dl=0
echo ($current_action=='dlmanager' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'dlmanager' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl">Files</a>
</td>' , $current_action == 'dlmanager' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


I had to change most of them to "dlmanager", except for the one that's actually being sent when you hit the tab.
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 09, 2006, 05:40:45 AM
i get it!!
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 09, 2006, 06:06:53 AM
how do you add a image to it?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 09, 2006, 07:14:37 PM
Add the image tag right before the <a href...
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 10, 2006, 12:26:33 AM
so that just the <img src="url">???
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 10, 2006, 12:51:00 PM
Correct.
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 10, 2006, 09:31:18 PM
didn't work
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 10, 2006, 09:39:17 PM
Let me see the code you have now.
Title: Re: How to add tabs to Core (NDT)?
Post by: randomdood on June 12, 2006, 05:20:53 AM
//Begin SMFShop 2.0 (Build 8) MOD code
//loadLanguage("shop");
echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
<img src="http://switchfoot.cknetworx.com/smf/themes/autumndark1-1-RC2/images/english/shop.gif><a href="', $scripturl, '?action=shop">Shop</a>
</td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
//END SMFShop MOD code


now the text that said shop isn't even linked to anything
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 12, 2006, 09:33:40 AM
You are using the wrong tutorial.  This is for TABS.  You need the buttons tutorial.
Title: Re: How to add tabs to Core (NDT)?
Post by: guppy on June 21, 2006, 09:33:25 AM
Hi,

I added "News" to my RC2 template but it doesn't highlight the active tabs.. Pls help. Here are the codes:


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', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

// Add own buttons
if ($context['current_action'] == 'news')
$current_action = 'news';

....

echo '
<td class="maintab_' , $first , '">&nbsp;</td>';

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

// Show the [news] button.
echo ($current_action=='news' || $context['browser']['is_ie4']) ? '<td class="maintab_active_first">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action=='news' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?cat=22">' , $txt['menu_news'] , '</a>
</td>' , $current_action=='news' ? '<td class="maintab_active_last">&nbsp;</td>' : '';

if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
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, '?action=forum">' , $txt['menu_forum'] , '</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';

....
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 21, 2006, 02:02:22 PM
Change this

// Add own buttons
if ($context['current_action'] == 'news')
$current_action = 'news';


To this

// Add own buttons
if (isset($_REQUEST['cat']) && $_REQUEST['cat'] == 22)
$current_action = 'news';
Title: Re: How to add tabs to Core (NDT)?
Post by: guppy on June 21, 2006, 08:43:34 PM
Ok it's working thanks  ;)

Hmm.. When do i use which code?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on June 22, 2006, 12:09:10 AM
If you have a regular action=hello you use $context['current_action'].  If not then you use the way that I showed you.
Title: Re: How to add tabs to Core (NDT)?
Post by: guppy on June 22, 2006, 12:39:27 AM
Ok thanks :)
Title: Re: How to add tabs to Core (NDT)?
Post by: PuLsE_007 on June 28, 2006, 12:52:54 PM
In the words of Comic Book Guy..."Worst Tutorial EVER!" Well, Comic Book Guy's wrong because this was the BEST tutorial EVER! Great job, very well written, EXTREMELY helpful, THANK YOU!  :D
Title: Re: How to add tabs to Core (NDT)?
Post by: vdubbia on June 29, 2006, 11:21:59 PM
I successfully added a tab to link to an external gmail link (will eventually link to my gmail hosted email).  The link opens the page in the same window.  How do I make it so it will open in a new window?

Here is the code for my tab.. I copied the text for my 'help' button.  This code works, but I don't know if I have the completely correct code, but here it is:

// Show the [mail] button.
   echo '<li><a' , $current_action == 'mail' ? ' class="active"' : '', ' href="http://www.gmail.com"', $scripturl, '?action=help">' , $txt[120] , '</a></li>';

not sure if the action parts are correct, but they seem to work this way...

Appreciate the help!  And if I want a small envelope graphic to appear in the tab, I can use img src, correct?
Title: Re: How to add tabs to Core (NDT)?
Post by: vdubbia on June 30, 2006, 08:36:42 AM
Quote from: wowzer on June 29, 2006, 11:21:59 PM
I successfully added a tab to link to an external gmail link (will eventually link to my gmail hosted email).  The link opens the page in the same window.  How do I make it so it will open in a new window?

Here is the code for my tab.. I copied the text for my 'help' button.  This code works, but I don't know if I have the completely correct code, but here it is:

// Show the [mail] button.
   echo '<li><a' , $current_action == 'mail' ? ' class="active"' : '', ' href="http://www.gmail.com"', $scripturl, '?action=help">' , $txt[120] , '</a></li>';

not sure if the action parts are correct, but they seem to work this way...

Appreciate the help!  And if I want a small envelope graphic to appear in the tab, I can use img src, correct?

Anyone?
Title: Re: How to add tabs to Core (NDT)?
Post by: medy on July 01, 2006, 07:53:24 AM
Hi everyone!

it is very nice to see such a good support on this topic. Thumbs up ;)

I'm using SMF 1.1rc2 and Tiny Portal 8.6, default theme.
I added another tab to main menu, which points to article written in TP. I found that this would be the simplest way to link simple text (HTML) file to main tabs. The only problem I found is, that i don't get visited effect on newly created tabs, since it is part of TP and it is external link.

Had anyone similar issues and solved them?

working tab code:// Show the [pomoÄŤ;] button...
      echo ($current_action == 'pomoÄŤ;' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'pomoÄŤ;' ? 'active_back' : 'back' , '">
               <a href="http://www.e-participacija.si/forum_EU/index.php?page=17">PomoÄŤ</a>
            </td>' , $current_action == 'PomoÄŤ;' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


URL, where you can check the tab (it is called "pomoÄŤ" - last one in the row): http://www.e-participacija.si/forum_EU/ (http://www.e-participacija.si/forum_EU/)

All well to you :)
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on July 02, 2006, 01:12:58 AM
wowzer add target="_blank" to the <a href> tag.

medy the same thing applies as this.
http://www.simplemachines.org/community/index.php?topic=63203.msg619619#msg619619
Title: Re: How to add tabs to Core (NDT)?
Post by: vdubbia on July 02, 2006, 10:13:52 PM
Quote from: JayBachatero on July 02, 2006, 01:12:58 AM
wowzer add target="_blank" to the <a href> tag.

medy the same thing applies as this.
http://www.simplemachines.org/community/index.php?topic=63203.msg619619#msg619619

like this?

// Show the [mail] button.
   echo '<li><a' , $current_action == 'mail' ? ' class="active"' : '', ' href="http://www.gmail.com"', $scripturl, '?action=help">' , ' target="_blank"', $txt[120] , '</a></li>';

and do I need the action=help any more?  do I change that to 'mail'?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on July 04, 2006, 02:03:53 PM

// Show the [mail] button.
   echo '<li><a' , $current_action == 'mail' ? ' class="active"' : '', ' href="http://www.gmail.com" target="_blank>' , ' "', $txt[120] , '</a></li>';
Title: Re: How to add tabs to Core (NDT)?
Post by: Figueira on July 23, 2006, 02:05:30 PM
Hi!  I have a problem kind of like medy. Using SMF RC2 with tiny portal
i've checked this example (http://www.simplemachines.org/community/index.php?topic=63203.msg619619#msg619619) you told medy to see, but I could'nt use in my case.

I've created a download, wich is provided by tinyportal action tpmod;dl=0  button here: www.lei-forum.com, and it does't get the visited effect. Here it goes.

if ($context['current_action'] == 'downloads')
$current_action = 'downloads';


and later down:

//The [Downloads]
//if ($context['user']['is_logged'])
                echo ($current_action=='downloads' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'downloads' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl=0">', $txt['downloads'], '</a>
</td>' , $current_action == 'downloads' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



Thanks for the attention =)
Title: Re: How to add tabs to Core (NDT)?
Post by: Figueira on July 23, 2006, 05:38:46 PM
bah! dumb :P somehow I missed jbysmith post!

It's ok now =) thanks anyway

Title: Re: How to add tabs to Core (NDT)?
Post by: guppy on August 08, 2006, 10:19:46 AM
Quote from: Jay The Code Monkey on June 21, 2006, 02:02:22 PM

// Add own buttons
if (isset($_REQUEST['cat']) && $_REQUEST['cat'] == 22)
$current_action = 'news';


I change cat to page for a Tiny Portal mod article. If I have many many pages under that tab, is it possible to form an array instead of repeating this code? Thanks  :)
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on August 08, 2006, 12:34:11 PM
if (in_array(@$_REQUEST['cat'], array(1, 2, 33, 22, 'and', 'so', 'on')))
$current_action = 'news';
Title: Re: How to add tabs to Core (NDT)?
Post by: guppy on August 09, 2006, 09:42:10 AM
ok thank you  :)
Title: Re: How to add tabs to Core (NDT)?
Post by: nipun_jain on August 17, 2006, 01:35:53 PM
I am using SMF 1.1 RC2 with TinyPortal. Recently I added felblog module to my site and hence tried to add a blog tab. I edited the code as follows:


Added this code:
if ($context['current_action'] == 'tpmod;blog')
$current_action = 'felblog';


and this one:
// Show the [blog] button.
echo ($current_action == 'felblog' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td class="maintab_' , $current_action == 'felblog' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;blog">Blog</a>
</td>' , $current_action == 'felblog' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


But when I click on the Blog tab, the page that opens has the visited effect on the Home tab instead of the Blog tab. What am I doing wrong?
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on August 17, 2006, 10:59:01 PM
Change

if ($context['current_action'] == 'tpmod;blog')
$current_action = 'felblog';

To

if ($context['current_action'] == 'tpmod' && isset($_REQUEST['blog']))
$current_action = 'felblog';


That should work.
Title: Re: How to add tabs to Core (NDT)?
Post by: nipun_jain on August 18, 2006, 07:39:33 AM
Thanks, that worked!
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on August 28, 2006, 03:03:54 AM
Hello,

Edit* Found the answer to my problem after some more searching, thanks anyways to anyone that read this.

I read through the whole thread, but never saw this question asked, and through playing with different options, I can't seem to get it to work.

I changed the link for my Home tab by replacing the ', script_url ,' dealy, and want to do the same with my logout link.

if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="http://www.mysite.com/index.php?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Is my last attempt.. the original code being:

// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


I've tried a few other attempts at making it work, and I've gotten just the link to work properly, but the logout action doesn't take place.  Any help would be appreciated, thanks.
Title: Re: How to add tabs to Core (NDT)?
Post by: Alt-Ctrl on August 29, 2006, 01:51:48 PM
Hi, I'm trying to get a button in my forum that directs the user back to the portal.

I've tried to follow this tutorial, but I'm getting an error on the last line. I don't understand what it is.
And shouldn't it be a place where I can put in the adress to where I want the button to point?


Yeah, I'm a noob

//Show the [main] button.
echo ($current_action=='main' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'main' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' '?action=main">Main</a>
</td>' , $current_action == 'main' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on August 30, 2006, 12:42:12 AM
Hey Alt-Ctrl,

I'm by no means an expert on SMF, but from reading through this tutorial I think I can help you out (Experts, please corrent me if I'm wrong :) )

Your error is coming from an improper <a href> call for the action.  Your code should read as follows:

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


And in answer to your second question, to tell the button which URL to link to, just place it into the <a href= tag, in place of $scripturl, as shown above.


Hope that helps, if it doesn't work, I'm sure someone more versed with SMF will be along soon to help you out.

Edit*  For your needs, I believe you just want a button that will take the user back to the main url.  If that's the case, this code should suffice for your needs:
//Show the [main] button.
echo ($current_action=='main' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'main' ? 'active_back' : 'back' , '">
<a href="http://www.mysite.com">Main</a>
</td>' , $current_action == 'main' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



Replace http://www.mysite.com with wherever you want it to link to of course.
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on August 30, 2006, 01:20:28 AM
Well, after helping someone else with adding a button, I've come across an error myself when adding a button (Oh, the irony).  Anyways, I've added the button.  It only shows up when people are logged in, which is how I want it. The button goes to the proper url.. infact everything with the button works fine.. the only problem is I get the following error code at the top of my page that the button is on.

Notice: Use of undefined constant forums - assumed 'forums' in /www/html/forums/Sources/Load.php(1702) : eval()'d code on line 95

Notice: Use of undefined constant gallery - assumed 'gallery' in /www/html/forums/Sources/Load.php(1702) : eval()'d code on line 96


I went to find those 2 lines, and this is what they are:

bool sessionOpen(string session_save_path, string session_name)
bool sessionClose()


I added the buttons just as its described in the tutorial:


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


and


  if ($context['current_action'] == 'forums')
    $current_action = 'forums';



Any help would be appreciated, thanks.
Ravyn
Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on August 30, 2006, 10:15:46 AM
Change ' , $txt[forums] , ' to ' , $txt['forums'] , ' You will need to do the same for the gallery one ' , $txt[gallery] , ' to ' , $txt['gallery'] , '
Title: Re: How to add tabs to Core (NDT)?
Post by: Alt-Ctrl on August 30, 2006, 11:06:46 AM
Thanks allot, that worked like a dream  :)
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on August 30, 2006, 09:40:34 PM
Glad I could be of help Alt-Ctrl, and thanks for the help akabugeyes, ill give it a try in a few minutes here, completely overlooked that.

Cheers,
Ravyn
Title: Re: How to add tabs to Core (NDT)?
Post by: barramya on September 01, 2006, 03:27:15 PM
Thought I'd reply and say a big thank you to all of you guys in the topic who have advised :) helped me out loads for my site.

Cheers
S
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 02, 2006, 01:25:35 AM
Akabugeyes,

I tried doing that small edit today, and it still produced the same error messages.
I'm using ssi_menubar(); to display the menubar on my home page, outside of the forums.  ie: www.mysite.com/index.php  rather than www.mysite.com/forums/. 

The buttons show up and work fine with the exception of those 2 errors.  And when I take the Forum link to the forums of my site at www.mysite.com/forums/ the same added buttons (Forums and Gallery) both appear on the menubar still, and the errors do not appear. 

So perhaps its something with calling on it outside the forums directory? Do I need to alter the code to deal with that?  I even tried hard-coding the word Gallery rather than using the language file, and it still gave me the same error.  So that led me to believe it wasn't an issue with the language call, but the variables that are used in creating the button.  Here is my code again:

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



Note: This is with the Gallery text hardcoded, still providing the same error.
// Show the [gallery] button.
  if ($context['user']['is_logged'])
    echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
<a href="http://www.mysite.com/gallery/">Gallery</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



  if ($context['current_action'] == 'forums')
    $current_action = 'forums';
  if ($context['current_action'] == 'gallery')
    $current_action = 'gallery';


Thanks for your time,
Ravyn
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 03, 2006, 10:13:18 PM
Sry for the bump, wondering if anyone has any ideas?  Those 2 errors at the top of my main page are driving me nuts  :(
Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on September 03, 2006, 10:38:40 PM
Ravyn, have you applied this to another theme by any chance? You shouldn't be getting those errors if you have hardcoded it especially. The ssi menubar function would not cause this error as it calls that function directly.
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 03, 2006, 10:40:50 PM
Nope, using the default theme, basically unedited besides the changes to add the buttons.

Do I need to define the 2 variables somewhere else in the file maybe?
Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on September 03, 2006, 10:44:22 PM
If you didn't edit it through the admin panel are you sure it was uploaded properly? Maybe try uploading the changed file again. Make sure it is being uploaded to Themes/default If that doesn't help you can send me your theme's index.template.php to my email at [email protected] and I can take a look at it if you want.
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 03, 2006, 10:45:47 PM
I've tried so many different iterations of the code, between changing to hardcoded, adding the single quotes that you told me to, taking them out, etc.  That I'm positive it is uploaded correctly.  I'll send over my template file if you have time to take a peek.  Thanks for the help.  If you need anything else, just email me back.
Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on September 03, 2006, 11:33:06 PM
Ravyn, I uploaded the file to my test board theme's default directory and did not get any errors. Can you go to your forum's error log: Admin / Forum Error Log and tell me what the errors look like there, such as if the url for the error is always the same or varies and the line number of the file it is occuring in. I am wondering if for some reason this is just happening on your forum page and not inside the forum itself.
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 03, 2006, 11:45:39 PM
Thats just it.. the error only appears outside the forums.  On my main page, when I click the link that takes me to my forums, the buttons still appear, but the errors do not.  Perhaps its an error in my index.php for my main page?

Same 2 errors repeated over and over again in the Forum Error Log

Apply Filter: Only show the errors with the same message
8: Use of undefined constant forums - assumed 'forums'
/home/virtual/site45/fst/var/www/html/forums/Themes/default/index.template.php (eval?)
95


Apply Filter: Only show the errors with the same message
8: Use of undefined constant gallery - assumed 'gallery'
/home/virtual/site45/fst/var/www/html/forums/Themes/default/index.template.php (eval?)
96

However, the URL listed for each of the errors in the error log (4+ pages of those 2 errors repeated) is listed for every page I visit within my site.  If I go to the search page, the help page, the admin page, even the Error Log page.. each new page creates another set of those 2 errors in the error log, despite the actual errors not appearing on the page like they do on my main page.

Edit: If it would help, I can setup an administrator account for you on the forums to view the error logs and such.  Let me know, and I'll PM you the login/password for it.
Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on September 03, 2006, 11:56:06 PM
Sure you can give me admin access and I can take a look at it.
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 06, 2006, 07:24:19 PM
Doesn't look like akabugeyes was able to find the problem, wondering if anyone else might have an idea?  I can provide you with any template file you might need, or perhaps its an issue with the index.php of my mainpage?

Thanks in advance.
Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on September 06, 2006, 09:38:01 PM
Sorry for the delay. I am still thinking the files contents may still be outdated from the file you have on your computer and what you sent me. Can you download the current file from ftp and check to make sure the changes are in it? As I didn't get the errors you have when I tested the file and what I posted should have fixed it.
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 07, 2006, 12:06:21 AM
I'll do that.. perhaps I could send you the file I'm using for my index.php of my main page, and you could give it a quick test run outside of the /forums/ folder on your server?

Edit: I checked, and rechecked the file in my /forums/themes/default/ folder.  The index.template.php is the exact same as the one that I sent you.

Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 07, 2006, 12:45:42 AM
I really can't figure out what's causing these errors.. doesn't make any sense.

Here's the index.php file I'm using to call the ssi_menubar function.  This is located at www.mysite.com/index.php and I'm calling on/using the stylesheet and SSI.php files located at www.mysite.com/forums/...

<?php

  
require("/home/virtual/site45/fst/var/www/html/forums/SSI.php");

echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/style.css" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js"></script>
<style type="text/css">
body
{
margin: 1ex;
}'
;

if ($context['browser']['needs_size_fix'])
echo '
@import('
$settings['default_theme_url'], '/fonts-compat.css);';

echo '
</style>'
;

  echo 
'
    <html>
    <body>
    <table width="95%" cellpadding=0 cellspacing=0 align=center>
    <tr align=center>
    <td align=center>
    <img src="logo.gif">
    </td>
    </tr>
    </table>
     <div class="tborder">
     <table width="100%" cellpadding="0" cellspacing="0" border="0">
     <tr>
     <td class="titlebg2" height="32"> 
  '
;

  if (
$context['user']['is_guest'])
  {

    
ssi_login('http://www.mysite.com/index.php');
  }
  else
  {
    
ssi_welcome();
  }
  echo 
'
    </td>
   </tr>
    </table>
    </div>
  '
;
  
ssi_menubar();
  echo 
'
    <br>
    <table border="0" width="100%" align="center">
      <tr>
        <td width="60%"> '
;
          
$array ssi_boardNews(1.05null250'array');
          foreach (
$array as $news)
         {
        
echo '
         <table border="0" width="100%" align="left" class="tborder">
         <tr class="titlebg2">
         <td><b>'
$news['subject'], '</b></td>
         </tr>
         <tr>
         <td>'
$news['body'], '<br /><br /></td>
         </tr>
         <tr class="titlebg2">
         <td>'
$news['link'], ' | '$news['new_comment'], '</td><br>
         </tr>
         </table>
         <br />
            '
;
      
   }  
          echo 
'

        </td>
        <td>
          Testing Layout
        </td>
      </tr>
    </table>
  </body>
  </html>
  '
;
?>



And again.. the code of my index.template.php located in my www.mysite.com/forums/Themes/default/

  if ($context['current_action'] == 'forums')
    $current_action = 'forums';
  if ($context['current_action'] == 'gallery')
    $current_action = 'gallery';

And the actual creation of the buttons located further down the file:

  // Show the [forums] button.
  if ($context['user']['is_logged'])
    echo ($current_action == 'forums' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'forums' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt['forums'] , '</a>
</td>' , $current_action == 'forums' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
// Show the [gallery] button.
  if ($context['user']['is_logged'])
    echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
<a href="http://www.mysite.com/gallery/">Gallery</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


The errors that I'm getting are as follows:

Notice: Use of undefined constant forums - assumed 'forums' in /home/virtual/site45/fst/var/www/html/forums/Sources/Load.php(1702) : eval()'d code on line 95

Notice: Use of undefined constant gallery - assumed 'gallery' in /home/virtual/site45/fst/var/www/html/forums/Sources/Load.php(1702) : eval()'d code on line 96


And line 95 and 96 of Load.php are as follows:

bool sessionOpen(string session_save_path, string session_name)
bool sessionClose()


Is there somewhere I should be defining those variables?

Thanks for your time.
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 07, 2006, 12:58:47 AM
An interesting development...

Thinking that perhaps the variables gallery and forums were being used elsewhere within the SMF code, I changed them to 'tarforums' and 'targallery' switching all the instances of the 2 variable within my index.template.php file located in the default theme directory.

When I load my site up, it still gives the same errors, referring to the constants 'forums' and 'gallery'  ?  Shouldn't it be giving me an error regarding 'tarforums' and 'targallery' now that I've switched them?

Does that shed any light on where the error may be coming from?
Title: Re: How to add tabs to Core (NDT)?
Post by: bloc on September 07, 2006, 05:34:51 AM
That would indicate maybe another template was used. Have you set another theme as default maybe?
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 07, 2006, 07:50:00 PM
Quote from: Bloc on September 07, 2006, 05:34:51 AM
That would indicate maybe another template was used. Have you set another theme as default maybe?

See that's what i was thinking at first as well.. but when I saw that, I went and double checked and the theme is set to /Themes/default/, forum is running on the default theme.  I haven't installed any new ones besides what comes packaged with SMF (oblivion and classic i think?).  And the only theme that I've modified to include those 2 extra buttons is the default, so if it was running on another theme the buttons wouldn't even be appearing. 

It boggles the mind  :-\

Going to try a fresh install of SMF.  I'll let you know how it turns out.
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 07, 2006, 08:41:03 PM
Well, if this accomplished nothing else, it gave me a little more familiarity with many aspects of SMF for further mods I may wish to embark upon. 

The fresh install seems to be working fine.  I'm now going back through any changes I may have made to the original in an attempt to find where I took a wrong turn, though I'm not sure I'll ever know. 

Many thanks to akabugeyes for the time that he put towards helping me out.
Title: Re: How to add tabs to Core (NDT)?
Post by: chinclub on September 18, 2006, 08:21:25 PM
It sounds like I am having the same problem.  I have added 3 links to the main menu.  They look fine and work fine but they each put errors in the log everytime a page is viewed.  So in 30 minutes I have a ton of error pages in the log. 

QuoteApply Filter: Only show the errors with the same message
8: Use of undefined constant Arcade99 - assumed 'Arcade99'
File: /home/fsvzwtpl/public_html/chinclub/forum/Themes/default/Display.template.php (eval?)
Line: 684
Title: Re: How to add tabs to Core (NDT)?
Post by: Ravyn on September 19, 2006, 02:33:21 AM
I was never able to figure out where the errors were coming from I'm afraid.  My best advice is to do a fresh install of SMF, then add the buttons you want.
Title: Re: How to add tabs to Core (NDT)?
Post by: chinclub on September 19, 2006, 08:32:34 AM
Well, that isn't an option for me. Too many mods already installed and too much work done.

Is there any harm in just leaving it like it is.  Everything appears to be working fine.  If I didn't look at the log files I wouldn't have even known there was a problem.  The buttons are there and they take you to the right place when you click them... they just write to the log file as they do.
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on September 19, 2006, 09:27:22 AM
That error means that you used $txt[Arcade99] instead of $txt['Arcade99']
Title: Re: How to add tabs to Core (NDT)?
Post by: chinclub on September 19, 2006, 09:39:30 AM
You are so wonderful!!!  That was it!!  No more errors.

Many thanks to you!
Title: Re: How to add tabs to Core (NDT)?
Post by: j.olyntho on October 05, 2006, 11:40:41 AM
Hello JayBachatero
In the new support site for Virtual Flight Community I´m developing, I need the opposite is been discussing at this topic.
I´m testing SMF Forum running (wrapped and using the same DB) inside Joomla, with all Login/Logout, Register, etc. functions been controlled by Joomla.
So, what I need is:
- to exclude Login/Register box (actually on top) on SMF Forum
- to exclude all options Tab - Home, Search, calendar, etc. - just keep the Help button available
- Search box must remain
- to exclude Info Center at botton
Is it possible to do?
Thanks a lot for any help
Jose Olyntho

PS: Jay you´re the Hero I was looking for...
Title: Re: How to add tabs to Core (NDT)?
Post by: howardravenhill on October 18, 2006, 04:00:35 PM
Howdy ya all!

This is hard for me, I'm a complete noob when it comes to html an php. Here is the thing I want to do:
I want the chat tab to open my FlashChat in a new window. But this doesn't work.// Show the [chat] button.
   echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="http://www.wingsofsteel.biz/Forum/chat/flashchat.php" target="_blank"</a>
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
The Chat tab worked before I added: target="_blank

Edit: I got it! Guess this is how it should be:// Show the [chat] button.
   echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="http://wingsofsteel.biz/Forum/chat/flashchat.php" target="_blank">Chat</a>
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
:D

But now I got another problem. Users will not log in automaticly in the chat. If I open a new tab in FF and type in the url to the chat, and I'm logged on my forum, it works. Strange. But sorry, this is off topic. Well, I'm going back to browsing forums for clues. ::)

Edit: Now everything is ok. I just forgot www in front of my domain.


Best wishes,
Ravenhill
Title: Re: How to add tabs to Core (NDT)?
Post by: zaheer on October 20, 2006, 05:15:13 AM
hi,
  I just tried to add a new button next to home button on my  main SMF page which is using classic template but I can't find the above mentioned  code in index.template.php ???
Title: Re: How to add tabs to Core (NDT)?
Post by: zaheer on October 20, 2006, 06:04:39 AM
Can anyone tell me where is sub menu template located which contains the following buttons.

1,home   2,help    3,search    4,login    5,register

I want to add a new button there.
Title: Re: How to add tabs to Core (NDT)?
Post by: howardravenhill on October 20, 2006, 01:02:32 PM
If you're running SMF 1.1RC3 with default theme, look inside "Beginning on line 468". Follow the instructions in this thread and you'll get there. But I agree, it's a bit hard to find.

Best wishes,
Ravenhill
Title: Re: How to add tabs to Core (NDT)?
Post by: riverts on October 21, 2006, 12:43:20 AM
thanks for this tutorial, it helps me a lot.
keep up the good work in helping a newbie like me here. ;)
Title: Re: How to add tabs to Core (NDT)?
Post by: zaheer on October 21, 2006, 06:07:20 AM

  I got the solution,that was a designing issue and I just added a button in NVU to index.php.
Thanks for help everybody.
Title: Re: How to add tabs to Core (NDT)?
Post by: darrencassar on October 28, 2006, 01:53:23 PM
Quote from: JayBachatero on December 31, 2005, 04:21:57 PM
For a more up to date version of this please see the doc site (http://docs.simplemachines.org/index.php?topic=564.msg927#msg927)

I tried to find a newer version for the latest swf but it is the same.

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


Code (Add After) Select
if ($context['current_action'] == 'chat')
$current_action = 'chat';


I couldn't find this code in the file described.... could be because it is a newer version of smf.

I just need to add a link to coppermine gallery.

Regards,
Darren
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on October 28, 2006, 09:50:42 PM
What theme are you using?  Also it's SMF ;).
Title: Re: How to add tabs to Core (NDT)?
Post by: darrencassar on October 30, 2006, 03:47:29 AM
I am using smf theme on coppermine and default theme on smf.

Coppermine has the link to the forum but not vice versa :(

Darren
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on October 31, 2006, 09:16:26 AM
Post your index.template.php.
Title: Re: How to add tabs to Core (NDT)?
Post by: darrencassar on October 31, 2006, 10:00:57 AM
Couldn't find an attach button to attach the file.
Sorry about it! Hope this is fine!

D

<?php
// Version: 1.0; index

/* This template is, perhaps, the most important template in the theme.  It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below.  It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
// --></script>
<title>'
$context['page_title'], '</title>';

// This is here because Gecko browsers properly support white-space....
if ($context['browser']['is_gecko'])
echo '
<style type="text/css"><!--
.code
{
white-space: pre;
}
--></style>'
;

echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="' 
$scripturl '?action=;topic=' $context['current_topic'] . '.0;prev_next=prev" />
<link rel="next" href="' 
$scripturl '?action=;topic=' $context['current_topic'] . '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?action=;board=' $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!--
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
document.getElementById("upshrinkTemp").src = "'
$scripturl'?action=jsoption;var=collapse_header;val=" + (mode ? 1 : 0) + ";sesc='$context['session_id'], ';" + (new Date().getTime());';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

current_header = mode;
}
// --></script>
</head>
<body>'
;

// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
echo '
<div id="headerarea" style="padding: 12px 30px 4px 30px;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">';

// The logo and the three info boxes.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="position: relative;">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">'
;

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '
<img src="'
$settings['images_url'], '/smflogo.gif" width="250" style="float: right;" alt="" />
<span style="font-family: Georgia, sans-serif; font-size: xx-large;">'
$context['forum_name'], '</span>';

echo '
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top">
<div class="headertitles" style="margin-right: 5px; position: relative;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="position: relative; margin-right: 5px; background-image: url('
$settings['images_url'], '/box_bg.gif);">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/userinfo.gif" style="position: absolute; left: '$context['browser']['is_ie5'] || $context['browser']['is_ie4'] ? '0' '-1px''; top: -16px; clear: both;" alt="" />
<table width="99%" cellpadding="0" cellspacing="5" border="0"><tr>'
;

if (!empty($context['user']['avatar']))
echo '<td valign="middle">'$context['user']['avatar']['image'], '</td>';

echo '<td width="100%" valign="top" class="smalltext" style="font-family: verdana, arial, sans-serif;">';

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
'
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', '$txt[152], ' <a href="'$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'];
echo '.';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>'
$txt[616], '</b>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=regcenter">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'];

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
<br />'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'];
}

echo '<br />
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a><br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />
'
$context['current_time'];
}
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
'
$txt['welcome_guest'], '<br />
'
$context['current_time'], '<br />

<form action="'
$scripturl'?action=login2" method="post" style="margin: 3px 1ex 1px 0; text-align:right;">
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="302400">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
'
$txt['smf52'], '
</form>'
;
}

echo '
</td></tr></table>
</div>

<form action="'
$scripturl'?action=search2" method="post" style="margin: 0; margin-top: 7px;">
<b>'
$txt[182], ': </b><input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 8ex;" />&nbsp;
<a href="'
$scripturl'?action=search;advanced">'$txt['smf298'], '</a>
<input type="hidden" name="advanced" value="0" />'
;

// If we're on a certain board, limit it to this board ;).
if (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>

</td>
<td width="262" style="padding-left: 5px;" valign="top">'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<div class="headertitles" style="width: 260px;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url('
$settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">'
$context['random_news_line'], '</div>
</div>'
;

// The "key stats" box.
echo '
<div class="headertitles" style="width: 260px;"><img src="'
$settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url('
$settings['images_url'], '/box_bg.gif);">
<img src="'
$settings['images_url'], '/'$context['user']['language'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 35px; padding: 5px;" class="smalltext">
<b>'
$modSettings['totalMessages'], '</b> '$txt[95], ' '$txt['smf88'], ' <b>'$modSettings['totalTopics'], '</b> '$txt[64], ' '$txt[525], ' <b>'$modSettings['memberCount'], '</b> '$txt[19], '<br />
'
$txt[656], ': <b> <a href="'$scripturl'?action=profile;u='$modSettings['latestMember'], '">'$modSettings['latestRealName'], '</a></b>
</div>
</div>'
;

echo '
</td>
</tr>
</table>

<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTemp" src="'$settings['images_url'], '/blank.gif" alt="" style="margin-right: 2ex;" />';

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</div>'
;

// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '</td>
</tr></table>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!--
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// --></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="right">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), '
</td>
<td width="28%" valign="middle" align="left">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" border="0" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

echo '
</div>'
;

// This is an interesting bug in Internet Explorer AND Safari.  Rather annoying, it makes overflows just not tall enough.
if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'] || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!--'
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
else
{
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
window_oldOnload();
}'
;
}

echo '
// --></script>'
;
}

echo '
</body>
</html>'
;
}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav"'$settings['linktree_inline'] ? ' style="font-size: smaller;"' '''>';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num 0)
echo str_repeat('<img src="' $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />'$link_num 1), '<img src="' $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
echo '<img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' '<br />';
}

echo '</span>';
}

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

// Show the [home] and [help] buttons.
echo '
<a href="'
$scripturl'">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/home.gif" alt="' $txt[103] . '" style="margin: 2px 0;" border="0" />' $txt[103]), '</a>'$context['menu_separator'], '
<a href="'
$scripturl'?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/help.gif" alt="' $txt[119] . '" style="margin: 2px 0;" border="0" />' $txt[119]), '</a>'$context['menu_separator'];

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="'
$scripturl'?action=search">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/search.gif" alt="' $txt[182] . '" style="margin: 2px 0;" border="0" />' $txt[182]), '</a>'$context['menu_separator'];

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="'
$scripturl'?action=admin">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/admin.gif" alt="' $txt[2] . '" style="margin: 2px 0;" border="0" />' $txt[2]), '</a>'$context['menu_separator'];

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="'
$scripturl'?action=profile">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/profile.gif" alt="' $txt[79] . '" style="margin: 2px 0;" border="0" />' $txt[467]), '</a>'$context['menu_separator'];

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="'
$scripturl'?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/calendar.gif" alt="' $txt['calendar24'] . '" style="margin: 2px 0;" border="0" />' $txt['calendar24']), '</a>'$context['menu_separator'];

// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="'
$scripturl'?action=login">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/login.gif" alt="' $txt[34] . '" style="margin: 2px 0;" border="0" />' $txt[34]), '</a>'$context['menu_separator'], '
<a href="'
$scripturl'?action=register">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/register.gif" alt="' $txt[97] . '" style="margin: 2px 0;" border="0" />' $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/logout.gif" alt="' $txt[108] . '" style="margin: 2px 0;" border="0" />' $txt[108]), '</a>';
}

?>

Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on October 31, 2006, 10:08:45 AM
Ok you are using the wrong tutorial.
http://www.simplemachines.org/community/index.php?topic=7854.msg75035#msg75035
Title: Re: How to add tabs to Core (NDT)?
Post by: darrencassar on October 31, 2006, 11:14:33 AM
Cheers,

your help was much appreciated :)

Darren
Title: Re: How to add tabs to Core (NDT)?
Post by: Amon777 on November 13, 2006, 12:02:09 AM
How do i simply rename 'home' tab to 'forum'?
Title: Re: How to add tabs to Core (NDT)?
Post by: TOOMUCH4MOST on November 21, 2006, 01:12:27 AM
Hi Jay,

I could use your assistance.  I am basically a newbie at this SMF stuff but I do read and research and have been successful thus far.  However, I am trying to add a live help feature to the forum and wanted to place it after the 'home' tab. I am using the default RC3 ... I followed the instructions and tried inserting a script into the href but it is not showing on the tab bar.  Here is the code, any ideas???

// Show the [Live Support] button...
      echo ($current_action == 'LiveSupport' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'Live Support' ? 'active_back' : 'back' , '">
               <a href="<script type="text/javascript" src="http://stackedconnectors.org/support/livehelp_js.php?department=1&amp;what=hidden&amp;pingtimes=15"></script></a>
            </td>' , $current_action == 'Live Support' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

Thanks for the help!
Title: Re: How to add tabs to Core (NDT)?
Post by: bloc on November 21, 2006, 06:15:19 PM
It won't work to actually insert a script into "href" of a link...it will break the html tag for the link for one thing. I suggest you add the <script> part elsewhere in the template and extract what info you need into a php variable for example. THEN use that variable as the actual href for the link. 
Title: Re: How to add tabs to Core (NDT)?
Post by: TOOMUCH4MOST on November 21, 2006, 08:37:45 PM
OK... that makes sense...however php is all new to me  :-[...would you like to show me exactly what do to and where??

Thanks!!
Title: Re: How to add tabs to Core (NDT)?
Post by: kissboy on November 22, 2006, 03:47:12 PM
Very good! Thank You !!! :D
Title: Re: How to add tabs to Core (NDT)?
Post by: nutellapr on November 23, 2006, 12:46:40 AM
This code either does not work or the instructions are not clear. Trying to follow this example to add a homepage link and it's not going very well.  :'(
Title: Re: How to add tabs to Core (NDT)?
Post by: chome on December 28, 2006, 09:25:57 PM
Hi,

I went through your tutorial but i think my template is quite different from you with different coding. Currently the  "Home" button in the forum is point to the forum home page. But now i want to add one more button beside the "Home", let's called it "Mainpage", and i want this button to link back to my homepage, eg, http://www.investors-exchange.com . How should i modify my template? Thanks.

<?php
// Version: 1.1; index

/* This template is, perhaps, the most important template in the theme.  It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below.  It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = false;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = false;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = false;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />', empty($context['robot_no_index']) ? '' '
<meta name="robots" content="noindex" />'
'
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";
// ]]></script>
<title>'
$context['page_title'], '</title>
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
</head>
<body>'
;

// The logo, user information, news, and menu.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%" class="tborder">
<tr style="background-color: #ffffff;">
<td valign="middle" align="left"><img src="'
, !empty($settings['header_logo_url']) ? $settings['header_logo_url'] : $settings['images_url'] . '/smflogo.gif''" alt="" /></td>
<td valign="middle">'
;

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
'
$txt['hello_member'], ' <b>'$context['user']['name'], '</b>'$context['allow_pm'] ? ', ' $txt[152] . ' <a href="' $scripturl '?action=pm">' $context['user']['messages'] . ' ' . ($context['user']['messages'] != $txt[153] : $txt[471]) . '</a>' $txt['newmessages4'] . ' ' $context['user']['unread_messages'] . ' ' . ($context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1']) : '''.';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<br />
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'];

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<br />
<b>'
$txt[616], '</b>';
}
// Otherwise they're a guest - so politely ask them to register or login.
else
echo '
'
$txt['welcome_guest'];

echo '
<br />'
$context['current_time'], '
</td>
</tr>
<tr class="windowbg2">
<td colspan="2" valign="middle" align="center" class="tborder" style="border-width: 1px 0 0 0; font-size: smaller;">'
;

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</td>
</tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<tr class="windowbg2">
<td colspan="2" height="24" class="tborder" style="border-width: 1px 0 0 0; padding-left: 1ex;">
<b>'
$txt[102], ':</b> '$context['random_news_line'], '
</td>
</tr>'
;

echo '
</table>

<br />
<table cellspacing="0" cellpadding="10" border="0" align="center" width="95%" class="tborder">
<tr><td valign="top" style="background-color: #ffffff;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '
</td></tr>
</table>'
;

// Show a vB style login for quick login?
if ($context['show_quick_login'])
{
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="95%">
<tr><td nowrap="nowrap" align="right">
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''><br />
<input type="text" name="user" size="7" />
<input type="password" name="passwrd" size="7" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="43200">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
'
$txt['smf52'], '
<input type="hidden" name="hash_passwrd" value="" />
</form>
</td></tr>
</table>'
;
}

// Don't show a login box, just a break.
else
echo '
<br />'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright.  Remember, the copyright must be somewhere!
echo '
<br />

<table cellspacing="0" cellpadding="3" border="0" align="center" width="95%" class="tborder">
<tr style="background-color: #ffffff;">
<td width="28%" valign="middle" align="right">
<a href="http://www.mysql.com/" target="_blank"><img src="'
$settings['images_url'], '/mysql.gif" alt="'$txt['powered_by_mysql'], '" width="88" height="31" border="0" /></a>
<a href="http://www.php.net/" target="_blank"><img src="'
$settings['images_url'], '/php.gif" alt="'$txt['powered_by_php'], '" width="88" height="31" border="0" /></a>
</td>
<td width="44%" valign="middle" align="center">
'
theme_copyright(), '
</td>
<td width="28%" valign="middle" align="left">
<a href="http://validator.w3.org/check/referer" target="_blank"><img src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="88" height="31" border="0" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="88" height="31" border="0" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<div align="center" class="smalltext">
'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '
</div>'
;

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>';

// And then we're done!
echo '
</body>
</html>'
;
}

// Show a linktree.  This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav"'$settings['linktree_inline'] ? ' style="font-size: smaller;"' '''>';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show the | | |-[] Folders.
if (!$settings['linktree_inline'])
{
if ($link_num 0)
echo str_repeat('<img src="' $settings['images_url'] . '/icons/linktree_main.gif" alt="| " border="0" />'$link_num 1), '<img src="' $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" />';
echo '<img src="' $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo $settings['linktree_inline'] ? ' &nbsp;|&nbsp; ' '<br />';
}

echo '</span>';
}

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

// Show the [home] and [help] buttons.
echo '
<a href="'
$scripturl'">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/home.gif" alt="' $txt[103] . '" border="0" />' $txt[103]), '</a>'$context['menu_separator'], '

<a href="'
$scripturl'?action=help">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/help.gif" alt="' $txt[119] . '" border="0" />' $txt[119]), '</a>'$context['menu_separator'];

// How about the [search] button?
if ($context['allow_search'])
echo '
<a href="'
$scripturl'?action=search">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/search.gif" alt="' $txt[182] . '" border="0" />' $txt[182]), '</a>'$context['menu_separator'];

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<a href="'
$scripturl'?action=admin">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/admin.gif" alt="' $txt[2] . '" border="0" />' $txt[2]), '</a>'$context['menu_separator'];

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<a href="'
$scripturl'?action=profile">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/profile.gif" alt="' $txt[79] . '" border="0" />' $txt[467]), '</a>'$context['menu_separator'];

// The [calendar]!
if ($context['allow_calendar'])
echo '
<a href="'
$scripturl'?action=calendar">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/calendar.gif" alt="' $txt['calendar24'] . '" border="0" />' $txt['calendar24']), '</a>'$context['menu_separator'];

// If the user is a guest, show [login] and [register] buttons.
if ($context['user']['is_guest'])
{
echo '
<a href="'
$scripturl'?action=login">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/login.gif" alt="' $txt[34] . '" border="0" />' $txt[34]), '</a>'$context['menu_separator'], '
<a href="'
$scripturl'?action=register">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/register.gif" alt="' $txt[97] . '" border="0" />' $txt[97]), '</a>';
}
// Otherwise, they might want to [logout]...
else
echo '
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' $context['user']['language'] . '/logout.gif" alt="' $txt[108] . '" border="0" />' $txt[108]), '</a>';
}

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

if (empty($button_strip))
return '';

// 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'] : '') . '>' . ($settings['use_image_buttons'] ? '<img src="' $settings['images_url'] . '/' . ($value['lang'] ? $context['user']['language'] . '/' '') . $value['image'] . '" alt="' $txt[$value['text']] . '" border="0" />' $txt[$value['text']]) . '</a>';

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

echo '
<td '
$custom_td'>'implode($context['menu_separator'], $button_strip) , '</td>';
}

?>

Title: Re: How to add tabs to Core (NDT)?
Post by: ianus on January 04, 2007, 03:11:17 PM
Greetings!

Themes/Your Theme/index.template.php
Find:
/ Show the [home] and [help] buttons.
echo '
<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
<a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];


Add:
// How about the [Mainpage] button?

echo '
<a href="http://www.yourdomain.xyz">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/Your_Own_Mainpage.gif" alt="' . $txt[Your Text] . '" border="0" />' : $txt[Your Text]), '</a>', $context['menu_separator'];


Step two, which makes $txt[Your Text] working

Themes/Your Theme/Languages/Modifications.Your language.php
Search:
?>
Add before:
$txt[Your Text] = 'Insert Your Text here';

Btw.: This is the wrong thread.
Look at Adding a Chat Button? (http://www.simplemachines.org/community/index.php?topic=7854.0)
Title: Re: How to add tabs to Core (NDT)?
Post by: mdrcracing on January 08, 2007, 04:02:19 AM
I've been looking ans asking here and there.. I think this is my best place to ask.

I've been doing good so far, but now I've ran into a problem.

1st... I'm redoing my whole menu system.. I'm going off the core theme and editing to how I need.  In my menu, it wont have the bg color, or boarders.. Just plain text.  If thats the case do I have to have all 3 lines in the code? 

Now, my biggest question, I just happen to find the techinally name for it.  But I want to make a Slide menu system.  Is it even possible?

Here's what I'm attempting to do.

I made a new link/button called Features 

but now, I want that to be a slide menu with either a OnMouseOver or OnClick that will slide its menu which would contain say...  Calander, Chat, Gallery and other links.


For those that don't understand what I'm trying to do, here is an example site I found, but its all in JS

http://www.chipchapin.com/WebTools/MenuTools/coolmenus/menu3.html

The Horizonal Menu is what I'm looking for.

That way I can group like functions in certain groups(features as above) then I also want to make a "My Account" link that has a slide menu with there profile, pm's etc

Any help would be much appreciated..


Title: Re: How to add tabs to Core (NDT)?
Post by: tapirul on January 13, 2007, 07:19:47 PM
Hello

I am using Cityscape theme, and the index.template.php seems to be different. I want to add more tabs to the menu (pointing to various addresses), and I need some help. See below the portion of index.template.php related to menu.
Thanks!


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

// add buttons here
$context['menubox'] = array();

/*
'title' - the string the link will have
'link' - the actual link
'chosen' - which "current_action" this button belongs to.
'memberonly' - show it JUST for members
'guestonly' - show it JUST for guests
'permission' - any permission you want to check before displaying the button

*/

// home button
$context['menubox'][]=array(
'title' => $txt[103],
'link' => $scripturl,
'chosen' => '',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// forum button
$context['menubox'][]=array(
'title' => $txt['tp-forum'],
'link' => $scripturl.'?action=forum',
'chosen' => 'forum',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// help button
$context['menubox'][]=array(
'title' => $txt[119],
'link' => $scripturl.'?action=help',
'chosen' => 'help',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);


// search button
$context['menubox'][]=array(
'title' => $txt[182],
'link' => $scripturl.'?action=search',
'chosen' => 'search',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// admin button.This one have permission check for admin as well
$context['menubox'][]=array(
'title' => $txt[2],
'link' => $scripturl.'?action=admin',
'chosen' => 'admin',
'memberonly' => false,
'guestonly' => false,
'permission' => 'allow_admin',
);

// profile button
$context['menubox'][]=array(
'title' => $txt[79],
'link' => $scripturl.'?action=profile',
'chosen' => 'profile',
'memberonly' => false,
'guestonly' => false,
'permission' => 'allow_edit_profile',
);

// PM button
$context['menubox'][]=array(
'title' => $txt['pm_short'] . ' '. ($context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : ''),
'link' => $scripturl.'?action=pm',
'chosen' => 'pm',
'memberonly' => true,
'guestonly' => false,
'permission' => 'allow_pm',
);

// calendar button
$context['menubox'][]=array(
'title' => $txt['calendar24'],
'link' => $scripturl.'?action=calendar',
'chosen' => 'calendar',
'memberonly' => false,
'guestonly' => false,
'permission' => 'allow_calendar',
);

// members
$context['menubox'][]=array(
'title' => $txt[331],
'link' => $scripturl.'?action=mlist',
'chosen' => 'mlist',
'memberonly' => false,
'guestonly' => false,
'permission' => 'allow_memberlist',
);

// login button - just for guests
$context['menubox'][]=array(
'title' => $txt[34],
'link' => $scripturl.'?action=login',
'chosen' => 'login',
'memberonly' => false,
'guestonly' => true,
'permission' => '',
);

// register button - just for guests
$context['menubox'][]=array(
'title' => $txt[97],
'link' => $scripturl.'?action=register',
'chosen' => 'register',
'memberonly' => false,
'guestonly' => true,
'permission' => '',
);

// logout button - just for members
$context['menubox'][]=array(
'title' => $txt[108],
'link' => $scripturl.'?action=logout;sesc='. $context['session_id'],
'chosen' => 'logout',
'memberonly' => true,
'guestonly' => false,
'permission' => '',
);

// now render it
template_menu_render();
}

// the actual rendering "machine" of the menu
function template_menu_render()
{
global $context, $settings, $options, $scripturl, $txt;

if (isset($_GET['board']) || isset($_GET['topic']))
$context['current_action'] = 'forum';
echo '
<ul id="menubox">';

foreach($context['menubox'] as $button){
$show_button=false;
// are we logged in?
if($context['user']['is_logged'])
if($button['guestonly'])
$show_button = false;
else
$show_button = true;
// just a guest then...
else
{
if($button['memberonly'])
$show_button = false;
elseif($button['guestonly'] && !$button['memberonly'])
$show_button = true;
elseif(!$button['memberonly'])
$show_button = true;
}
// can we show the button?
         if($show_button)
         {
if(!empty($button['permission']) && $context[$button['permission']])
echo '<li ', $context['current_action'] == $button['chosen'] ? 'id="chosen"' : '' , '><a href="' , $button['link'] , '">' , $button['title'] , '</a></li>';
elseif(empty($button['permission']))
echo '<li ', $context['current_action'] == $button['chosen'] ? 'id="chosen"' : '' , '><a href="' , $button['link'] , '">' , $button['title'] , '</a></li>';
}
}

echo '<li><a name="sizecontrols"> | </a></li>
<li><a href="javascript:ts(\'body\',1)">a+</a></li>
<li><a href="javascript:ts(\'body\',-1)">a-</a></li>
<li><a href="javascript:tsreset(\'body\')">[a]</a></li>';

if($context['show_widths'])
echo '<li style="background: #000;">
<form action="', $scripturl,  !empty($_SERVER['QUERY_STRING']) ? '?'.$_SERVER['QUERY_STRING'] : '' ,'" style="margin: 0;padding: 4px;" method="post">
<input style="vertical-align: top; padding: 0; margin: 0; background: #000; border: 0; color: #fff; " type="submit" onmouseover="pointer: hand;" value="800px" name="options[mywidth]" />
<input style="vertical-align: top; padding: 0; margin: 0; background: #000;  border: 0; color: #fff; " type="submit" value="96%" name="options[mywidth]" />
<input style="vertical-align: top; padding: 0; margin: 0;  background: #000; border: 0; color: #fff; " type="submit" value="90%" name="options[mywidth]" />
</form>
</li>
';

echo '
</ul>';

}

Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on January 14, 2007, 12:00:23 AM
Just add another item to the $context['menubox'] array.
Title: Re: How to add tabs to Core (NDT)?
Post by: hoss021 on January 16, 2007, 03:06:23 PM
Hey everyone I have a problem I have the tab added to my default menu, but no results, the tab highlights, and you can click on it, but in the URL it stated the ../forum/action=gallery but here is the codes I'm using?

index.template.php

('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'gallery', 'forum', 'tpadmin')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

                if ($context['current_action'] == 'gallery')
                                $current_action = 'gallery';

&

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

and the other files are the Gallery php files, gallery.php & gallery.template.php

my album is linked to http://www.strictlyscionized.com/forum/cpg1410/

any ideas or help is greatly appreciated
Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on January 16, 2007, 05:03:17 PM
If I understand you correctly you want it to link to http://www.strictlyscionized.com/forum/cpg1410/.

To do this change:

<a href="', $scripturl, '?action=gallery">Gallery</a>


To:

<a href="http://www.strictlyscionized.com/forum/cpg1410/">Gallery</a>
Title: Re: How to add tabs to Core (NDT)?
Post by: mdrcracing on January 16, 2007, 05:15:13 PM
Quote from: hoss021 on January 16, 2007, 03:06:23 PM
Hey everyone I have a problem I have the tab added to my default menu, but no results, the tab highlights, and you can click on it, but in the URL it stated the ../forum/action=gallery but here is the codes I'm using?

index.template.php

('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'gallery', 'forum', 'tpadmin')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

                if ($context['current_action'] == 'gallery')
                                $current_action = 'gallery';

&

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

and the other files are the Gallery php files, gallery.php & gallery.template.php

my album is linked to http://www.strictlyscionized.com/forum/cpg1410/

any ideas or help is greatly appreciated

Since your using cpg same here, this is the code i use



// Show the [Gallery] button.


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


just change the ../gallery/ to cpg1410/
Title: Re: How to add tabs to Core (NDT)?
Post by: hoss021 on January 16, 2007, 11:39:26 PM
Quote from: akabugeyes on January 16, 2007, 05:03:17 PM
If I understand you correctly you want it to link to http://www.strictlyscionized.com/forum/cpg1410/.

To do this change:

<a href="', $scripturl, '?action=gallery">Gallery</a>


To:

<a href="http://www.strictlyscionized.com/forum/cpg1410/">Gallery</a>


I would agree with you, but the gallery.php and the gallery.template.php is linked in the smf as an iframe, is it still used as a regular href code or ?
Title: Re: How to add tabs to Core (NDT)?
Post by: hoss021 on January 17, 2007, 12:05:11 AM
if you want to see my comparison here are both of my websites....
this site I'm using, that I'm working on right now is http://ww.strictlyscionized.com/forum/

the other site I have, Enables the gallery to be used in an Iframe on sfm 1.1rc3, cpg 1408 I believe.... and that site is: http://www.ground-zerocc.com/forum/ is it possible to use the gallery tab in the scion site similar to the ground zero site?
Title: Re: How to add tabs to Core (NDT)?
Post by: Zero Ziat on January 17, 2007, 01:27:48 AM
SMF Version: 1.1.1
Okay, seems a moron like me can't do this.

I want to add a "Shop" button to the NavBar. (Theme: Aa New Damage)
I tried every other stuff I could.

Please, I request gracefully that you finish my pain.

Thanks in advanced, Zero

(lol dramatical)

By the way: http://ss13s.fakefall.com/forums is the website.

HELP ME PLEASE!
Title: Re: How to add tabs to Core (NDT)?
Post by: cheesenub on January 18, 2007, 01:48:15 PM
I'm trying to change the current home link to say "forum" and then add a new home link that goes to the main part of my website with the default 1.1.1 SMF theme.

I've basically taken the code for the home link and switched it to forum, but when I try to make a home link, it still links to the forum.

I'll keep searching in this thread, but it seems I've done everything right. A little help please!

// Work out where we currently are.
$current_action = 'forum';
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', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'chat', 'homepage')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';

if ($context['current_action'] == 'homepage')
$current_action = 'homepage';

if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Begin SMFShop code
if ($context['current_action'] == 'shop')
$current_action = 'shop';
if (in_array($context['current_action'], array('shop_general', 'shop_items_add', 'shop_items_edit', 'shop_cat', 'shop_inventory', 'shop_restock', 'shop_usergroup')))
$current_action = 'admin';
// End SMFShop code

// 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 '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

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

// Show the [forum] button.
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, '">' , $txt[100] , '</a>
</td>' , $current_action == 'forum' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: Zero Ziat on January 18, 2007, 02:43:37 PM
No one is helping, it is totally inutile. :(
Title: Re: How to add tabs to Core (NDT)?
Post by: hoss021 on January 18, 2007, 03:58:40 PM
cheesenub 

I think there is a command that you can use to selet the style or theme when you select the link...
kinda like how tiny portal allows you to swtch themes with a click, but I don't know the coding, cause I'm a still a noob on this...

and I agree with you zero,
but I don't know what everyone is doing, cause this is a busy forum as well....
Title: Re: How to add tabs to Core (NDT)?
Post by: cheesenub on January 18, 2007, 04:54:30 PM
Quote from: hoss021 on January 18, 2007, 03:58:40 PM
cheesenub 

I think there is a command that you can use to selet the style or theme when you select the link...
kinda like how tiny portal allows you to swtch themes with a click, but I don't know the coding, cause I'm a still a noob on this...

and I agree with you zero,
but I don't know what everyone is doing, cause this is a busy forum as well....

What does the command have to do with adding a Homepage link button?
Title: Re: How to add tabs to Core (NDT)?
Post by: Daniel15 on January 19, 2007, 05:31:51 AM
cheesenub, the Themes/default/index.template.php file is only for the default theme. Make sure you're editing the file corresponding to the theme you're using.

QuoteI want to add a "Shop" button to the NavBar. (Theme: Aa New Damage)
I tried every other stuff I could.

Please, I request gracefully that you finish my pain.
Please see http://www.daniel15.com/forum/index.php/topic,223.0.html :)
Title: Re: How to add tabs to Core (NDT)?
Post by: cheesenub on January 19, 2007, 12:05:06 PM
I've gotten the links to show up but the links don't go to the right place.

See here:
http://www.floodplane.net/floodboard

I switched the Home button to Forum, but the new Home link should go to the main part of the site, and then the Gallery button should go to http://www.floodplane.net/cpg.

I'm not the best at php or html, so detailed help would be appreciated.

The theme I'm using is Leviathan. I posted on the thread for that theme, but got pointed to this one.

Here's the code I have for Leviathan's index.template.php:

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

// add buttons here
$context['menubox'] = array();

/*
'title' - the string the link will have
'link' - the actual link
'chosen' - which "current_action" this button belongs to.
'memberonly' - show it JUST for members
'guestonly' - show it JUST for guests
'permission' - any permission you want to check before displaying the button

*/

// home button
$context['menubox'][]=array(
'title' => $txt[103],
'link' => $scripturl,
'chosen' => 'homepage',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// forum button
$context['menubox'][]=array(
'title' => $txt[100],
'link' => $scripturl,
'chosen' => '',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// profile button
$context['menubox'][]=array(
'title' => $txt[79],
'link' => $scripturl.'?action=profile',
'chosen' => 'profile',
'memberonly' => false,
'guestonly' => false,
'permission' => 'allow_edit_profile',
);

// PM button
$context['menubox'][]=array(
'title' => $txt['pm_short'] . ' '. ($context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : ''),
'link' => $scripturl.'?action=pm',
'chosen' => 'pm',
'memberonly' => true,
'guestonly' => false,
'permission' => 'allow_pm',
);

// calendar button
$context['menubox'][]=array(
'title' => $txt['calendar24'],
'link' => $scripturl.'?action=calendar',
'chosen' => 'calendar',
'memberonly' => false,
'guestonly' => false,
'permission' => 'allow_calendar',
);

// shop button
$context['menubox'][]=array(
'title' => $txt['shop'],
'link' => $scripturl.'?action=shop',
'chosen' => 'shop',
'memberonly' => true,
'guestonly' => false,
'permission' => '',
);

// gallery button
$context['menubox'][]=array(
'title' => $txt['gallery'],
'link' => $scripturl.'?action=gallery',
'chosen' => 'gallery',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);


// member button
$context['menubox'][]=array(
'title' => $txt[331],
'link' => $scripturl.'?action=mlist',
'chosen' => 'mlist',
'memberonly' => false,
'guestonly' => false,
'permission' => 'allow_memberlist',
);

// search button
$context['menubox'][]=array(
'title' => $txt[182],
'link' => $scripturl.'?action=search',
'chosen' => 'search',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// admin button.This one have permission check for admin as well
$context['menubox'][]=array(
'title' => $txt[2],
'link' => $scripturl.'?action=admin',
'chosen' => 'admin',
'memberonly' => false,
'guestonly' => false,
'permission' => 'allow_admin',
);

// help button
$context['menubox'][]=array(
'title' => $txt[119],
'link' => $scripturl.'?action=help',
'chosen' => 'help',
'memberonly' => false,
'guestonly' => false,
'permission' => '',
);

// login button - just for guests
$context['menubox'][]=array(
'title' => $txt[34],
'link' => $scripturl.'?action=login',
'chosen' => 'login',
'memberonly' => false,
'guestonly' => true,
'permission' => '',
);

// register button - just for guests
$context['menubox'][]=array(
'title' => $txt[97],
'link' => $scripturl.'?action=register',
'chosen' => 'register',
'memberonly' => false,
'guestonly' => true,
'permission' => '',
);

// logout button - just for members
$context['menubox'][]=array(
'title' => $txt[108],
'link' => $scripturl.'?action=logout;sesc='. $context['session_id'],
'chosen' => 'logout',
'memberonly' => true,
'guestonly' => false,
'permission' => '',
);

// now render it
template_menu_render();
}
Title: Re: How to add tabs to Core (NDT)?
Post by: cheesenub on January 19, 2007, 02:38:20 PM
I figured it out.

I seemed to have made it harder than it seemed.

When setting up my shop, I must have figured a lot of stuff differently and forgot that scripturl and actions weren't needed.

Anyway, just put in a hard link on the 'link' lines and that did the trick.
Title: Re: How to add tabs to Core (NDT)?
Post by: hoss021 on January 20, 2007, 08:13:46 PM
Aight I fixed my problem DUE to a space in the code I was unable to view the form my error was at the current_action ==  'gallery' no spaces there... so just an fyi now that I feel dumb.... and it works on SMF 1.1.1
Title: Re: How to add tabs to Core (NDT)?
Post by: lindaf on January 24, 2007, 07:36:12 PM
Quote from: JayBachatero on December 31, 2005, 04:21:57 PM

2. In the same file

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



hey for us dummies... when it says code like the above example with no instructions afterwards (ie find,etc) Do you just mean to add that code to the file?  Add it anywhere?

Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on January 25, 2007, 11:20:23 AM
It's just an example of the home button as explained directly above it:

QuoteThe next step is adding the link itself.  This is an example of the home menu.

In any case what you can do is copy the code for the home button and edit the copied version of it to suit your needs.
Title: Re: How to add tabs to Core (NDT)?
Post by: Daniel15 on January 25, 2007, 10:57:46 PM
QuoteDo you just mean to add that code to the file?
You add it wherever you'd like the button to appear. For example, if you want it to appear before the "Forum" button, you'd search for the forum button, and add the code on top of it. If you want it to appear next to the Calendar (as I do for SMFShop), you'd paste it below the calendar button.
Does this help you? :)
Title: Re: How to add tabs to Core (NDT)?
Post by: maxanto on January 30, 2007, 08:09:03 AM
Menu Button Seperator question... ok I cant believe I am gonna say this but Jay's code for the outside link menu add on button looks nearly perfectly in IE6 its juust missing the seperator inbetween my calendar and the new killboard burtton, but when youlook at it in Firefox it shows the link above the menu and distors the rest of the menu that follows it. Can I get a slight change to the following code that will prevent this? Here is the naughty link that does not work well n firefox:


   // Show the [killboard] button
            echo ($current_action == 'killboard') ? '<td class="maintab_active_' . $first .    '">&nbsp;</td>' : '' , '
   <td valign="top" class="maintab_' , $current_action == 'killboard' ? 'active_back' : 'back' , '"><a href="http://starlightindustries.org/killboard">Killboard</a></td>' , $current_action == 'killboard' ? '<td class="maintab_active_' . $last .'">&nbsp;</td>' : '';

And here is a link to my website:

http://starlightindustries.org/smf

Open it in IE and firefox and you will see what I mean. I think I only need to add the seperator in to fix this problem? But I dont see it from comparing the other entries to that one, they are so different they comnfuse me.

BTW Jay - I still think you are a god among men =)
Title: Re: How to add tabs to Core (NDT)?
Post by: maxanto on January 30, 2007, 08:15:14 AM
oh dear god i actually figured it out on my own.. and here is the scarey part I only got 3.5 hours of sleep last night. Here is what I did:

// Show the [killboard] button
            echo ($current_action == 'killboard') ? '<td class="maintab_active_' . $first .    

'">&nbsp;</td>' : '' , '
   <td valign="top" class="maintab_' , $current_action == 'killboard' ? 'active_back' : 'back'

, '"><li><a href="http://starlightindustries.org/killboard">Killboard</a></li></td>' ,

$current_action == 'killboard' ? '<td class="maintab_active_' . $last .'">&nbsp;</td>' : '';

all I had to do was add the <li> and </li>'s to it properly, so I am guessing thats the code for a sperater =) NM my noob question see Jay I can learn after all!
Title: Re: How to add tabs to Core (NDT)?
Post by: Dr.WhO on February 13, 2007, 12:46:38 PM
iv added two tabs on the template

but see what happened !!  :'(

i think i have done it wrong

(http://ksums.com/forum/uploads/219/1171388706.jpg)

http://101med.com/index.php?option=com_smf&Itemid=41 (http://101med.com/index.php?option=com_smf&Itemid=41)

what shall i do  ???


Thank U  ;)
Title: Re: How to add tabs to Core (NDT)?
Post by: MinasC on February 23, 2007, 01:47:27 PM
i added a tab named "games" , it went alright , but it gets me nowhere (returns to the same page i was) !!! other than the code changes to index.template.php i haven't done anything else (such as create a "game" script) , should i ?

and what if i want the new tab to link to a new page that doesn't belong to my forum's structure (e.g. create a "google" tab to link to google by opening a new page) ? what changes do i have to do then ?

thnx a lot !!!
Title: Re: How to add tabs to Core (NDT)?
Post by: Daniel15 on February 23, 2007, 07:00:23 PM
Quote from: Dr.WhO on February 13, 2007, 12:46:38 PM
iv added two tabs on the template

but see what happened !!  :'(

i think i have done it wrong

(http://ksums.com/forum/uploads/219/1171388706.jpg)

http://101med.com/index.php?option=com_smf&Itemid=41 (http://101med.com/index.php?option=com_smf&Itemid=41)

what shall i do  ???


Thank U  ;)
Since you're using a custom theme, it's best to ask at the support topic for that theme ;)

Quote from: MinasC on February 23, 2007, 01:47:27 PM
i added a tab named "games" , it went alright , but it gets me nowhere (returns to the same page i was) !!! other than the code changes to index.template.php i haven't done anything else (such as create a "game" script) , should i ?
Where do you want it to go?

Quote
and what if i want the new tab to link to a new page that doesn't belong to my forum's structure (e.g. create a "google" tab to link to google by opening a new page) ? what changes do i have to do then ?
You'd need to change the link. The button itself looks like:

echo ($current_action == 'shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=shop">SMFShop</a>
</td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

On this button, the link looks like:
<a href="', $scripturl, '?action=shop">SMFShop</a>

The $scripturl is the full URL to your forum's index.php page (eg. http://www.daniel15.com/forum/index.php). To link to an external page, just change the link, and remove the $scripturl:

<a href="http://www.google.com">Google</a>

Title: Re: How to add tabs to Core (NDT)?
Post by: MinasC on February 23, 2007, 08:20:45 PM
as for the button linking to an external site ... thnx a lot , i'll try it tomorrow morning and tell you how it went !!!

as for the button linking to a page within my tp/smf forum ... that page coulb be showing e.g. a .swf (flash) file (i intend it to be my family tree in flash) !!! how do i make the button linking to that page called e.g. "family tree" , and how do i set up this page ?
Title: Re: How to add tabs to Core (NDT)?
Post by: MinasC on February 23, 2007, 08:38:07 PM
couldn't help myself trying it now , and it worked perfect !!! THNX MAN !!!

now i got the problem of too many buttons in my menu , so i was thinking , could it be that each button would act like a drop-down menu on mouse over , renealing multiple sub-options (sub-tabs , if i could say so) ?
Title: Re: How to add tabs to Core (NDT)?
Post by: wilcosky on March 22, 2007, 11:51:29 AM
where are the $txt[34] codes located at, in what file.  Because I know that I can add the name of the menu item manually in the template file, but, what if I want to edit the name of one of the menu items directly from wherever those $txt[some #] things are located...?

where are they, what file?

Thank You!
Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on March 22, 2007, 11:58:49 AM
these are in theme/default/langauges/index.english.php (assuming its english you looking for)

if its another language replace the english with that language
Title: Re: How to add tabs to Core (NDT)?
Post by: Gummo on March 26, 2007, 10:54:43 PM
Please help. I made a new tab at the start of the menu bar, but it highlights the 'Forum' tab (used to be home) instead, when you're on that page. How do I make it highlight the 'News' tab?
code used in news page:
<?php
// Import Header
template_main_above();
?>


code in index.template.php:
// 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', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'news')
$current_action = 'news';
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 '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

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

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

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


I sure hope you can help! The whole thing is held back because of this...:(
Title: Re: How to add tabs to Core (NDT)?
Post by: npereira on March 27, 2007, 08:50:56 AM
this is good, but how do you add a tab in the admin section under Features and Options?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gummo on March 27, 2007, 10:13:48 PM
I solved my own problem (again)! :D
It turned out to be really simple, even though it had plagued me for weeks!
I just had to put this at the start of my document:
<?php $context['current_action'] = 'news'?>
Title: Re: How to add tabs to Core (NDT)?
Post by: MinasC on March 28, 2007, 07:24:03 AM
i asked before but didn't get any answer so i ask again :

Quote from: MinasC on February 23, 2007, 08:38:07 PMcould it be that each button would act like a drop-down menu on mouse over , revealing multiple sub-options (sub-tabs , if i could say so) ?

thnx in advance !
Title: Re: How to add tabs to Core (NDT)?
Post by: wolfcry on April 19, 2007, 05:22:11 AM
I'm not sure where I'm going wrong. Did this in the past but now it wont work.&nbsp; Earlier today I was upgrading from 1.1 RC3 to 1.1.2 and upgraded TP from 97 to 98 and I ended up losing my arcade link and other custom links.

Now when I try adding the code below, nothing shows up. Not on the home page, member pages, nowhere...all help would be greatly appreciate to help me solve this problem.


if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'arcade', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))



$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($context['current_action'] == 'arcade')
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $current_action = 'arcade';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';





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



I'm not sure whats going on. But all help would be appreciated. Also, I have $txt[169] defined as Arcade in the template.english.php file.

This is getting frustrating lol

FYI: I am working on the Default theme.
Title: Re: How to add tabs to Core (NDT)?
Post by: wolfcry on April 19, 2007, 10:12:00 PM
I need help with this so I'm bumping it up....thanks all
Title: Re: How to add tabs to Core (NDT)?
Post by: wolfcry on April 20, 2007, 04:23:41 PM
Ok, I'm bumping this again.

It is the Arcade button I am trying to readd at this time.

so if anyone can look at the post I did 2 posts back I'm greatly appreciate it.
Title: Re: How to add tabs to Core (NDT)?
Post by: Head_Worx on April 21, 2007, 04:14:38 PM
hi guys, iam new on this and iam having a problem.

iam using the Zm theme, and i want to put an swf (flash) icon on the middle of the top bar between the news and the search. how can i put it?

thx m8's
Title: Re: How to add tabs to Core (NDT)?
Post by: Head_Worx on April 21, 2007, 04:31:54 PM
the main problem is that i cant see where do i have to put the code
Title: Re: How to add tabs to Core (NDT)?
Post by: wolfcry on April 23, 2007, 05:25:04 PM
Quote from: wolfcry on April 19, 2007, 05:22:11 AM
I'm not sure where I'm going wrong. Did this in the past but now it wont work.&nbsp; Earlier today I was upgrading from 1.1 RC3 to 1.1.2 and upgraded TP from 97 to 98 and I ended up losing my arcade link and other custom links.

Now when I try adding the code below, nothing shows up. Not on the home page, member pages, nowhere...all help would be greatly appreciate to help me solve this problem.


if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'arcade', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))



$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($context['current_action'] == 'arcade')
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $current_action = 'arcade';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';





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



I'm not sure whats going on. But all help would be appreciated. Also, I have $txt[169] defined as Arcade in the template.english.php file.

This is getting frustrating lol

FYI: I am working on the Default theme.

still need help. Thanks
Title: Re: How to add tabs to Core (NDT)?
Post by: wolfcry on April 25, 2007, 11:08:33 PM
bumping cause i still need help
Title: Re: How to add tabs to Core (NDT)?
Post by: wolfcry on April 29, 2007, 05:30:04 PM
hmmm....maybe I didnt ask the question right  or put it in a way that could be understood so I'm gonna try again (and keep trying) until someone actually takes the time to answer.

see the code in my posts regarding the code to create custom tabs?  Well, I need someone to LOOK over that code and tell me whats going wrong please.

No matter what I do, the buttons (tabs) do not show up.

Sorry, but I will keep bumping this up until I get an answer, otherwise, I'll create a new thread regarding the question at hand.

Thank you.


Title: Re: How to add tabs to Core (NDT)?
Post by: nuva on May 02, 2007, 10:50:52 AM
I don't get it, how do i use the link? if the action = chat nothing will happen...
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on May 02, 2007, 10:52:33 AM
You can change the "chat" to something else like "downloads" if you want.

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: nuva on May 02, 2007, 11:07:35 AM
I found out ;D
Title: Re: How to add tabs to Core (NDT)?
Post by: wolfcry on May 02, 2007, 02:38:44 PM
Well, no worries regarding my needing an answer...i found out what I was doing wrong. I was doing both steps in step 1...see..wasnt so hard huh? 

Really, I must be honest and say that I am VERY unpleased with the lack of support that was shown on this question especially regarding the time it was posted, the amounts of views it was receiving by both staff as well as others and since others got their questions answered.

If I may add, I would've been happy with just a typical forum support answer such as "Find out yourself" than being ignored.
Title: Re: How to add tabs to Core (NDT)?
Post by: Iomega0318 on May 11, 2007, 02:37:11 PM
I need a bit of help with making a drop down menu as well as adding in some code to the index.template.php, I need to add in some code to make my Home button look like this:
From this:
<a href="', $scripturl, '">' , $txt[103] , '</a>
To something like this:
<a href="http://www.dynamicdrive.com" onClick="return clickreturnvalue()"
onMouseover="dropdownmenu(this, event, 'anylinkmenu1')">Anchor Link</a>

When I try that I get a parse template error, All I did was add in onClick="return clickreturnvalue()" onMouseover="dropdownmenu(this, event, 'anylinkmenu1')" right where it was supposed to go, but it didn't work.. I also need to add this:
<div id="anylinkmenu1" class="anylinkcss">

<a href="http://www.dynamicdrive.com/">Dynamic Drive</a>
<a href="http://www.cssdrive.com">CSS Drive</a>
<a href="http://www.javascriptkit.com">JavaScript Kit</a>
<a href="http://www.codingforums.com">Coding Forums</a>
<a href="http://www.javascriptkit.com/jsref/">JavaScript Reference</a>

</div>

Into the index template somewhere, but wherever I try even without the edit to the link I get the same parse error, where do I add it or is there a way to call it from outside the template?
Title: Re: How to add tabs to Core (NDT)?
Post by: DealerISM on May 31, 2007, 12:23:00 PM
I want to add a link to my main site and I know it is answered here, but there's lot's of information missing for my particular level of understanding. Could someone specifically tell me, from start to finish how to add a link to an outside site? I want a link to the main site to be visible everywhere.

Thanks.
Title: Re: How to add tabs to Core (NDT)?
Post by: Smythe on June 02, 2007, 03:01:11 AM
ok call me a dummy now but i am a K.I.S.S. kinda guy .... lol could ya show me an example code for linking a tab to an outside site ... also i am wondering do i need a new .gif for the tab or will it generate one ???? i am using a template Aa_New_Damage and i ssse there are .gif pics for the tabs .... you can address the response to "Hey Dummy" lol thanks in advance.
Title: Re: How to add tabs to Core (NDT)?
Post by: Zarxrax on June 02, 2007, 10:32:52 PM
Ok, I'm stumped with this. I'm using tinyportal and I want to add a link to an article on my tab menu. I got it to shows up and works just fine, but when I click on it, the link doesn't become "selected". It will instead highlight the "home" link. How do I fix this?
Title: Re: How to add tabs to Core (NDT)?
Post by: bloc on June 05, 2007, 11:15:31 AM
You can't use that routine to check for a "page" or article..it only checks the "action=xxx" in the adress, not the "page=xxx". But tis quite possible to add that too. Depending on what you set as the "hook" - the name for th tab - it can be something like thsi, put AFTER all the others:


// check if a article is active
if(isset($_GET['page']) && $_GET['page']=='mypage')
   $current_action = 'mypage';


Then you just check if $current_action is "mypage" on the tab code. It can also be the ID number of the article, that depends on if you use the shortname for the article or not.
Title: Re: How to add tabs to Core (NDT)?
Post by: bloc on June 05, 2007, 11:19:18 AM
Quote from: Smythe on June 02, 2007, 03:01:11 AM
ok call me a dummy now but i am a K.I.S.S. kinda guy .... lol could ya show me an example code for linking a tab to an outside site ... also i am wondering do i need a new .gif for the tab or will it generate one ???? i am using a template Aa_New_Damage and i ssse there are .gif pics for the tabs .... you can address the response to "Hey Dummy" lol thanks in advance.

It will generate one - as long as you supply a text for it. :)

And no, the highlight tab won't work for outside link - you can't even see the menu when you follow that link. As long as its internal on the forum you can highlight just about for anything..but not offsite.
Title: Re: How to add tabs to Core (NDT)?
Post by: viper151 on June 16, 2007, 05:05:42 AM
i read all 15 pages and i made this one for my webpage

// Show the [Raid Planner] button...
      echo ($current_action == 'Raid Planner' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'agreement' ? 'active_back' : 'back' , '">
               <a href="http://doureiosippos.servegame.com/PHPraid">Raid Planner</a>
            </td>' , $current_action == 'Raid Planner' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

I didnt used step 1 as you were saying that for external links that wasnt necessary

But(there is always a problem :P )
All is ok except the stylesheet.The button came out like this
(http://img412.imageshack.us/img412/9536/clipboard05pj5.gif)
as you can see its not core theme but works fine but whats wrong here?
Theme is wow_Dk
Title: Re: How to add tabs to Core (NDT)?
Post by: HannibalCN on June 20, 2007, 04:54:09 PM
I looked through the topic to see if anyone had asked prior and it doesn't seem as though anyone has.

I'm trying to make the tab only show to specific groups but I'm having no luck.

Any ideas?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on June 21, 2007, 01:37:39 PM
Hannibal, you'll have to check for the additional groups. This should check for the group number 2 and display the button if they are in that group.

if (in_array(2, $user_info['groups']))
echo 'your button code here';

If you need to check for more than one group you can add an array to that. This will check for people in groups 1,2,5, and 7.

$mygroups = array(1, 2, 5, 7);
if (in_array($mygroups, $user_info['groups']))
echo 'your button code here';
Title: Re: How to add tabs to Core (NDT)?
Post by: HannibalCN on June 21, 2007, 10:41:26 PM
Is that code for a tab or a button?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on June 22, 2007, 01:40:43 AM
You can use it for both. It won't show the tab or the button depending on what you put it around. :)
Title: Re: How to add tabs to Core (NDT)?
Post by: viper151 on June 22, 2007, 08:33:01 AM
ichbin wat about my problem?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on June 22, 2007, 09:17:16 AM
Are you using the default code for the button in that theme? I don't have that theme so I can't check ATM. You should probably post for help in the help topic for that specific theme. Looks to me like your code won't work because of the fact that you don't have actions defined. You'll notice in the button that it says $current_action == 'agreement" or "Raid Planner". These actions have to be defined in your URL for it to work. For instance, you'll notice that when you're in the forum that it says in the URL action=forum. Well if it doesn't say action=agreement or action=Raid_Planner then its not going to work. 
Title: Re: How to add tabs to Core (NDT)?
Post by: tonzi on June 23, 2007, 10:43:43 AM
hello guys im trying put an url from the other site? how ima able t0 do this? i tried but  there somethings wrong with the url path

e.g
my site:www.tonzi.com
link site:www.myspace.com

it will turned out as

www.myspace.comhttp://www.tonzi.com/forum/index.php?action=myspace

i wanted to put the url myspace.com alone? pls help ^_^
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on June 23, 2007, 01:00:17 PM
If you post your code we can show you what to change.
Title: Re: How to add tabs to Core (NDT)?
Post by: tonzi on June 23, 2007, 08:36:16 PM
// Show the [myspace] button.
   echo ($current_action=='myspace' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'myspace' ? 'active_back' : 'back' , '">
               <a href="www.myspace.com', $scripturl, '?action=myspace">myspace</a>
            </td>' , $current_action == 'myspace' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on June 23, 2007, 08:50:43 PM
change www. myspace.com/' , $scripturl' , ?action=myspace to http://myspace.com/your-myspace-name-here

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: tonzi on June 23, 2007, 09:22:08 PM
thanks! haha i forgot that http thing in ahref  thank you very much
Title: Re: How to add tabs to Core (NDT)?
Post by: god_made_me_do_it on June 26, 2007, 06:10:41 PM
Sorry, look, I'm completely new to this, and I can't get that original tutorial to work at all, well, on new themes anyway - which there's no real support for, I just keep getting sent back to this thread by mods - I've basically been tearing my hair out for the past 2 days trying to get a simple 'gallery' button on my themes (PnPn and Musiconica mainly).

My problem arises here where the whole thing gets a bit vague if you're a newbie -

Quote2. In the same file

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



$current_action=='home' - is what sets the tab for the current actions.  As you can see it is defined in 3 instances.  You will need to change it for all three of them.
' , $txt[103] , ' - is the text string that 'Home'.  As you see the variable is insde ' , , '.  The reason for this is because it's inside an echo.  If you are going to hard code the name in the menu you do not need to put ' , , ' around it.

This is how it should look with the made changes.

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


If you want to be neat about it and add support for other languages add this string to /Themes/default/languages/index.english.php and to any other language file that you want to add it to.  ie. /Themes/default/languages/index.{language}.php and change Chat to the translated string.
$txt['chat'] = 'Chat';

I mean, am I supposed to modify this code so it says 'gallery' instead of 'home', or add the edited code underneath? Also -

Quote' , $txt[103] , ' - is the text string that 'Home'.

Dosen't make any grammatical sense, I haven't a clue what that bit's talking about, let alone whereabouts in the file that text string is that it's referring to, what relevance it has to what I'm trying to do or what - I just don't get it  :'( Please someone help then I can stop asking stupid questions and get on with sorting out my forum.
Title: Re: How to add tabs to Core (NDT)?
Post by: codenaught on June 30, 2007, 08:03:30 PM
Basically you would find the first bit of code it mentions with the "Show the [home] button." code. Then you copy the chat code given there underneath that.

At this point you can edit the attributes of the copied chat button code to suit your needs.

I color coded some of the code:

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

The blue you would change with the web address you want the link to take you to. The red is the text that will show up in the main menu.

Quote' , $txt[103] , ' - is the text string that 'Home'.
Should say is the text string that prints 'Home' on the main menu.
I fixed it on the one in the Online Manual. As for the one in this topic, I'm just leaving it there because I would rather not maintain both and there is a link to the updated version anyway. ;)
Title: Re: How to add tabs to Core (NDT)?
Post by: joh87swe on July 06, 2007, 07:53:05 AM
I follow these steps, the new button work but when I click on it, the button still be the same and it's the home button who change. (I use tiny portal). Anyone know why it's not working for me?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 06, 2007, 05:45:40 PM
What is the link? Does it have an action? For instance, the forum link has action=forum on the end of the URL. Does your link have an action?
Title: Re: How to add tabs to Core (NDT)?
Post by: joh87swe on July 07, 2007, 04:39:26 PM
I fixed it, it is an article.
Title: Re: How to add tabs to Core (NDT)?
Post by: Mannie_Fine on July 08, 2007, 09:45:21 AM
I am trying to add a link befor the home button.

but nothing changes, i have this now
// Show the [Start] button...
      echo ($current_action == 'start' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'start' ? 'active_back' : 'back' , '">
               <a href="http://www.jakobskruiskruid.com/index.html">Start</a>
            </td>' , $current_action == 'start' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 08, 2007, 01:28:59 PM
Does your site actually have a link that goes to action=start ???
Title: Re: How to add tabs to Core (NDT)?
Post by: redlightblack on July 29, 2007, 08:20:33 PM
Could someone here tell me where: $context['current_action'] is defined? Which file?

The reason I'd like to know is because I'd need to add something like: if (in_array($context['current_type'], array('featured', 'categories', 'recent')))
    $current_action = 'library';

to my index.template.php file, so that I can get the right tab to become active when using a non smf part of my site.
Title: Re: How to add tabs to Core (NDT)?
Post by: redlightblack on July 29, 2007, 08:35:46 PM
Never mind. I found it in Load.php, unless I'm wrong...
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 29, 2007, 11:52:33 PM
You don't need to add anything to load.php for that. If you already have the action built you can just add library to the current_action array in the index.template.
Title: Re: How to add tabs to Core (NDT)?
Post by: redlightblack on July 30, 2007, 12:00:24 AM
I did do that, but the other script also has several different actions such 'type' which shows in the url as: http://www.mysite.com/?type=categories

By defining type in Load.php the correct tab stays active when in that part of the site. This works with most of the others too. The only ones I haven't gotten just yet are the ones where the array would be numbers. I don't know how to add them with have to add each and every one, which is bad since there are over a thousand and they constantly increasing.
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 30, 2007, 12:21:03 AM
Assuming you're talking about this post. :)

http://www.simplemachines.org/community/index.php?topic=185539.new#new
Title: Re: How to add tabs to Core (NDT)?
Post by: redlightblack on July 30, 2007, 12:14:46 PM
Yup, that's the one...
Title: Re: How to add tabs to Core (NDT)?
Post by: Clarkey88 on September 02, 2007, 08:02:13 AM
EDIT: Never mind.
Title: Re: How to add tabs to Core (NDT)?
Post by: chovy on September 08, 2007, 04:22:49 AM
Its a shame that there isn't a standard file to inherit menus from easily.

I have 15 themes, and have to modify 30 files to add 2 links to the main navbar :(
Title: Re: How to add tabs to Core (NDT)?
Post by: Dragooon on September 08, 2007, 08:14:00 AM
There will be a better way
But 15 themes and 30 files? Are you sure you counted it correctly? :P
Title: Re: How to add tabs to Core (NDT)?
Post by: chovy on September 08, 2007, 10:54:38 AM
well, no - that was an exaggeration. it is more like 6 themes (and two files for each theme).
Title: Re: How to add tabs to Core (NDT)?
Post by: Dragooon on September 08, 2007, 11:07:57 AM
How can it be 2 files each theme? All you need to edit is Index.template.

And Yes I am being Sarcastic :P
Title: Text not found
Post by: britmovie on September 10, 2007, 09:54:53 PM
In the beta looking for

if ($context['current_action'] == 'search2')
      $current_action = 'search';

to add a button as in thread but cant find it in index.template.php?

is it in it or has it been changed?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on September 11, 2007, 04:33:54 AM
In 2.0 it got re-located to one of the source files, off the top of my head, I forget which one, I'd have to look into it for you when I get the chance later tonight.

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: tatore on September 11, 2007, 04:44:38 AM
Quote from: ALM on September 11, 2007, 04:33:54 AM
In 2.0 it got re-located to one of the source files, off the top of my head, I forget which one, I'd have to look into it for you when I get the chance later tonight.

-ALM
If I'm not wrong it's in Subs.php
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on September 16, 2007, 10:32:27 AM
damm lol i really need help :O

could someone point me to where i can find index.template ????

because i have looked and then ive searched for words but nothing pops up :O
Title: Re: How to add tabs to Core (NDT)?
Post by: tatore on September 16, 2007, 12:35:26 PM
Quote from: Murdoc_LaCN on September 16, 2007, 10:32:27 AM
damm lol i really need help :O

could someone point me to where i can find index.template ????

because i have looked and then ive searched for words but nothing pops up :O
what are you talking about?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on September 16, 2007, 12:47:08 PM
Themes/[THEMENAME]/index.template.php

:P

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on September 25, 2007, 01:30:17 PM
ok well my themes that im using is the standard SMF themes the Dark black and that doesn't have a template.php in it :S

but the default has lots of them in if anyone could point me here is the screenshot


(http://microgamers.co.za/Screenshots/ftp.jpg)
Title: Re: How to add tabs to Core (NDT)?
Post by: JayBachatero on September 25, 2007, 02:11:07 PM
Your theme must have an index.template.php file.  Sure you looking at the right directory?
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on September 25, 2007, 04:28:35 PM
ok well this is the default theme on my forums


(http://microgamers.co.za/Screenshots/ftp1.jpg)

this is the theme :D

http://www.simplemachines.org/community/index.php?topic=64128.msg443162#msg443162
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on September 25, 2007, 06:34:50 PM
They're variations on the default, thus don't use their own index.template.php, just copy the defaults copy into that directory, or edit the defaults copy (but I'd personally recommend the former).

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on September 27, 2007, 04:55:28 PM
hi thanks for that but can you still point to me which 1 must i Edit :D and i think i would like to keep it that was as we have 5 types of skins

so pretty plz could you point it out :O and what must i edit ... i really need your help
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on September 27, 2007, 05:03:47 PM
Regardless of how many themes you have, the file you edit will always be index.template.php. But in your case, some of those five themes might have their own copy of it so you'd need to edit all copies of index.template.php.

The first post explains what you need to do get your links working.

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: spacecabbage on September 29, 2007, 05:30:18 AM
Hello,

I administrate a forum for our World of Warcraft guild, and it uses SMF Gallery.  I have added a new tab called 'Characters' that links to a category within SMF Gallery.  I did this by copying and modifying the Gallery tab.

However, when a user clicks on the Characters tab the link works fine, but the Gallery tab highlights instead of the Characters tab.

Is there any way to get the Characters tab to highlight properly?

Here is the SMF Gallery code for the tab:

// Show the [gallery] button.
if ($context['allow_smfgallery_view'])
echo ($current_action=='gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
<td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'off_back' , '">
<a href="', $scripturl, '?action=gallery">' , $txt['smfgallery_menu'] , '</a>
</td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';


Here is the custom code for the Characters tab:

// Show the [characters] button.
if ($context['allow_smfgallery_view'])
echo ($current_action=='characters' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
<td valign="top" class="maintab_' , $current_action == 'characters' ? 'active_back' : 'off_back' , '">
<a href="', $scripturl, '?action=gallery;cat=5">' , $txt['characters'] , '</a>
</td>' , $current_action == 'characters' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';


Any help would be greatly appreciated :)
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on September 29, 2007, 12:05:44 PM
That's because SMF still thinks it's the Gallery since you have the action=gallery;cat=5.

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: guppy on September 30, 2007, 02:22:38 AM
spacecabbage,

Try modify step one of the tutorial:
http://www.simplemachines.org/community/index.php?topic=63203.msg437231#msg437231

with reference to this:
http://www.simplemachines.org/community/index.php?topic=63203.msg619619#msg619619
Title: Re: How to add tabs to Core (NDT)?
Post by: Green Beret on October 01, 2007, 05:00:58 PM
EDIT***

I cant seem to get certain things to work using SSI unless the www. is in the URL, why is this?
Title: Re: How to add tabs to Core (NDT)?
Post by: snowforum on October 21, 2007, 08:21:43 PM
Hello

Im a rookie to the net nevermind coding.  I want to add one tab which links to an outside site.  Ive read the topic all the way through but im still stuck!  Ive managed to complete the 1. first method  but i cannot find the code anywhere for step 2.
Nearest code to it is;
// Show the [home] button.
   echo '
         <td class="main-navigation"><a href="', $scripturl, '">' , $txt[103] , '</a></td>';

Which is obviously wrong!  My forum is snowforum.co.uk

Any help would be much appreciated!

Thanks 
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on October 21, 2007, 08:32:46 PM
Not all themes are the same, and to me it appears you are not using the default theme? $script = the base URL to your forum. So if your forum is snowforum.co.uk then the link you posted above would be translated to this.
<a href="http://snowforum.co.uk/index.php>Home</a>

If you want to point a link to somewhere else just change the code:
// Show the [home] button.
   echo '
         <td class="main-navigation"><a href="', $scripturl, '">' , $txt[103] , '</a></td>';


To something like this:
// Show the [Google] button.
   echo '
         <td class="main-navigation"><a href="http://www.google.com">Google</a></td>';
Title: Re: How to add tabs to Core (NDT)?
Post by: snowforum on October 21, 2007, 08:46:32 PM
Thanks for quick reply, ive done this and it worked.  My home tab is now the link for my outside site, i think i would prefer this to remain the forum home though.  Im still stuck on how to add an extra tab.
Thanks
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on October 22, 2007, 01:38:40 PM
Are you using the Core theme? Judging by the code you posted I'm thinking you are not.
Title: Re: How to add tabs to Core (NDT)?
Post by: snowforum on October 22, 2007, 08:26:38 PM
Im not even sure of whether im using the core theme sorry.

I think this may be it;  Theme Settings - SlickPro: Graphite
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on October 22, 2007, 09:22:41 PM
Well not having the theme download I would prefer that you seek help in the topic for that theme. Here's a link for you.
http://www.simplemachines.org/community/index.php?topic=108837.0
Title: Re: How to add tabs to Core (NDT)?
Post by: surge1007 on October 26, 2007, 12:03:40 PM
I found this tutorial and it seemed fairly easy as I am somewhat programmer literate.  However even after I made the changes nothing happened?  I uninstalled the gallery mod and reinstalled it.......with no luck.  Any Ideas about what I am doing wrong?

Thanks for any help you may be able to give me!
Surge
Title: Re: How to add tabs to Core (NDT)?
Post by: sasawawa on October 28, 2007, 02:18:11 PM
Hey, all, i just installed SMF links mod successfully.

Now i want to add a new tag " links " on my forum homepage.

I have an action "links".

I just added

if ($context['current_action'] == 'links')
$current_action = 'links';
after

if ($context['current_action'] == 'search2')
$current_action = 'search';
  in my forum index.template.php . i using default theme.

But i still can't see there is a tag "links' display on my homepage.

Below is my template_menu 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', 'managegames', 'arcadesettings', 'arcadecategory', '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('links','search', 'arcade', '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'] == 'links')
$current_action = 'links';
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 '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' , $first , '">&nbsp;</td>';

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

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

echo ($current_action == 'arcade' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'arcade' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=arcade">' , $txt['arcade'] , '</a>
</td>' , $current_action == 'arcade' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
</td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// the [links] button
if ($context['allow_view_smflinks'])
echo ($current_action == 'links' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'links' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=links">' , $txt['smflinks_menu'] , '</a>
</td>' , $current_action == 'links' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The end of tab section.
echo '
<td class="maintab_' , $last , '">&nbsp;</td>
</tr>
</table>';


Any help would be greatly appreciate . :'(

Another question :

How can i change the "arcade" tag to " games" ?

Thanks

Title: Re: How to add tabs to Core (NDT)?
Post by: sasawawa on October 28, 2007, 06:06:10 PM
Tried many times but failed . :'( :'(

Help me ,please
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 28, 2007, 08:29:37 PM
Is there a string $txt['smflinks_menu'] in Modifications.language.php file? If there isnt then add it in.

$txt['smflinks_menu'] = 'Links'; before the closing ?>

or just replace ' , $txt['smflinks_menu'] , ' with "Links" (without quites) and hard code it in.

For the arcade, you can pretty much do the same.

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: sasawawa on October 29, 2007, 04:27:28 AM
Thanks, Gary Ghoulsdon, it works now.

But only admin group can see the "links" tag.

Members and guests can't see it.

How to change the code in order to all members included guests to see the links tag?

Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 29, 2007, 08:10:27 AM
You should be able to set that in the permissions area of your admin center.

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: Ninjatron on October 30, 2007, 03:49:52 AM
Hey folks.

What I am trying to do is set up a tab that links to an outside site in a new window that is of a specific size, without any toolbar, scrollbar, etc. A pop up, essentially. I've been using javascript in the <A HREF=".. in all my regular HTML stuff, but that's not working at all in this case and I have pretty much zero php knowledge.

Clearly it's the javascript that's the problem. The link on its own works fine, but it must be opened in a new window (not a new tab) in the size that I want. I tried replacing all the ' with \, and that rendered the page fine, but the link in the new tab didn't do anything.

In a perfect world, this is what would be working right now. It's for a music player that I have already linked to like this elsewhere on my website.
// Show the [music] button...
      echo ($current_action == 'music' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'music' ? 'active_back' : 'back' , '">
               <a href="javascript:void(window.open('http://www.MYURL/musicplayer.html','musicplayer','directories=no,height=380,width=218,location=no,menubar=no,resizable=no,scrollbars=no,status=no'))">Music</a>
            </td>' , $current_action == 'music' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Is there a way to make this happen? Or perhaps to call to it externally? Thanks.

Sayonara.
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 30, 2007, 03:09:23 PM
Replacing apostrophes with backslashes wont do much, escape the apostrophes with backslashes is how it's supposed to work. (\')

Have you tried that?

-ALM
Title: Re: How to add tabs to Core (NDT)?
Post by: Ninjatron on October 30, 2007, 03:59:46 PM
Quote from: Gary Ghoulsdon on October 30, 2007, 03:09:23 PM
Replacing apostrophes with backslashes wont do much, escape the apostrophes with backslashes is how it's supposed to work. (\')

Have you tried that?
Thanks for the reply. I tried it and I'm not quite sure if I'm doing the escaping the apostrophes right because I'm still getting errors. Could you show me an example using the code in my previous post?

EDIT: I seem to have figured it out and it's working perfectly now. Thanks!

Sayonara.
Title: Re: How to add tabs to Core (NDT)?
Post by: Prowler9 on November 20, 2007, 12:34:29 AM
I have read this but still am having problems. I am just looking to add one tab to direct to my gallery part of the site. I am useing the ApolloBB theme and would like to have a Gallery button between the home and help.  If anyone has a few mins to help it would be great. You can catch me on AIM, MSN, Yahoo or e-mail thanks again
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on November 20, 2007, 12:06:34 PM
Not all themes are the same. You should look at the topic where the theme was released as its usually answered there on how to add a button.
Title: Re: How to add tabs to Core (NDT)?
Post by: WiK1d on November 27, 2007, 12:10:48 PM
Guys, I'm struggling with this

I just need an extra button that goes to a link. But I can't make it work with the 1st code provided. Here's an example of how the code looks in the .php file


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

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


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


Now how do I get a shop button?

Please help
Thanks
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on November 28, 2007, 08:17:20 PM
Take the home button, make the $current_action=='shop'. Change ', $txt[103],' to the word Shop.
Title: Re: How to add tabs to Core (NDT)?
Post by: _simon_ on November 29, 2007, 05:32:04 AM
I've tried various suggestion other people have been given but I can't seem to get any to work.

I am using SMF 1.14 with TP 0.9.8

I have created a Rules section in TP that I have linked to from the tab bar in SMF.
The link works fine, however the light blue background behind the tab indicating current position in the tab menu does not appear.

What am I doing wrong?

I have made another tab menu item called Home Page but as this opens outside of SMF I don't care if that does not highlight.


<?php
// Version: 1.1; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />', empty($context['robot_no_index']) ? '' '
<meta name="robots" content="noindex" />'
'
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_leftbar = '
, empty($options['collapse_leftbar']) ? 'false' 'true'';

                function shrinkHeaderLeftbar(mode)
                {'
;

        
// Guests don't have theme options!!
        
if ($context['user']['is_guest'])
                echo 
'
                        document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
        else
                echo 
'
                        smf_setThemeOption("collapse_leftbar", mode ? 1 : 0, null, "'
$context['session_id'], '");';
        echo 
'
                        document.getElementById("upshrinkLeftbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("leftbarHeader").style.display = mode ? "none" : "";

                        current_leftbar = mode;
                }
          // ]]></script>
       <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                var current_rightbar = '
, empty($options['collapse_rightbar']) ? 'false' 'true'';

                function shrinkHeaderRightbar(mode)
                {'
;

        
// Guests don't have theme options!!
        
if ($context['user']['is_guest'])
                echo 
'
                        document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
        else
                echo 
'
                        smf_setThemeOption("collapse_rightbar", mode ? 1 : 0, null, "'
$context['session_id'], '");';

        echo 
'
                        document.getElementById("upshrinkRightbar").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

                        document.getElementById("rightbarHeader").style.display = mode ? "none" : "";

                        current_rightbar = mode;
                }
        // ]]></script>

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>'
;
// TinyPortal start
     
if($context['TPortal']['fixed_width']!=0)
             echo 
'<table align="center" width="'.$context['TPortal']['fixed_width'].'" cellpadding="0" cellspacing="0" border="0"><tr><td>';

// TinyPortal end

echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' '''>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="32">'
;



echo '
</td>

<td align="center">
                                        <a href="http://www.tamednature.com"><img src="'
$settings['images_url'], '/frontpagelogo.jpg" style="margin: 2px;" alt="" /></a>

</td>
</tr>
</table>'
;


// TinyPortal
     
if($context['TPortal']['showtop']==1)
     {
// TinyPortal end
// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>'
;

if($context['user']['is_logged'])
echo '
<td height="32">
<span style="font-size: 130%;"> '
$txt['hello_member_ndt'], ' <b>'$context['user']['name'] , '</b></span>
</td>'
;

// display the time
echo '
<td height="32" align="right">
<span class="smalltext">' 
$context['current_time'], '</span>';

// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>'
;

if (!empty($context['user']['avatar']))
echo '
<td valign="middle">'
$context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" ><span class="middletext">'
;

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a> <br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="43200">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
<span class="middletext">'
$txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}

echo '
</td>
</tr>
</table>
</td>
</tr>
</table>'
;

echo '
<table id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"'' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>'
$txt[102], '</b>: '$context['random_news_line'], '</span>
</td>'
;
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
<a href="'
$scripturl'?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />'
;

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
'
;
// TinyPortal
       
}
//  end
echo '
</div>'
;


// Show the menu here, according to the menu sub template.
template_menu();


// The main content should go here.  A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>'
;

// TinyPortal integrated bars
          
if($context['TPortal']['leftbar'])
          {
              echo 
'<td width="' ,$context['TPortal']['leftbar_width'], '" style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' 'px; padding-top: 4px;padding-right: 1ex;" valign="top">
                 <div id="leftbarHeader"'
, empty($options['collapse_leftbar']) ? '' ' style="display: none;"'' style="padding-top: 5px; width: ' ,$context['TPortal']['leftbar_width'], 'px;">';
                 
TPortal_sidebar('left');
              echo 
'</div></td>';

          }

        echo 
'<td width="100%" align="left" valign="top" style="padding-top: 10px; padding-bottom: 10px;">';
        if(
$context['TPortal']['centerbar'])
                     echo 
'<div>' TPortal_sidebar('center') , '</div>';
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

   echo 
'</td>';

         
// TinyPortal integrated bars
          
if($context['TPortal']['rightbar']){
              echo 
'<td style="padding: ' , isset($context['TPortal']['padding']) ? $context['TPortal']['padding'] : '4' 'px; padding-top: 4px; padding-left: 1ex;" valign="top" align="right">
                 <div id="rightbarHeader"'
, empty($options['collapse_rightbar']) ? '' ' style="display: none;"'' style="width: ' ,$context['TPortal']['rightbar_width'], 'px; text-align: left; padding-top: 5px;">';
              
TPortal_rightbar();
              echo 
'</div></td>';
          }

        echo 
'</tr></table>';


// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'right' 'left''">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
                           <td valign="middle" align="center" style="white-space: nowrap;" class="smalltext">
                                        '
theme_copyright(), ' <br />'tportal_version() , '
                                       <br />Any posts in the tamednature.com Forum are posted by individuals acting in their own right
                                       <br /> and do not necessarily reflect the views of its admin, forum moderators or other members.
<br />   Copyright &copy; 2005-2007; Simon Newberry, All Rights Reserved
                                </td>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'left' 'right''">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

echo '
</div>'
;

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
'
;
// TinyPortal
     
if($context['TPortal']['fixed_width']!=0)
             echo 
'</td></tr></table>';
// end
echo '
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// 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('staff','usercp','search''admin''calendar''profile''mlist''register''login''help''pm''forum''tpadmin')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';


if (
$context['current_action'] == 'Home Page')
$current_action 'Home Page';

if (
$context['current_action'] == 'rules')
$current_action 'rules';


if (isset($_GET['dl']))
$current_action 'dlmanager';

if (isset($_GET['board']) || isset($_GET['topic']))
$current_action 'forum';

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 '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' 
$first '">&nbsp;</td>';

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

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

if(
$settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
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'?action=forum">'.$txt['tp-forum'].'</a>
</td>' 
$current_action=='forum' '<td class="maintab_active_last">&nbsp;</td>' '';

// Show the [Rules & Disclaimer] button.
echo ($current_action=='rules' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'rules' 'active_back' 'back' '">
<a href="'
$scripturl'?page=90">Rules & Disclaimer</a>
</td>' 
$current_action == 'rules' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

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

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'admin' 'active_back' 'back' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</td>' 
$current_action == 'admin' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'profile' 'active_back' 'back' '">
<a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
</td>' 
$current_action == 'profile' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'pm' 'active_back' 'back' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</td>' 
$current_action == 'pm' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</td>' 
$current_action == 'calendar' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</td>' 
$current_action == 'mlist' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// the [staff list] button
if ($context['allow_view_stafflist'])
echo ($current_action == 'staff' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'staff' 'active_back' 'back' '">
<a href="'
$scripturl'?action=staff">' $txt['smfstaff_stafflist']  , '</a>
</td>' 
$current_action == 'staff' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'login' 'active_back' 'back' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</td>' 
$current_action == 'login' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'register' 'active_back' 'back' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</td>' 
$current_action == 'register' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'logout' 'active_back' 'back' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</td>' 
$current_action == 'logout' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The end of tab section.
echo '
<td class="maintab_' 
$last '">&nbsp;</td>
'
;
// TinyPortal
 if($context['TPortal']['leftbar'])
             echo 
'<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="'$settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="'$settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
         if(
$context['TPortal']['rightbar'])
             echo 
'<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="'$settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="'$settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
// TinyPortal end
echo '
</tr>
</table>'
;

}

// 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']] . '</a>';

$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>';
}

?>



EDIT:

Fixed.

Changed this


if ($context['current_action'] == 'rules')
$current_action = 'rules';


to this:


if (isset($_REQUEST['page']) && $_REQUEST['page'] == 90)
$current_action = 'rules';


Title: Re: How to add tabs to Core (NDT)?
Post by: WiK1d on November 29, 2007, 03:15:31 PM
Thanks Ichbin, but how is that going to go to the url I need it to go to?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on November 30, 2007, 07:03:49 PM
As you'll notice in the help button, you can add the action to the URL as well.
Title: Re: How to add tabs to Core (NDT)?
Post by: WiK1d on December 02, 2007, 12:31:58 PM
huh? I honestly have no idea what you said, I'm seriously new to this :(
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 06, 2007, 11:44:02 AM
In otherwords create a copy of

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


and change it to something like:

    // Thank you, come again!
                              echo '<li><a' , $current_action=='shop' ? ' class="current"' : '' , ' href="', $scripturl, '?action=shop"><span>Shop</span></a></li>';
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on December 09, 2007, 10:36:07 AM
Hey guys :P well i tried adding this :O but it doesnt show up lol did i make a mistake somewhere ???


   if ($context['current_action'] == 'SGS Server')
      $current_action = 'http://hl2stats.saix.net/hlstats.php?game=hl2mp';
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 09, 2007, 11:21:41 AM
Thats an external link, you dont need do that sort of stuff for externals.
Title: Re: How to add tabs to Core (NDT)?
Post by: ching on December 09, 2007, 12:27:04 PM
Hey,

I have the Nav buttons created and they are showing but can't link to another page.  Any help would be great.

// Show the [Gallery] button.
                              echo '<li><a' , $current_action=='Gallery' ? ' class="current"' : '' , ' href="', $scripturl, '?action=Gallery"><span>' , Gallery , '</span></a></li>';

Even if i put a url in the href= it still won't link to that url

Any idea?
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on December 09, 2007, 01:36:47 PM
Quote from: Gazmanafc on December 09, 2007, 11:21:41 AM
Thats an external link, you dont need do that sort of stuff for externals.

ok but now how to i put in external and internal links ???
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on December 09, 2007, 10:27:54 PM
For an external link you can just change this code

href="', $scripturl, '?action=Gallery"

To this:
href="http://www.google.com"
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on December 10, 2007, 04:17:33 AM
lol sorry for my stupidness :P so it is going to look something like this ???

  if ($context['current_action'] == 'SGS Server')
      $href="http://hl2stats.saix.net/hlstats.php?game=hl2mp';

Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 10, 2007, 12:01:57 PM
You dont do the external part there. The URL would be a little lower with a <a href tag.

Quote from: ching on December 09, 2007, 12:27:04 PM
// Show the [Gallery] button.
                              echo '<li><a' , $current_action=='Gallery' ? ' class="current"' : '' , ' href="', $scripturl, '?action=Gallery"><span>' , Gallery , '</span></a></li>';

Have you tried using "gallery" without quotes instead of "Gallery" (notice the lowercase G) and also change

' , Gallery , ' to just plain Gallery (without the commas and apostrophes)
Title: Re: How to add tabs to Core (NDT)?
Post by: Snow Wolf on December 10, 2007, 06:53:57 PM
Quick question:

I want to make a homepage button and make the home button a news button. I know how to make buttons and how to rename them, but how do I make it link to something out of the smf? I want the link to take the user to the main page; www.mythicsoftware.com which is just an html page I wrote.
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 10, 2007, 07:08:18 PM
If you wanna link to an external just change where the href goes to.

ie. instead of href="' , $scripturl , '?action=tcb"
you can link to href="http://babysimpson.co.uk"
Title: Re: How to add tabs to Core (NDT)?
Post by: Snow Wolf on December 10, 2007, 07:32:02 PM
....well I feel stupid....
Title: Re: How to add tabs to Core (NDT)?
Post by: Snow Wolf on December 10, 2007, 07:50:35 PM
I think I hit a small problem. I wanted to rename "HOME" to "NEWS" in the menu bar. I edited the code to the following and it did not change:

if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'gallery', 'pm', 'forum', 'tpadmin', 'homePage', 'news')))


// Show the [news] button.
echo ($current_action=='news' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'news' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'news' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
if($settings['TPortal_front_type']!='boardindex')
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 10, 2007, 07:54:37 PM
You didnt need to change any hard coded references to the word "home" just change ' , $txt[103] , ' to ', $txt[102], '.

<a href="', $scripturl, '">' , $txt[103] , '</a>

technically determines what the HOME link is called.
Title: Re: How to add tabs to Core (NDT)?
Post by: Snow Wolf on December 10, 2007, 07:59:44 PM
Thank you very much, works wonderfully. So what array is $txt pulling from? I just wanted to see the list.
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 10, 2007, 08:00:43 PM
$txt is used in all the language files. ($helptext in Help.language.php though)
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on December 11, 2007, 01:30:13 PM
lol hi Gazmanafc :P i think you are already sick of me LOL

   // Show the [SGS Servers] button.
   echo ($current_action == 'SGS Servers' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'SGS Servers' ? 'active_back' : 'back' , '">
               <a href="http://hl2stats.saix.net/hlstats.php?game=hl2mp">' , $txt[119] , '</a>
            </td>' , $current_action == 'SGS Servers' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


now that is the code the button works nice :D but now 1 prob lol

(http://www.hl2dm.co.za/Screenshots/help.jpg)

as you can see :P it named it Help instead of SGS Servers :O

what am i doing wrong :P

it is the help before logout
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 11, 2007, 02:11:32 PM
Change ' , $txt[119] , ' to SGS Servers instead.
Title: Re: How to add tabs to Core (NDT)?
Post by: Murdoc_LaCN on December 11, 2007, 02:37:32 PM
:D thanks it worked :D
Title: Re: How to add tabs to Core (NDT)?
Post by: arcardenas on December 14, 2007, 11:13:22 PM
Hi, I'm sorry, but I'm stuck and my brain has stopped working. I'm trying to add a link to the wiki part of my site which sits at the same level as the forum. I've edited index.template.php like so

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

// Show the [wiki] button.
echo '<td valign="top" class="maintab_back"><a href="../wiki">wiki</a></td>';
[/php]


neither the "_test" part I added to the home link nor the wiki part of the tab are showing up. I've no idea what I could be missing. Really appreciate the help :).
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 15, 2007, 12:18:51 PM
// Come on Wikipedia, load you unwieldy behemoth! -Sideshow Bob
echo ($current_action=='wiki' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'wiki' ? 'active_back' : 'back' , '">
<a href="URL TO WIKI">Wiki</a>
</td>' , $current_action == 'wiki' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Should do the trick.
Title: Re: How to add tabs to Core (NDT)?
Post by: arcardenas on December 15, 2007, 12:57:58 PM
hehehe yeah, it's working now. Do the template changes take time to propagate to the index file if you are using DB Sessions?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 15, 2007, 01:13:57 PM
No. Instantaneous.
Title: Re: How to add tabs to Core (NDT)?
Post by: arcardenas on December 15, 2007, 01:42:12 PM
Thank you for the quick replies :)
Title: Re: How to add tabs to Core (NDT)?
Post by: PFDWM on December 21, 2007, 07:24:45 PM
Well I tried this and all links went to the way top of page and the button i added didnt work... I am just going to quit and let sleeping dogs lie.... I obviously can't code... oh well... can't say I didnt try. :)  good reading though
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on December 21, 2007, 08:40:38 PM
You post your code and we can help PFDWM.
Title: Re: How to add tabs to Core (NDT)?
Post by: PFDWM on December 21, 2007, 08:53:09 PM
Quote
// 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', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'PFD' )))
      $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 '
         <ul class="main-navigation">';

   // Show the [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' : '' , '
            <li class="mainNav-home"><a href="', $scripturl, '">' , $txt[103] , '</a></li>' , $current_action == 'home' ? '' : '';

   // Show the [help] button.
   echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '' : '' , '
            <li class="mainNav-help"><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>' , $current_action == 'help' ? '' : '';

   // How about the [search] button?
   if ($context['allow_search'])
      echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '' : '' , '
            <li class="mainNav-search"><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>' , $current_action == 'search' ? '' : '';

   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '' : '' , '
            <li class="mainNav-admin"><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></li>' , $current_action == 'admin' ? '' : '';

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '' : '' , '
            <li class="mainNav-profile"><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>' , $current_action == 'profile' ? '' : '';

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

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

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


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


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


   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '' : '' , '
            <li class="mainNav-logout"><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></li>' , $current_action == 'logout' ? '' : '';

   // The end of tab section.
   echo '</ul>';

}



I am adding 'PFD'  I would Like it to be 'PFD Home'  but I read a thread that it couldnt have a space.


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

Now i thought i put this in the right place but i guess i didn't  where exactly does it go?

Thank You!
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on December 21, 2007, 10:20:09 PM
Oh, right away do you see the problem? :) You're using a custom theme that doesn't use the same code as the default core theme. Remember you can just copy one of the other buttons you see in that code you posted, and then just change the necessary things that you need. You really should seek help from the theme author when you want a button in another theme as the code is almost always different. You should be able to use this for your button.

   // Show the [PFD Home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' : '' , '
            <li class="mainNav-main"><a href="http://www.pattersonfiredept.org">PFD Home</a></li>' , $current_action == 'home' ? '' : '';


Now if the code doesn't work, it may be because you need to add the mainNav-main class to your style.css file. Just copy the other classes related to one of the other buttons and change the name and properties to do what you need.
Title: Re: How to add tabs to Core (NDT)?
Post by: PFDWM on December 21, 2007, 10:22:38 PM
HUH?  Got the first part  up to
QuoteNow if the code doesn't work, it may be because you need to add the mainNav-main class to your style.css file. Just copy the other classes related to one of the other buttons and change the name and properties to do what you need.
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on December 21, 2007, 10:29:42 PM
Sorry, some times I assume people will understand my ramblings. :) If you look in the style.css file you'll notice that all the buttons have a class or 2 associated with them. Any button you put in the theme, will also need these classes. A class is just a list of properties that are applied to the button to make it look the way the designer intended. Let me see if I can just grab the classes from your site....

.main-navigation li.mainNav-home {
background:transparent url(images/menu_home.gif) no-repeat scroll 0pt -18px;
width:47px;
}


You'll need to the above code to this:
.main-navigation li.mainNav-main {
background:transparent url(images/pfd.gif) no-repeat scroll 0pt -18px;
width:47px;
}


Also, didn't realize this was a background image. You'll need to change the width to the width of your button. You'll need to make a button for this (pfd.gif in the code). If you can't, you'll need to ask the author.
Title: Re: How to add tabs to Core (NDT)?
Post by: PFDWM on December 21, 2007, 10:32:38 PM
Ok way to complex for my basic basic html knowledge... I pm'd M3talc0re  hopefully he can help
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on December 21, 2007, 10:36:06 PM
Well, I gave you all the code. So just add it to the files, and get yourself a button made. You'll be good to go. :)
Title: Re: How to add tabs to Core (NDT)?
Post by: PFDWM on December 21, 2007, 10:37:23 PM
Yeah but the button could be the hardest thing to match

I hope you know I really appreciate everything, If i could get the button I think I would try it
Title: Re: How to add tabs to Core (NDT)?
Post by: Sir_Trout on December 22, 2007, 11:48:48 AM
Thanks to JayBachatero and all of the the other SMF Heros!  I was able to add in a menu item for our new gallery with little trouble!  Just did some reading on the "How do you add custom tabs to the Core (default) theme menu? " and this tread and I had it working in no time.

Thank you!
Title: Re: How to add tabs to Core (NDT)?
Post by: A2xA on December 22, 2007, 04:33:05 PM
I tried to add it, and it worked...but weirdly.  I have already added another button, but this one is an external link so it wound up different.  The link is blue instead of black and a little too close to my forum button.  I am actually cool with the button being blue, but I don't like the button being too close to forum.  Could someone help me out.

Site: http://www.wiicharged.com

/ // Show the [Game Hubs] button...
      echo ($current_action == 'Game Hubs' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'Game Hubs' ? 'active_back' : 'back' , '">
               <a href="http://www.forum.wiicharged.com/chat/flashchat.php">Game Hubs</a>
            </td>' , $current_action == 'Game Hubs' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: PFDWM on December 22, 2007, 05:47:37 PM
Im not expert on this at all, but it looks like its not centered (the text that is)  I would try, <td valign="center"

Maybe that might help But like i said im super new
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 22, 2007, 09:08:40 PM
clrews, Can you post in code boxes the entire template_menu() function in index.template.php
Title: Re: How to add tabs to Core (NDT)?
Post by: A2xA on December 22, 2007, 09:59:37 PM
Sure Thing!  Thanks for helping.


// Show the start of the tab section.
echo '
<table cellpadding="0" cellspacing="0" border="0">
<tr>';

// Show the [home] button.
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '">' , $txt[103] , '</a></td>';

// Show the [forum] button.
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=forum">Forum</a></td>';


// Show the [Game Hubs] button...
      echo ($current_action == 'Game Hubs' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'Game Hubs' ? 'active_back' : 'back' , '">
               <a href="http://www.forum.wiicharged.com/chat/flashchat.php">Game Hubs</a>
            </td>' , $current_action == 'Game Hubs' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



// Show the [help] button.
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></td>';

// Show the [arcade] button.
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=arcade">' , $txt['arcade'] , '</a></td>';

// How about the [search] button?
if ($context['allow_search'])
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=search" onClick="return overlay(this, \'subcontent\',\'bottom\')">' , $txt[182] , '<img src="', $settings['images_url'], '/search_down.gif" width="10" height="10" /></a>
<!--Do not remove outer most DIV tag with id="subcontent"-->
<DIV id="subcontent" style="position:absolute; border: 2px solid #3d3d3d; background-color: white; width: 210px; padding: 2px; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="catbg" align="left" valign="middle" style="color:#ffffff;height:20px;line-height:16px;">Quick Search</td>
</tr>
<tr>
<td height="26" align="left" valign="middle" class="windowbg">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<input type="text" name="search" value="" style="width: 150px;" />&nbsp;
<input type="submit" name="submit" value="GO" />
<input type="hidden" name="advanced" value="0" />';

// Search within current topic?
if (!empty($context['current_topic']['allow_search']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']['allow_search']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

if ($context['allow_search'])
echo '
</form></td>
</tr>
<tr>
<td height="20" align="center" valign="middle" class="windowbg"><a class="subNav-link" href="', $scripturl, '?action=search;advanced">Advanced Search</a></td>
</tr>
</table>
<div align="right" style="font-size:10px;"><a style="color:#000000;" href="#" onClick="overlayclose(\'subcontent\'); return false">[Close]</a></div>

</DIV>
</td>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></td>';

// The [calendar]!
if ($context['allow_calendar'])
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></td>';

// the [member] list button
if ($context['allow_memberlist'])
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></td>';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></td>';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></td>';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></td>';

// How about the [quick links] button?
if ($context['user']['is_logged'])
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="', $scripturl, '#quicklinks" onClick="return overlay(this, \'quicklinks\',\'bottom\')">Quick Links<img src="', $settings['images_url'], '/search_down.gif" width="10" height="10" /></a>
<!--Do not remove outer most DIV tag with id="quicklinks"-->
<DIV id="quicklinks" style="position:absolute; border: 2px solid #3d3d3d; background-color: white; width: 150px; padding: 2px; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="1">



haha at first i did <code> instead of []
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 22, 2007, 10:41:14 PM
Use this instead

// "If only kids would play more video games about sharing" - Marge Simpson
echo '
<td align="center" valign="top"><img src="' . $settings['images_url'] . '/menu_devider.gif" width="31" height="28" alt="" /></td>
<td class="mainNav"><a href="http://www.forum.wiicharged.com/chat/flashchat.php">Game Hubs</a></td>';
Title: Re: How to add tabs to Core (NDT)?
Post by: A2xA on December 23, 2007, 12:08:50 AM
:P Thanks!  Haha I like the Simpson's, It's so funny how homer is always beating up on bart.  Anyways thanks for the help, it's all fixed now.
Title: Re: How to add tabs to Core (NDT)?
Post by: PFDWM on December 23, 2007, 10:09:57 AM
OK I got the button, lets see if it will work... Its not exact but we'll see
Title: Re: How to add tabs to Core (NDT)?
Post by: PFDWM on December 23, 2007, 10:36:56 AM
well its not going to happen... I thank you all for helping
Title: Re: How to add tabs to Core (NDT)?
Post by: SoundOfWhiteNoise on December 23, 2007, 06:48:13 PM
Hello! I am new and I wanted to know if I did it right with adding a tab menu, if you go look at my forum, http://whitenoise.ownspace.org/forums and I add "Gallery" but it was connected to "Logout" button , so how do I split it ?

thanks!  :)
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 23, 2007, 07:49:53 PM
Can you post the template_menu() function in index.template.php in code tags.
Title: Re: How to add tabs to Core (NDT)?
Post by: SoundOfWhiteNoise on December 23, 2007, 08:56:10 PM
// 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', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'gallery')))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'gallery')
      $current_action = 'gallery';
   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 '
         <table cellpadding="0" cellspacing="0" border="0">
            <tr>';

   // Show the [home] button.
   if (!empty($settings['pnpn_forum_button']))
   echo '
   <td class="maintab_off_first">&nbsp;</td>
      <td valign="top" class="maintab_off_back">
      <a href="', $settings['pnpn_forum_button'], '">' , $txt[103] , '</a>
      </td>
   <td class="maintab_off_last">&nbsp;</td>';

   if (!empty($settings['pnpn_forum_button']))
   {
   // Show the [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '">' , $txt['pnpn_forum_button_forum'] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   }
   else
   {
   // Show the [forum] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   }
   // Show the [help] button.
   echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
            </td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   // How about the [search] button?
   if ($context['allow_search'])
      echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
            </td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   // Is the user allowed to administrate at all? ([admin])
   if ($context['allow_admin'])
      echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
            </td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
            </td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=pm"><span style="white-space: nowrap;">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</span></a>
            </td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

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


   // The [calendar]!
   if ($context['allow_calendar'])
      echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
            </td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   // the [member] list button
   if (!empty($settings['member_list_button']))
   {
   if($settings['member_list_button'])
   {
   if ($context['allow_memberlist'])
      echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
            </td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';
   }   
   }

   // If the user is a guest, show [login] button.
   if ($context['user']['is_guest'])
      echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
            </td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';


   // If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
      echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
            </td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   
   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
            <td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'off_back' , '">
               <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
            </td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

   // The end of tab section.
   echo '
         </tr>
      </table>';

}


here it is and tell me what I missed or what ?
Title: Re: How to add tabs to Core (NDT)?
Post by: MavsFlash on December 27, 2007, 10:44:04 AM
hi i am new to coding php and ive tried all that it sais here but it does not work on my template i am currently using the 'BlueAce template can anyone help me, also with the integrated java chat mod the chat page is not on the menu/links bar at the top right hand side of the page
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on December 27, 2007, 11:22:55 AM
This topic is for adding buttons to the default core theme. To add a button to a custom theme you should seek help from the author of the theme.
Title: Re: How to add tabs to Core (NDT)?
Post by: susubotol on December 28, 2007, 02:39:12 AM
Nevermind. Thanks.
Title: Re: How to add tabs to Core (NDT)?
Post by: Onni on January 09, 2008, 11:24:59 AM
Hi!

I dont know much about PHP, so i would be glad if somebody would help me to add link to my "main page" on the navigation bar ;). Im using SMF 1.1.4 and default (core) theme. I woul like the link to appear between "Home" and "Help" links. Adress would be http://www.rammstein-hq.com. Thanks :).

-Onni
Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on January 09, 2008, 11:31:17 AM
Omni can I suggest that you read this thread the answer is already posted in here :)
Title: Re: How to add tabs to Core (NDT)?
Post by: Onni on January 09, 2008, 12:02:55 PM
Not working :'(... What am i doing wrong? Heres the code:


// 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('mainpage', 'search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
if ($context['current_action'] == 'mainpage')
$current_action = 'mainpage';
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';



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

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

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on January 09, 2008, 12:08:23 PM
try changing this
// Show the [mainpage] button.
echo ($current_action=='mainpage' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mainpage' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mainpage">Chat</a>
</td>' , $current_action == 'mainpage' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


to

// Show the [mainpage] button.
echo ($current_action=='mainpage' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mainpage' ? 'active_back' : 'back' , '">
<a href="http://www.rammstein-hq.com">Main</a>
</td>' , $current_action == 'mainpage' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: Onni on January 09, 2008, 12:39:13 PM
Works perfectly! Thanks a lot!
Title: Re: How to add tabs to Core (NDT)?
Post by: scuzzy47 on January 21, 2008, 12:52:50 PM
I got a question, I got the button to work, it's an upload script, so now I link that button to an Upload.php page in Sources.
But that's not the upload page I want to use, so what code should I use to link to that page?
I was thinking about an <iframe> html code, but than the layout get's all messed up, I need it to appear where the other pages appear, center of my forum...
Title: Re: How to add tabs to Core (NDT)?
Post by: deziner on February 22, 2008, 12:25:17 PM
Hi I would like to put links above everything at the top of the page. The site is http://www.amputee-center.com/forum/  The links would be for the reat of the site likecontact us pg1 pg2 etc. They will all be external links what file do I modify and where do I modify it?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on February 22, 2008, 01:16:54 PM
Just change the <a href=" tag to contain the external URL.


// That says corn Bart
echo'
<td valign="top" class="maintab_back">
<a href="http://babysimpson.co.uk">The Cutest Baby</a>
</td>'';


Should to the trick.
Title: Re: How to add tabs to Core (NDT)?
Post by: shumar on March 08, 2008, 04:56:45 PM
Quote from: Penelope on June 04, 2006, 06:02:42 PM
Thanks for all the info!  :D

I have only one question. I made a new menu item "Hall of Fame" and when i go on that page, the "Home" and "Hall of Fame" button are selected, which should only be the "Hall of Fame" button.

Any idea what is wrong? Hope someone can help me!

in the index.template i have this:

//Hall of fame menu button
if ($context['current_action'] == 'halloffame')
$current_action = 'halloffame';
echo ($current_action=='halloffame' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'halloffame' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=halloffame">Hall of Fame</a>
</td>' , $current_action == 'halloffame' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


in the halloffame.php file i have this:

<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
halloffame() {
// This is gonna be needed...
loadTemplate('halloffame');
}


in the halloffame.template i have this:

<?php
// Version: 1.1 RC2; Gallery

function template_main()
{
global $context$settings$options$txt$scripturl;

echo '
<script language="JavaScript" type="text/javascript"><!--
function checkAll(onOff)
{
for (var i = 0; i < document.searchform.elements.length; i++)
{
if (document.searchform.elements[i].name.substr(0, 3) == "brd")
document.searchform.elements[i].checked = onOff;
}
}
// --></script>
<form action="'
$scripturl'?action=search2" method="post" name="searchform" id="searchform">

 <script type="text/javascript"><!--

/***********************************************
* IFrame SSI script II- Â© Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["myframe"]

//Should script hide iframe from browsers that don\'t support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller

// --></script>

<table width="100%" border="0" cellspacing="0" cellpadding="4" align="center" class="tborder">
<tr class="titlebg">
<td>Hall of Fame</td>
</tr><tr>
<td class="windowbg">'
;

/*   
 *   Podium Hall of Fame
 *   
 *   
 */

echo ' <center><table border="0" width="95%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr class="catbg">
<td align="center" colspan = 3>
<img src="">
<a href="'
.$scripturl.'?action=arcade">Hero Members</a><img src="">
</td>
</tr>
<tr align="center">
'
;
if(!empty($data_1[2]["name"])){
echo'
<td class="windowbg" width="33%">
<img src="" border="0" /> <br />
'
.$data_1[2]["avatar"].' <br/>
<a href="'
.$scripturl.'?action=profile;u='.$data_1[2]["id"].'">'.$data_1[2]["name"].'</a> <br/>
(<b>'
.$data_1[2]["count"].'</b> Highscores)
</td>
'
;
}else{
echo'
<td class="windowbg" width="33%">
&nbsp;
</td>



<td class="windowbg" width="33%">
<img src="" border="0" /> <br />

<a href=""></a> <br/>

</td>
<td class="windowbg" width="33%">
&nbsp;
</td>
'
;
}
if(!empty($data_1[3]["name"])){
echo'
<td class="windowbg" width="33%">
<img src="" border="0" /> <br />
'
.$data_1[3]["avatar"].' <br/>
<a href="'
.$scripturl.'?action=profile;u='.$data_1[3]["id"].'">'.$data_1[3]["name"].'</a> <br/>
(<b>'
.$data_1[3]["count"].'</b> Highscores)
</td>
'
;
}else{
echo'

'
;
}
echo'
</tr>
</table></center>
'
;


/*
 * End podium Hall of Fame
 *
 *
 */






echo '
</td>
</tr>
</table>
</form>'
;
}

?>

Where to add those files ??
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on March 08, 2008, 05:17:09 PM
There was no need to quote that. Are you trying to add a gallery to your forum, because you can just install one of the many galleries on the Mod Site.
Title: Re: How to add tabs to Core (NDT)?
Post by: shumar on March 08, 2008, 07:56:42 PM
I need hall of fame, not gallery...
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on March 08, 2008, 07:58:43 PM
Drop halloffame.php into the Sources directory and halloffame.template.php into the Default theme's folder.
Title: Re: How to add tabs to Core (NDT)?
Post by: shumar on March 09, 2008, 04:39:09 PM
hm...
Does someone try this hall of fame every time I click it send me to index.php
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on March 09, 2008, 04:52:29 PM
You'll need to add the action call to it in index.php of your forum's root.
Title: Re: How to add tabs to Core (NDT)?
Post by: Kolya on March 11, 2008, 06:46:28 PM
I want to call up a certain SMF thread from a custom core tab.
I got it working so far that the thread is loaded but the tab is not being activated.
Or when I add a custom action after the threads URL the tab gets activated but the thread is not being loaded.

I need a bit of help here.

index.template.php

echo '
<td class="maintab_' , $current_action == 'welcome' ? 'active_back' : 'back' , '">
<a href="', $boardurl, '/index.php/topic,109.0.html', '">' , $txt[119] , '</a>
</td>';


Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on March 11, 2008, 06:51:29 PM
You'll have to add some custom PHP to detect your location.
Change the number 5 to the number of your topic.
if (isset($_GET['topic']) && $_GET['topic'] == 5)
$current_action = 'topic';


In your button code put the action as topic.
Title: Re: How to add tabs to Core (NDT)?
Post by: Kolya on March 11, 2008, 06:55:36 PM
Thanks a lot, that worked great.  :)
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on March 13, 2008, 02:01:21 AM
If your topic isn't for core we would appreciate if you'd make your own topic thanks.
Title: Re: How to add tabs to Core (NDT)?
Post by: shumar on March 14, 2008, 06:00:37 PM
I need little more help.

//Hall of fame menu button
if ($context['current_action'] == 'halloffame')
$current_action = 'halloffame';
echo ($current_action=='halloffame' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'halloffame' ? 'active_back' : 'back' , '">
<a href="./hall_of_fame-p8.html">Hall of Fame</a>
</td>' , $current_action == 'halloffame' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Only Home button is highlighted not Hall of Fame. What I need to change ??
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on March 16, 2008, 10:41:24 PM
Its because in your actual URL it has to say http://www.yoursite.com/index.php?action=halloffame for it to highlight. Since your link is external to SMF (./hall_of_fame-p8.html) it will not highlight when you are on that page.
Title: Re: How to add tabs to Core (NDT)?
Post by: E-World on March 17, 2008, 02:24:56 AM
Hi i have just added a new tab to link to my torrents site, but how do i make it like the rest?
Check is here. (http://e-worldforums.co.nr)
Title: Re: How to add tabs to Core (NDT)?
Post by: shumar on March 17, 2008, 05:08:51 PM
hm...
How to make to call correctly one of PHP articles in TP ? With highlighting...
I give up on this and try something else, but I need help. :)

Can I make halloffame.php which will call halloffame.template.php with this code and then call that file ?
But problem is how to do that..
I put in Sources halloffame.php with this code:


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
halloffame() {
// This is gonna be needed...
loadTemplate('halloffame');
}


and make halloffame.template.php in /Themes/default/

<?php
 
global $txt$scripturl$user_info$context$modSettings$ID_MEMBER$board_info$settings$db_prefix;

////////////////////////////////////////  Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(1312,);
////////////////////////////////////////

$list_by_group true;         // 'true' for separate sections by group; 'false' for consolidated list
$include_nonprimary_groups true;   // 'true' to check for group membership in additional groups; 'false' for primary only
$include_post_groups false;      // 'true' to include post-count based group in membership search
$include_moderators false;      // 'true' to include board moderators on page
$repeats_allowed false;      // 'true' to allow multiple appearances by member on page (for $list_by_group = true only)

$sort_by 'name';          // choices - 'id' ascending(default), 'posts' descending, 'name' ascending

$extra_type 'none';         // choices - 'none'(default), 'board' links, 'page' (article) links
///////////////////
// Format - $extra_links['<member userid #>'] = '<forum board #>';
//       or $extra_links['<member userid #>'] = '<TP article #>';
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';

$extra_label_prefix 'Page of ';   // text to precede member's name in link label for extra link
$extra_label_suffix '';      // text to append to member's name in link label for extra link

$page_title 'Hall of Fame';
$page_subtitle 'ÄŚlanovi grupe na koje smo posebno ponosni';

$moderator_group 3;
///////////////////////////////////////////////////////////////////////////////////////

$sort_ord 'mem.ID_MEMBER ASC';
if (
$sort_by == 'posts'$sort_ord 'mem.posts DESC';
if (
$sort_by == 'name'$sort_ord 'mem.realName ASC';

if ((
$extra_type != 'board') && ($extra_type != 'page')) $extra_type 'none';

if (
$include_moderators)
   {if (!
in_array($moderator_group$groups_list)) $groups_list[] = $moderator_group;}

$groups_to_use = array();
if (
$list_by_group)
   {
$groups_to_use $groups_list;}
else
   {
$groups_to_use[] = 0;}

$users_already_listed = array();
$users_already_listed[] = 0;

loadLanguage('Profile');

echo 
'<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
   <td colspan="4"><h2 align="center">'
$page_title'</h2>
   <span class="smalltext"><h3 align="center">'
$page_subtitle'</h3></span>
</td></tr>'
;

if (!
$list_by_group)
   echo 
'<tr><td colspan="4">
</td></tr><tr width="95%" style="margin-top: 4px;">
      <td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2> </h2>
      </td></tr>'
;

foreach(
$groups_to_use as $groupnumber)
{
   
$loaded_ids = array();
   
$user_profile=array();
   
$memberContext=array();
   
$profile=array();
   
$context['TPortal']['team']=array();
  
   
// get the name of the group
   
$request db_query("
      SELECT groupName FROM 
{$db_prefix}membergroups WHERE ID_GROUP=$groupnumber"__FILE____LINE__);
   if(
mysql_num_rows($request)>0){
      
$row mysql_fetch_row($request);
      
$groupNameX=$row[0];
      
mysql_free_result($request);
   }

   if (
$list_by_group) {
      
$select_where 'mem.ID_GROUP = '.$groupnumber;
      if (
$include_nonprimary_groups$select_where .= ' OR FIND_IN_SET('.$groupnumber.', mem.additionalGroups)';
      if (
$include_post_groups$select_where .= ' OR mem.ID_POST_GROUP = '.$groupnumber;
      if (
$include_moderators && ($groupnumber == $moderator_group)) $select_where 'mem.ID_MEMBER = m.ID_MEMBER';
   }
   else {
      
$select_where 'mem.ID_GROUP IN (' implode(', '$groups_list) . ')';
      if (
$include_nonprimary_groups$select_where .= ' OR FIND_IN_SET(' implode(', mem.additionalGroups) OR FIND_IN_SET('$groups_list) . ', mem.additionalGroups)';
      if (
$include_post_groups$select_where .= ' OR mem.ID_POST_GROUP IN (' implode(', '$groups_list) . ')';
      if (
$include_moderators$select_where .= 'OR mem.ID_MEMBER = m.ID_MEMBER';
   }

   
$select_where '(' $select_where ') AND mem.ID_MEMBER NOT IN (' implode(', '$users_already_listed) . ')';

   
// Load the member's data.
   
$request db_query("
      SELECT   IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
         mem.personalText, mem.avatar, mem.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
         mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
         mem.websiteUrl, mem.location, mem.posts, them.value AS CP4, m.ID_MEMBER as modmem, g.groupName
      FROM (
{$db_prefix}members AS mem)
         LEFT JOIN 
{$db_prefix}moderators AS m ON (m.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
         LEFT JOIN 
{$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}themes AS them ON (mem.ID_MEMBER = them.ID_MEMBER AND them.variable = 'CP4' AND them.ID_THEME=1)
      WHERE 
$select_where
      GROUP BY mem.ID_MEMBER
      ORDER BY 
$sort_ord"__FILE____LINE__);
   
$new_loaded_ids = array();
   
$member_count 0;

   while (
$row mysql_fetch_assoc($request))
   {
      if (!
$repeats_allowed$users_already_listed[$row['memnum']] = $row['memnum'];

      
$member_count += 1;

      
$avatar_width '';
      
$avatar_height '';
      if(
$context['browser']['is_ie6']) $avatar_width 'width="' $modSettings['avatar_max_width_external'] . '"';

      
$context['TPortal']['team'][] = array(
         
'username' => $row['memberName'],
         
'usertitle' => $row['usertitle'],
         
'name' => $row['realName'],
         
'groupname' => ($groupnumber == 0) ? $row['groupName'] : $groupNameX ,
         
'posts' => $row['posts'],
         
'karmabad' => $row['karmaBad'],
         
'karmagood' => $row['karmaGood'],
         
'location' => $row['location'],
         
'href' => $scripturl '?action=profile;u=' $row['memnum'],
         
'link' => '<a href="' $scripturl '?action=profile;u=' $row['memnum'] . '" title="' $txt[92] . ' ' $row['realName'] . '">' $row['realName'] . '</a>',
         
'blurb' => $row['personalText'],
         
'avatar' => array(
            
'name' => $row['avatar'],
            
'image' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > '<img  src="' . (empty($row['attachmentType']) ? $scripturl '?action=dlattach;attach=' $row['ID_ATTACH'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) . '" alt="" style="max-height:280px;max-width:180px;" border="0" />' '') : (stristr($row['avatar'], 'http://') ? '<img src="' $row['avatar'] . '"' $avatar_width $avatar_height ' alt="" style="max-height:280px;max-width:180px;" border="0" />' '<img src="' $modSettings['avatar_url'] . '/' htmlspecialchars($row['avatar']) . '" alt="" style="max-height:280px;max-width:180px;" border="0" />'),
            
'href' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > ? (empty($row['attachmentType']) ? $scripturl '?action=dlattach;attach=' $row['ID_ATTACH'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' $row['avatar']),
            
'url' => $row['avatar'] == '' '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' $row['avatar'])
         ),
         
'last_login' => empty($row['lastLogin']) ? $txt['never'] : timeformat($row['lastLogin']),
         
'last_login_timestamp' => empty($row['lastLogin']) ? forum_time(0$row['lastLogin']),
         
'website' => array(
            
'title' => $row['websiteTitle'],
            
'url' => $row['websiteUrl']
         ),
         
'online' => array(
            
'is_online' => $row['isOnline'],
            
'text' => &$txt[$row['isOnline'] ? 'online2' 'online3'],
            
'image_href' => $settings['images_url'] . '/' . ($row['isOnline'] ? 'useron' 'useroff') . '.gif',
         ),
         
'CP4' => $row['CP4'],
         
'member_page' => ($extra_type == 'none') ? '' : empty($extra_links[$row['memnum']]) ? '' $extra_links[$row['memnum']],
      );

   }
   
mysql_free_result($request);

   if (
$member_count 0)
   {
      if (
$list_by_group)
      echo 
'<tr><td colspan="4">
</td></tr><tr width="95%" style="margin-top: 4px;">
         <td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2 align="center">' 
$groupNameX '</h2>
         </td></tr>'
;

      echo 
'<tr>';
           
$newrow=0;

      foreach(
$context['TPortal']['team'] as $team)
           {
         echo 
'
            <td valign="top" width="18%">'
.$team['avatar']['image'].'</td>';

         echo 
'   <td valign="top" class="middletext" style="padding: 2px;">';

            echo 
'<h2 style="margin-top: 0; margin-bottom: 4px;">'.$team['link'].'</h2>';

//            echo ''. $team['usertitle'].'
//';

//            if (!$list_by_group)
//               echo ''.$txt[87].': '.$team['groupname'].'
//';

            
if ($modSettings['karmaMode'] == '1')
               echo 
''$modSettings['karmaLabel'], ' '$team['karmagood'] - $team['karmabad'], '
'
;
            elseif (
$modSettings['karmaMode'] == '2')
               echo 
''$modSettings['karmaLabel'], ' +'$team['karmagood'], ' | -'$team['karmabad'], '
'
;

//            echo ''.$txt['lastLoggedIn'].': '.$team['last_login'].'
//';



//            echo !empty($team['location']) ? ''.$txt[227].': '.$team['location'].'
//' : '';

//          echo !empty($team['website']['title']) ? ''.$txt[96].': <a href="'.$team['website']['url'].'" target="_blank">'.$team['website']['title'].'</a>
//' : '';


//            echo !empty($team['blurb']) ? '- '.$team['blurb'].'
//' : '';

            
echo !empty($team['CP4']) ? $team['CP4'].'
'';

            if ((
$extra_type == 'board') && !empty($team['member_page']))
               echo 
'<a href="' $scripturl '?board=' $team['member_page'] . '">'$extra_label_prefix $team['name'] . $extra_label_suffix '</a>
'
;
            if ((
$extra_type == 'page') && !empty($team['member_page']))
               echo 
'<a href="' $scripturl '?page=' $team['member_page'] . '">'$extra_label_prefix $team['name'] . $extra_label_suffix '</a>
'
;

         echo 
'
            </td>'
;

         
$newrow++;
         if(
$newrow>1){
            
$newrow=0;
            echo 
'</tr><tr><td colspan="4"></td></tr><tr>';
         }
           }
      if(
$newrow=1) echo '<td colspan="2"></td>';
      echo 
'</tr>';
   }

}
echo 
'</table>';
?>


Also I make changes in index.template:

if (in_array($context['current_action'], array('gallery', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'invite', 'forum', 'tpadmin', 'halloffame')))


//Hall of fame menu button
if ($context[$current_action == 'halloffame'])
$current_action = 'halloffame';
echo ($current_action=='halloffame' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'halloffame' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=halloffame">Hall of Fame</a>
</td>' , $current_action == 'halloffame' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

but how to make that correct file is called when I click on link ?
Title: Re: How to add tabs to Core (NDT)?
Post by: xtrasimplicity on March 22, 2008, 11:24:30 PM
I found it:
http://www.simplemachines.org/community/index.php?topic=23864.0;wap2
Title: Re: How to add tabs to Core (NDT)?
Post by: unrelenting on March 24, 2008, 09:14:32 PM
Quote from: shumar on March 17, 2008, 05:08:51 PM
hm...
How to make to call correctly one of PHP articles in TP ? With highlighting...
I give up on this and try something else, but I need help. :)

Can I make halloffame.php which will call halloffame.template.php with this code and then call that file ?
But problem is how to do that..
I put in Sources halloffame.php with this code:


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
halloffame() {
// This is gonna be needed...
loadTemplate('halloffame');
}


and make halloffame.template.php in /Themes/default/

<?php
 
global $txt$scripturl$user_info$context$modSettings$ID_MEMBER$board_info$settings$db_prefix;

////////////////////////////////////////  Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(1312,);
////////////////////////////////////////

$list_by_group true;         // 'true' for separate sections by group; 'false' for consolidated list
$include_nonprimary_groups true;   // 'true' to check for group membership in additional groups; 'false' for primary only
$include_post_groups false;      // 'true' to include post-count based group in membership search
$include_moderators false;      // 'true' to include board moderators on page
$repeats_allowed false;      // 'true' to allow multiple appearances by member on page (for $list_by_group = true only)

$sort_by 'name';          // choices - 'id' ascending(default), 'posts' descending, 'name' ascending

$extra_type 'none';         // choices - 'none'(default), 'board' links, 'page' (article) links
///////////////////
// Format - $extra_links['<member userid #>'] = '<forum board #>';
//       or $extra_links['<member userid #>'] = '<TP article #>';
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';

$extra_label_prefix 'Page of ';   // text to precede member's name in link label for extra link
$extra_label_suffix '';      // text to append to member's name in link label for extra link

$page_title 'Hall of Fame';
$page_subtitle 'ÄŚlanovi grupe na koje smo posebno ponosni';

$moderator_group 3;
///////////////////////////////////////////////////////////////////////////////////////

$sort_ord 'mem.ID_MEMBER ASC';
if (
$sort_by == 'posts'$sort_ord 'mem.posts DESC';
if (
$sort_by == 'name'$sort_ord 'mem.realName ASC';

if ((
$extra_type != 'board') && ($extra_type != 'page')) $extra_type 'none';

if (
$include_moderators)
   {if (!
in_array($moderator_group$groups_list)) $groups_list[] = $moderator_group;}

$groups_to_use = array();
if (
$list_by_group)
   {
$groups_to_use $groups_list;}
else
   {
$groups_to_use[] = 0;}

$users_already_listed = array();
$users_already_listed[] = 0;

loadLanguage('Profile');

echo 
'<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
   <td colspan="4"><h2 align="center">'
$page_title'</h2>
   <span class="smalltext"><h3 align="center">'
$page_subtitle'</h3></span>
</td></tr>'
;

if (!
$list_by_group)
   echo 
'<tr><td colspan="4">
</td></tr><tr width="95%" style="margin-top: 4px;">
      <td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2> </h2>
      </td></tr>'
;

foreach(
$groups_to_use as $groupnumber)
{
   
$loaded_ids = array();
   
$user_profile=array();
   
$memberContext=array();
   
$profile=array();
   
$context['TPortal']['team']=array();
  
   
// get the name of the group
   
$request db_query("
      SELECT groupName FROM 
{$db_prefix}membergroups WHERE ID_GROUP=$groupnumber"__FILE____LINE__);
   if(
mysql_num_rows($request)>0){
      
$row mysql_fetch_row($request);
      
$groupNameX=$row[0];
      
mysql_free_result($request);
   }

   if (
$list_by_group) {
      
$select_where 'mem.ID_GROUP = '.$groupnumber;
      if (
$include_nonprimary_groups$select_where .= ' OR FIND_IN_SET('.$groupnumber.', mem.additionalGroups)';
      if (
$include_post_groups$select_where .= ' OR mem.ID_POST_GROUP = '.$groupnumber;
      if (
$include_moderators && ($groupnumber == $moderator_group)) $select_where 'mem.ID_MEMBER = m.ID_MEMBER';
   }
   else {
      
$select_where 'mem.ID_GROUP IN (' implode(', '$groups_list) . ')';
      if (
$include_nonprimary_groups$select_where .= ' OR FIND_IN_SET(' implode(', mem.additionalGroups) OR FIND_IN_SET('$groups_list) . ', mem.additionalGroups)';
      if (
$include_post_groups$select_where .= ' OR mem.ID_POST_GROUP IN (' implode(', '$groups_list) . ')';
      if (
$include_moderators$select_where .= 'OR mem.ID_MEMBER = m.ID_MEMBER';
   }

   
$select_where '(' $select_where ') AND mem.ID_MEMBER NOT IN (' implode(', '$users_already_listed) . ')';

   
// Load the member's data.
   
$request db_query("
      SELECT   IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
         mem.personalText, mem.avatar, mem.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
         mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
         mem.websiteUrl, mem.location, mem.posts, them.value AS CP4, m.ID_MEMBER as modmem, g.groupName
      FROM (
{$db_prefix}members AS mem)
         LEFT JOIN 
{$db_prefix}moderators AS m ON (m.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
         LEFT JOIN 
{$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}themes AS them ON (mem.ID_MEMBER = them.ID_MEMBER AND them.variable = 'CP4' AND them.ID_THEME=1)
      WHERE 
$select_where
      GROUP BY mem.ID_MEMBER
      ORDER BY 
$sort_ord"__FILE____LINE__);
   
$new_loaded_ids = array();
   
$member_count 0;

   while (
$row mysql_fetch_assoc($request))
   {
      if (!
$repeats_allowed$users_already_listed[$row['memnum']] = $row['memnum'];

      
$member_count += 1;

      
$avatar_width '';
      
$avatar_height '';
      if(
$context['browser']['is_ie6']) $avatar_width 'width="' $modSettings['avatar_max_width_external'] . '"';

      
$context['TPortal']['team'][] = array(
         
'username' => $row['memberName'],
         
'usertitle' => $row['usertitle'],
         
'name' => $row['realName'],
         
'groupname' => ($groupnumber == 0) ? $row['groupName'] : $groupNameX ,
         
'posts' => $row['posts'],
         
'karmabad' => $row['karmaBad'],
         
'karmagood' => $row['karmaGood'],
         
'location' => $row['location'],
         
'href' => $scripturl '?action=profile;u=' $row['memnum'],
         
'link' => '<a href="' $scripturl '?action=profile;u=' $row['memnum'] . '" title="' $txt[92] . ' ' $row['realName'] . '">' $row['realName'] . '</a>',
         
'blurb' => $row['personalText'],
         
'avatar' => array(
            
'name' => $row['avatar'],
            
'image' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > '<img  src="' . (empty($row['attachmentType']) ? $scripturl '?action=dlattach;attach=' $row['ID_ATTACH'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) . '" alt="" style="max-height:280px;max-width:180px;" border="0" />' '') : (stristr($row['avatar'], 'http://') ? '<img src="' $row['avatar'] . '"' $avatar_width $avatar_height ' alt="" style="max-height:280px;max-width:180px;" border="0" />' '<img src="' $modSettings['avatar_url'] . '/' htmlspecialchars($row['avatar']) . '" alt="" style="max-height:280px;max-width:180px;" border="0" />'),
            
'href' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > ? (empty($row['attachmentType']) ? $scripturl '?action=dlattach;attach=' $row['ID_ATTACH'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' $row['avatar']),
            
'url' => $row['avatar'] == '' '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' $row['avatar'])
         ),
         
'last_login' => empty($row['lastLogin']) ? $txt['never'] : timeformat($row['lastLogin']),
         
'last_login_timestamp' => empty($row['lastLogin']) ? forum_time(0$row['lastLogin']),
         
'website' => array(
            
'title' => $row['websiteTitle'],
            
'url' => $row['websiteUrl']
         ),
         
'online' => array(
            
'is_online' => $row['isOnline'],
            
'text' => &$txt[$row['isOnline'] ? 'online2' 'online3'],
            
'image_href' => $settings['images_url'] . '/' . ($row['isOnline'] ? 'useron' 'useroff') . '.gif',
         ),
         
'CP4' => $row['CP4'],
         
'member_page' => ($extra_type == 'none') ? '' : empty($extra_links[$row['memnum']]) ? '' $extra_links[$row['memnum']],
      );

   }
   
mysql_free_result($request);

   if (
$member_count 0)
   {
      if (
$list_by_group)
      echo 
'<tr><td colspan="4">
</td></tr><tr width="95%" style="margin-top: 4px;">
         <td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2 align="center">' 
$groupNameX '</h2>
         </td></tr>'
;

      echo 
'<tr>';
           
$newrow=0;

      foreach(
$context['TPortal']['team'] as $team)
           {
         echo 
'
            <td valign="top" width="18%">'
.$team['avatar']['image'].'</td>';

         echo 
'   <td valign="top" class="middletext" style="padding: 2px;">';

            echo 
'<h2 style="margin-top: 0; margin-bottom: 4px;">'.$team['link'].'</h2>';

//            echo ''. $team['usertitle'].'
//';

//            if (!$list_by_group)
//               echo ''.$txt[87].': '.$team['groupname'].'
//';

            
if ($modSettings['karmaMode'] == '1')
               echo 
''$modSettings['karmaLabel'], ' '$team['karmagood'] - $team['karmabad'], '
'
;
            elseif (
$modSettings['karmaMode'] == '2')
               echo 
''$modSettings['karmaLabel'], ' +'$team['karmagood'], ' | -'$team['karmabad'], '
'
;

//            echo ''.$txt['lastLoggedIn'].': '.$team['last_login'].'
//';



//            echo !empty($team['location']) ? ''.$txt[227].': '.$team['location'].'
//' : '';

//          echo !empty($team['website']['title']) ? ''.$txt[96].': <a href="'.$team['website']['url'].'" target="_blank">'.$team['website']['title'].'</a>
//' : '';


//            echo !empty($team['blurb']) ? '- '.$team['blurb'].'
//' : '';

            
echo !empty($team['CP4']) ? $team['CP4'].'
'';

            if ((
$extra_type == 'board') && !empty($team['member_page']))
               echo 
'<a href="' $scripturl '?board=' $team['member_page'] . '">'$extra_label_prefix $team['name'] . $extra_label_suffix '</a>
'
;
            if ((
$extra_type == 'page') && !empty($team['member_page']))
               echo 
'<a href="' $scripturl '?page=' $team['member_page'] . '">'$extra_label_prefix $team['name'] . $extra_label_suffix '</a>
'
;

         echo 
'
            </td>'
;

         
$newrow++;
         if(
$newrow>1){
            
$newrow=0;
            echo 
'</tr><tr><td colspan="4"></td></tr><tr>';
         }
           }
      if(
$newrow=1) echo '<td colspan="2"></td>';
      echo 
'</tr>';
   }

}
echo 
'</table>';
?>


Also I make changes in index.template:

if (in_array($context['current_action'], array('gallery', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'invite', 'forum', 'tpadmin', 'halloffame')))


//Hall of fame menu button
if ($context[$current_action == 'halloffame'])
$current_action = 'halloffame';
echo ($current_action=='halloffame' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'halloffame' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=halloffame">Hall of Fame</a>
</td>' , $current_action == 'halloffame' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

but how to make that correct file is called when I click on link ?

Did you add the:


'halloffame' => array('halloffame.php', 'hallofffame'),


to your http://sitename.com/forum/index.php file?

http://www.simplemachines.org/community/index.php?topic=23864.msg189057#msg189057
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 28, 2008, 12:34:38 AM
I'm using 1.1.4 with the default core theme.  I used your instructions only I replaced the word "chat" with the word "news".  The tab showed up just fine, but when I clicked on it I got a message saying something about how I could not edit the page (I was logged in as a moderator at the time).

I am trying to add a tab to access a page I created using the Custom Action Mod.  I successfully created the page, but the only way to access it is to click the "Go to Page" link on the Custom Action Settings.

Here's the link to see the page I made with the Custom Action Mod: here (http://auditbible.com/index.php?action=News)

How can I make the "News" tab link to this page so it can be easily accessed by members and visitors?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on March 28, 2008, 09:44:55 AM
I don't see the link on your site. If you post the code we can take a look and see if there's something you need to change.
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 28, 2008, 10:47:30 AM
Thank you IchBin!  I appreciate your help on this.

Sorry, but since it didn't work, I removed it.  But here's the code I used to insert the News tab:

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


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


Is this what you're asking me about?  I think there must be something I'm missing, because I don't understand how this code to insert a tab will call-up the News page.

Also, do you think what I'm trying to accomplish is better achieved this way or by using the RSS Feed Poster Mod?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on March 28, 2008, 11:00:25 AM
That code looks like it should work to me. When you use the code what does it do?
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 28, 2008, 04:35:57 PM
Sorry IchBin - I've been at work all day.  Thank you for your reply.

I re-inserted the code and tried it again logged-in as an administrator this time, and when I clicked on the News tab it opened up Admin>Main>News and Newsletters>News for my News Fader.

Is there a way to get it to open the News action I made with the Custom Action Mod: here (http://auditbible.com/index.php?action=News)?  Also, do you think I should use the RSS Feed Poster Mod instead (I haven't tried it yet)?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on March 28, 2008, 06:36:32 PM
I don't think so, since there is already a news action defined. As you noticed it takes you to it. :) IF I were you I would just rename it to something else that you can live with. action=recentnews or something.
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 28, 2008, 07:02:41 PM
I changed it to "In The News" and now when I click the tab, it just returns me to my home page.

I'm very new at this, but it seems to me like there's something I need to do to connect the "In The News" tab to the custom action I created which has it's own URL (http://www.myforumname.com/index.php?action=News).  Is my thinking correct, or am I completely lost (which would be my first guess)?

Also, I'm wondering if I can add a small search window on the page where members and guests can enter a their own terms and have custom Google Alert results displayed for their terms.  Being fairly new at all this, I have no idea how to go about it.  Is this something I should post to the SMF 1.x Support board?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on March 28, 2008, 07:41:29 PM
If you change both the button code to newstwo and your custom action to newstwo does it work? Your second question is really off topic so I would prefer that we continue on topic and you start another topic. Thanks.
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 28, 2008, 08:29:42 PM
Sorry about that - I'll stick to one topic.  I was getting ahead of myself.

Well, I tried renaming all 6 instances of "In The News" to "newstwo" in the code and clicking the tab created still returned me to the main page. 

I was trying variations and accidentally clicked "delete" instead of "edit" in the File Manager.  I didn't panic, because I can see my index file in the trash can.  I clicked on it to restore it, but it's not showing up in the right side of my File Manager, there's no file URL, and I can't access my forum.  I posted to the SMF 1.x Support board for help on this.
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 29, 2008, 01:43:57 AM
...Okay -- well, that was an adventure! :P

Alright, I got my index.template.php restored.  Now, I'm ready to resume working on this issue if IchBin or anyone else can figure this one out for me.

I would like to make it so that my new tab will open the page I created using the Custom Action Mod for all members and guests.  I'm going to bed now, but I'll be working on this tomorrow.  Thank you all for any assistance you can provide.
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on March 29, 2008, 01:55:30 PM
You mentioned that you changed the code to newstwo. Did you also change your custom action page to have the same action?
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 29, 2008, 04:25:22 PM
Duh...hadn't thought of that  :-[

However, I did since reading your reply.  I made all the words match between code on the index.template.php file, the entries on the Custom Actions Settings, and the code given to me by Google which I pasted into the Custom Action Settings.  But I'm still taken to the Home page when I click the new tab.

I found a Website Button Mod which adds a tab and provides for connecting to a url and installed it.  When I click the tab it created, it takes me to the page I want.  Maybe I should just stick with that solution.

I really appreciate all your help on this IchBin.  I'm sure it's my lack of knowledge and experience that's preventing me from being able to add a tab I can use.
Title: Re: How to add tabs to Core (NDT)?
Post by: unrelenting on March 29, 2008, 10:12:01 PM
Send me your php files and I'll give them a look over. Or just post the contents here.

Needed files are:

forum/index.php
forum/Themes/index.template.php
forum/Sources/newtwo.php (or whatever you named it)

If you added any sensitive information (like usernames or passwords in the files) then remove it before you post it.
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 30, 2008, 03:04:44 AM
Hey unrelenting - thank you for your offer to look over my files.  I've never done this before, so I hope I'm doing this right.  I saved the codes in Notepad and have attached them.

As I noted in my previous post, I've reverted to using the Website Tab Mod to gain access to the Google (http://auditbible.com/index.php?action=News%20Alerts) feed I made.  But I think adding tabs would work better.  The Website Tab (I've renamed News Alerts) doesn't enlarge or lighten - the Home tab stays enlarged and light blue.  Plus, it only adds one tab and I can't add any more if I need more in the future.  Otherwise, it seems to work fine.

Let me know if there's anything else you need to see.  Any advice or suggestions are welcome since I'm very new at this and don't have any idea what I'm doing and I'm sure I must be doing some things contrary to convention.
Title: Re: How to add tabs to Core (NDT)?
Post by: unrelenting on March 30, 2008, 10:40:20 AM
Quote from: 58tbird on March 30, 2008, 03:04:44 AM
Hey unrelenting - thank you for your offer to look over my files.  I've never done this before, so I hope I'm doing this right.  I saved the codes in Notepad and have attached them.

As I noted in my previous post, I've reverted to using the Website Tab Mod to gain access to the Google (http://auditbible.com/index.php?action=News%20Alerts) feed I made.  But I think adding tabs would work better.  The Website Tab (I've renamed News Alerts) doesn't enlarge or lighten - the Home tab stays enlarged ad lightened.  Plus, it only adds one tab and I can't add any more if I need more in the future.  Otherwise, it seems to work fine.

Let me know if there's anything else you need to see.  Any advice or suggestions are welcome since I'm very new at this and don't have any idea what I'm doing and I'm sure I must be doing some things contrary to convention.

I didn't realize your were using a custom action "mod". I thought you wrote your own. I don't know enough about that mod to be able to spot the problem.

My suggestion would be to try this tutorial and do your own modification using this method. It is simple and straight forward and if you run into problems with it I can help you without a doubt.

http://www.simplemachines.org/community/index.php?topic=23864.0
Title: Re: How to add tabs to Core (NDT)?
Post by: 58tbird on March 30, 2008, 01:02:15 PM
Sorry if I wasn't clear on that unrelenting. :(

I appreciate your willingness to help, and the good references you provided me.  As of this moment, the Custom Action Mod seems to be doing the trick (with a couple of issues I'm working on), so I may come back and try manually modifying using these resources later next week.  Thank you very much  ;)
Title: Re: How to add tabs to Core (NDT)?
Post by: shumar on March 30, 2008, 03:36:03 PM
Quote from: unrelenting on March 24, 2008, 09:14:32 PM
Quote from: shumar on March 17, 2008, 05:08:51 PM
hm...
How to make to call correctly one of PHP articles in TP ? With highlighting...
I give up on this and try something else, but I need help. :)

Can I make halloffame.php which will call halloffame.template.php with this code and then call that file ?
But problem is how to do that..
I put in Sources halloffame.php with this code:


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
halloffame() {
// This is gonna be needed...
loadTemplate('halloffame');
}


and make halloffame.template.php in /Themes/default/

<?php
 
global $txt$scripturl$user_info$context$modSettings$ID_MEMBER$board_info$settings$db_prefix;

////////////////////////////////////////  Enter the desired groups - in order of appearance, if listing by group
$groups_list = array(1312,);
////////////////////////////////////////

$list_by_group true;         // 'true' for separate sections by group; 'false' for consolidated list
$include_nonprimary_groups true;   // 'true' to check for group membership in additional groups; 'false' for primary only
$include_post_groups false;      // 'true' to include post-count based group in membership search
$include_moderators false;      // 'true' to include board moderators on page
$repeats_allowed false;      // 'true' to allow multiple appearances by member on page (for $list_by_group = true only)

$sort_by 'name';          // choices - 'id' ascending(default), 'posts' descending, 'name' ascending

$extra_type 'none';         // choices - 'none'(default), 'board' links, 'page' (article) links
///////////////////
// Format - $extra_links['<member userid #>'] = '<forum board #>';
//       or $extra_links['<member userid #>'] = '<TP article #>';
$extra_links = array();
$extra_links['3'] = '5';
$extra_links['2'] = '11';

$extra_label_prefix 'Page of ';   // text to precede member's name in link label for extra link
$extra_label_suffix '';      // text to append to member's name in link label for extra link

$page_title 'Hall of Fame';
$page_subtitle 'ÄŚlanovi grupe na koje smo posebno ponosni';

$moderator_group 3;
///////////////////////////////////////////////////////////////////////////////////////

$sort_ord 'mem.ID_MEMBER ASC';
if (
$sort_by == 'posts'$sort_ord 'mem.posts DESC';
if (
$sort_by == 'name'$sort_ord 'mem.realName ASC';

if ((
$extra_type != 'board') && ($extra_type != 'page')) $extra_type 'none';

if (
$include_moderators)
   {if (!
in_array($moderator_group$groups_list)) $groups_list[] = $moderator_group;}

$groups_to_use = array();
if (
$list_by_group)
   {
$groups_to_use $groups_list;}
else
   {
$groups_to_use[] = 0;}

$users_already_listed = array();
$users_already_listed[] = 0;

loadLanguage('Profile');

echo 
'<table align="center" width="96%" cellpadding="3" cellspacing="2"><tr>
   <td colspan="4"><h2 align="center">'
$page_title'</h2>
   <span class="smalltext"><h3 align="center">'
$page_subtitle'</h3></span>
</td></tr>'
;

if (!
$list_by_group)
   echo 
'<tr><td colspan="4">
</td></tr><tr width="95%" style="margin-top: 4px;">
      <td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2> </h2>
      </td></tr>'
;

foreach(
$groups_to_use as $groupnumber)
{
   
$loaded_ids = array();
   
$user_profile=array();
   
$memberContext=array();
   
$profile=array();
   
$context['TPortal']['team']=array();
  
   
// get the name of the group
   
$request db_query("
      SELECT groupName FROM 
{$db_prefix}membergroups WHERE ID_GROUP=$groupnumber"__FILE____LINE__);
   if(
mysql_num_rows($request)>0){
      
$row mysql_fetch_row($request);
      
$groupNameX=$row[0];
      
mysql_free_result($request);
   }

   if (
$list_by_group) {
      
$select_where 'mem.ID_GROUP = '.$groupnumber;
      if (
$include_nonprimary_groups$select_where .= ' OR FIND_IN_SET('.$groupnumber.', mem.additionalGroups)';
      if (
$include_post_groups$select_where .= ' OR mem.ID_POST_GROUP = '.$groupnumber;
      if (
$include_moderators && ($groupnumber == $moderator_group)) $select_where 'mem.ID_MEMBER = m.ID_MEMBER';
   }
   else {
      
$select_where 'mem.ID_GROUP IN (' implode(', '$groups_list) . ')';
      if (
$include_nonprimary_groups$select_where .= ' OR FIND_IN_SET(' implode(', mem.additionalGroups) OR FIND_IN_SET('$groups_list) . ', mem.additionalGroups)';
      if (
$include_post_groups$select_where .= ' OR mem.ID_POST_GROUP IN (' implode(', '$groups_list) . ')';
      if (
$include_moderators$select_where .= 'OR mem.ID_MEMBER = m.ID_MEMBER';
   }

   
$select_where '(' $select_where ') AND mem.ID_MEMBER NOT IN (' implode(', '$users_already_listed) . ')';

   
// Load the member's data.
   
$request db_query("
      SELECT   IFNULL(lo.logTime, 0) AS isOnline, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType,
         mem.personalText, mem.avatar, mem.additionalGroups, mem.ID_MEMBER as memnum, mem.memberName, mem.ID_GROUP,
         mem.usertitle, mem.karmaBad, mem.karmaGood, mem.realName, mem.lastLogin, mem.websiteTitle,
         mem.websiteUrl, mem.location, mem.posts, them.value AS CP4, m.ID_MEMBER as modmem, g.groupName
      FROM (
{$db_prefix}members AS mem)
         LEFT JOIN 
{$db_prefix}moderators AS m ON (m.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}membergroups AS g ON (g.ID_GROUP = mem.ID_GROUP)
         LEFT JOIN 
{$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
         LEFT JOIN 
{$db_prefix}themes AS them ON (mem.ID_MEMBER = them.ID_MEMBER AND them.variable = 'CP4' AND them.ID_THEME=1)
      WHERE 
$select_where
      GROUP BY mem.ID_MEMBER
      ORDER BY 
$sort_ord"__FILE____LINE__);
   
$new_loaded_ids = array();
   
$member_count 0;

   while (
$row mysql_fetch_assoc($request))
   {
      if (!
$repeats_allowed$users_already_listed[$row['memnum']] = $row['memnum'];

      
$member_count += 1;

      
$avatar_width '';
      
$avatar_height '';
      if(
$context['browser']['is_ie6']) $avatar_width 'width="' $modSettings['avatar_max_width_external'] . '"';

      
$context['TPortal']['team'][] = array(
         
'username' => $row['memberName'],
         
'usertitle' => $row['usertitle'],
         
'name' => $row['realName'],
         
'groupname' => ($groupnumber == 0) ? $row['groupName'] : $groupNameX ,
         
'posts' => $row['posts'],
         
'karmabad' => $row['karmaBad'],
         
'karmagood' => $row['karmaGood'],
         
'location' => $row['location'],
         
'href' => $scripturl '?action=profile;u=' $row['memnum'],
         
'link' => '<a href="' $scripturl '?action=profile;u=' $row['memnum'] . '" title="' $txt[92] . ' ' $row['realName'] . '">' $row['realName'] . '</a>',
         
'blurb' => $row['personalText'],
         
'avatar' => array(
            
'name' => $row['avatar'],
            
'image' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > '<img  src="' . (empty($row['attachmentType']) ? $scripturl '?action=dlattach;attach=' $row['ID_ATTACH'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) . '" alt="" style="max-height:280px;max-width:180px;" border="0" />' '') : (stristr($row['avatar'], 'http://') ? '<img src="' $row['avatar'] . '"' $avatar_width $avatar_height ' alt="" style="max-height:280px;max-width:180px;" border="0" />' '<img src="' $modSettings['avatar_url'] . '/' htmlspecialchars($row['avatar']) . '" alt="" style="max-height:280px;max-width:180px;" border="0" />'),
            
'href' => $row['avatar'] == '' ? ($row['ID_ATTACH'] > ? (empty($row['attachmentType']) ? $scripturl '?action=dlattach;attach=' $row['ID_ATTACH'] . ';type=avatar' $modSettings['custom_avatar_url'] . '/' $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' $row['avatar']),
            
'url' => $row['avatar'] == '' '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' $row['avatar'])
         ),
         
'last_login' => empty($row['lastLogin']) ? $txt['never'] : timeformat($row['lastLogin']),
         
'last_login_timestamp' => empty($row['lastLogin']) ? forum_time(0$row['lastLogin']),
         
'website' => array(
            
'title' => $row['websiteTitle'],
            
'url' => $row['websiteUrl']
         ),
         
'online' => array(
            
'is_online' => $row['isOnline'],
            
'text' => &$txt[$row['isOnline'] ? 'online2' 'online3'],
            
'image_href' => $settings['images_url'] . '/' . ($row['isOnline'] ? 'useron' 'useroff') . '.gif',
         ),
         
'CP4' => $row['CP4'],
         
'member_page' => ($extra_type == 'none') ? '' : empty($extra_links[$row['memnum']]) ? '' $extra_links[$row['memnum']],
      );

   }
   
mysql_free_result($request);

   if (
$member_count 0)
   {
      if (
$list_by_group)
      echo 
'<tr><td colspan="4">
</td></tr><tr width="95%" style="margin-top: 4px;">
         <td class="windowbg3" colspan="4" style="border-top: 2px solid #d0d0d0; padding-top: 4px; "><h2 align="center">' 
$groupNameX '</h2>
         </td></tr>'
;

      echo 
'<tr>';
           
$newrow=0;

      foreach(
$context['TPortal']['team'] as $team)
           {
         echo 
'
            <td valign="top" width="18%">'
.$team['avatar']['image'].'</td>';

         echo 
'   <td valign="top" class="middletext" style="padding: 2px;">';

            echo 
'<h2 style="margin-top: 0; margin-bottom: 4px;">'.$team['link'].'</h2>';

//            echo ''. $team['usertitle'].'
//';

//            if (!$list_by_group)
//               echo ''.$txt[87].': '.$team['groupname'].'
//';

            
if ($modSettings['karmaMode'] == '1')
               echo 
''$modSettings['karmaLabel'], ' '$team['karmagood'] - $team['karmabad'], '
'
;
            elseif (
$modSettings['karmaMode'] == '2')
               echo 
''$modSettings['karmaLabel'], ' +'$team['karmagood'], ' | -'$team['karmabad'], '
'
;

//            echo ''.$txt['lastLoggedIn'].': '.$team['last_login'].'
//';



//            echo !empty($team['location']) ? ''.$txt[227].': '.$team['location'].'
//' : '';

//          echo !empty($team['website']['title']) ? ''.$txt[96].': <a href="'.$team['website']['url'].'" target="_blank">'.$team['website']['title'].'</a>
//' : '';


//            echo !empty($team['blurb']) ? '- '.$team['blurb'].'
//' : '';

            
echo !empty($team['CP4']) ? $team['CP4'].'
'';

            if ((
$extra_type == 'board') && !empty($team['member_page']))
               echo 
'<a href="' $scripturl '?board=' $team['member_page'] . '">'$extra_label_prefix $team['name'] . $extra_label_suffix '</a>
'
;
            if ((
$extra_type == 'page') && !empty($team['member_page']))
               echo 
'<a href="' $scripturl '?page=' $team['member_page'] . '">'$extra_label_prefix $team['name'] . $extra_label_suffix '</a>
'
;

         echo 
'
            </td>'
;

         
$newrow++;
         if(
$newrow>1){
            
$newrow=0;
            echo 
'</tr><tr><td colspan="4"></td></tr><tr>';
         }
           }
      if(
$newrow=1) echo '<td colspan="2"></td>';
      echo 
'</tr>';
   }

}
echo 
'</table>';
?>


Also I make changes in index.template:

if (in_array($context['current_action'], array('gallery', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'invite', 'forum', 'tpadmin', 'halloffame')))


//Hall of fame menu button
if ($context[$current_action == 'halloffame'])
$current_action = 'halloffame';
echo ($current_action=='halloffame' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'halloffame' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=halloffame">Hall of Fame</a>
</td>' , $current_action == 'halloffame' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

but how to make that correct file is called when I click on link ?

Did you add the:


'halloffame' => array('halloffame.php', 'hallofffame'),


to your http://sitename.com/forum/index.php file?

http://www.simplemachines.org/community/index.php?topic=23864.msg189057#msg189057
I added that to index.php. but then I have 2 headers. Above and below hall of fame...
Title: Re: How to add tabs to Core (NDT)?
Post by: tom155 on April 12, 2008, 08:21:34 AM
I was able to make a new tab for a guest book but for some reason I can't put the tab were I want like here (http://www.geocities.com/toomyg155/tabs.jpg)
it is stuck between the Home tab and Help.How do I change this ?

You can check it out here if you like (http://tomswebplace.dyndns.org/index.php)

Edit: I see the picture didnt turn out good I guess you have to click the link and you can see were I mean as for the Guestbook tab

did i do this right
if (in_array($context['current_action'], array('usercp','links', 'gallery','search', 'arcade', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'guestBook', 'help', 'pm')))

Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on April 12, 2008, 09:55:10 AM
we need rest of the section if possible :)
Title: Re: How to add tabs to Core (NDT)?
Post by: tom155 on April 12, 2008, 09:59:24 AM
Well I did every thing as discribed in this thread but changed the word chat with guestbook in the code.
Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on April 12, 2008, 10:03:23 AM
i need to see the actual tab code from your index.template.php to be able to help more :)
Title: Re: How to add tabs to Core (NDT)?
Post by: tom155 on April 12, 2008, 10:16:59 AM
OK hope I do this right

if (in_array($context['current_action'], array('usercp','links', 'gallery','search', 'arcade', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'guestBook', 'help', 'pm')))

if ($context['current_action'] == 'GuestBook')

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




Thats everything I added into index.template.php
Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on April 12, 2008, 10:54:02 AM
// Show the [guestBook] button.
    echo ($current_action=='guestBook' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , ' <td valign="top" class="maintab_' , $current_action == 'guestBook' ? 'active_back' : 'back' , '"> <a href="http://tomswebplace.dyndns.org/guestbook/">guestBook</a> </td>' , $current_action == 'guestBook' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


this needs to be moved ... can you put all of your index.template.php and i can help you better :)
Title: Re: How to add tabs to Core (NDT)?
Post by: tom155 on April 12, 2008, 11:02:41 AM
Here's all of the file

<?php
// Version: 1.1; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], (!empty($context['description']) ? ' - '$context['description'] : '') , '" />', empty($context['robot_no_index']) ? '' '
<meta name="robots" content="noindex" />'
'
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>'
;
//Display ads on the top of the page
if (function_exists("show_topofpageAds"))
{
$ads show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}



echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' '''>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">'
;

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">'
$context['forum_name'], '</span>';
else
echo '
<img src="'
$settings['header_logo_url'], '" style="margin: 4px;" alt="'$context['forum_name'], '" />';

echo '
</td>
<td align="right" class="catbg">
<img src="'
$settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>
</tr>
</table>'
;


// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>'
;

if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> '
$txt['hello_member_ndt'], ' <b>'$context['user']['name'] , '</b></span>
</td>'
;

// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' 
$context['current_time'], '</span>';

// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>'
;

if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">'
$context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">'
;
  
if ((isset(
$_SESSION['unread_sound']) && $_SESSION['unread_sound'] < $context['user']['unread_messages']) || (!isset($_SESSION['unread_sound']) && $context['user']['unread_messages'] >= 1))
{
echo '
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="     http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="gotmail" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="gotmail.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="gotmail.swf" quality="high" bgcolor="#ffffff" width="1" height="1" name="gotmail" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>'
;

// Save a session so it wont loop
$_SESSION['unread_sound'] = $context['user']['unread_messages'];
}
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a> <br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}

// ---- Begin modification - Errors on top of page ----
// If they're an admin, show them how many errors we have in the log
if ($context['user']['is_admin'])
{
// Not set? Assume 0, then
if (!isset($context['error_log_count']))
$context['error_log_count'] = 0;
// No querystring set? Assume nothing
if (!isset($_SERVER['QUERY_STRING']))
$_SERVER['QUERY_STRING'] = '';

echo '
<br />'
, ($context['error_log_count'] == $txt['error_log_thereis'] : $txt['error_log_thereare']), ' '$context['error_log_count'], ' ', ($context['error_log_count'] == $txt['error_log_error'] : $txt['error_log_errors']), ' '$txt['error_log_inlog'], '<br />
'
$txt['error_log_thispage'], ' <span id="error_count">0 '$txt['error_log_errors'], ' '$txt['error_log_were'], '</span> '$txt['error_log_encountered'], ' (<a href="'$scripturl'?show_debug=1;'$_SERVER['QUERY_STRING'], '">debug</a>)<br />';
}
// ---- End modification ----
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="43200">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
<span class="middletext">'
$txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}

echo '
</td>'
;
//Welcome Ads
if (function_exists("show_welcomeAds"))
{
$ads show_welcomeAds();
if(!empty($ads))
{
echo '<td class="windowbg2">';
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
echo '</td>';
}
unset($ads);
}
echo '

</tr>
</table>
</td>
</tr>
</table>'
;

echo '
<table id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"'' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>'
$txt[102], '</b>: '$context['random_news_line'], '</span>
</td>'
;


// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
</div>'
;


// Show the menu here, according to the menu sub template.
template_menu();
//Below the menu ads
if (function_exists("show_indexAds") && function_exists("show_towerleftAds") && function_exists("show_towerrightAds"))
{
$ads show_indexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

//Tower left Ads
$ads show_towerleftAds();
if(!empty($ads))
echo '<table><tr><td valign="top">'$ads['type']==$ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';

unset($ads);
//Tower Right Ads
$ads show_towerrightAds();
if(!empty($ads))
echo '<table><tr><td width="100%" valign="top">';
unset($ads);
}




// The main content should go here.
echo '
<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '
</div>'
;


//Close table for towerright ads
if (function_exists("show_towerrightAds") && function_exists("show_towerleftAds") && function_exists("show_bottomAds"))
{
$ads show_towerrightAds();
if(!empty($ads))
echo '</td><td valign="top">'$ads['type']==$ads['content'] : eval($ads['content']) ,'</td></tr></table>'

unset($ads);
//Close table for towerleft ads
$ads show_towerleftAds();
if(!empty($ads))
echo '</td></tr></table>';
unset($ads);

//Show ads on the bottom of the page
$ads show_bottomAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), '
<span class="smalltext" style="display: inline; visibility: visible; font-family: Verdana, Arial, sans-serif;"> | <a href="'
.$scripturl.'?action=sitemap">Sitemap</a></span>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

if (isset($context['ob_googlebot_stats']))
echo '
<br /><br /><span class="smalltext">'
$txt['ob_googlebot_stats_lastvisit'], timeformat($context['ob_googlebot_stats']['Googlebot']['lastvisit']), '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

echo '
</div>'
;

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>';

// Are we an admin, and do we have any errors?
if ($context['user']['is_admin'] && isset($context['error_count']) && $context['error_count'] != 0)
// Change the error text at the top of the page
echo '
<script type="text/javascript" language="JavaScript">
setInnerHTML(document.getElementById("error_count"), "'
$context['error_count'], ' ', ($context['error_count'] == $txt['error_log_error'] . ' ' $txt['error_log_was']: $txt['error_log_errors'] . ' ' $txt['error_log_were']), '");
</script>'
;

echo '
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// Show WebsiteButton
function show_websiteButton()
{
global $context$txt$modSettings;

echo $context['browser']['is_ie4'] ? '<td class="maintab_active_' $first '">&nbsp;</td>' '''
<td valign="top" class="maintab_back">
<a href="'
, isset($modSettings['websiteButton_url']) ? $modSettings['websiteButton_url'] : 'http://www.roadrunner.cx''" alt="', isset($txt['websiteButtonAlt_txt']) ? $txt['websiteButtonAlt_txt'] : 'Website''">',
isset($txt['websiteButton_txt']) ? $txt['websiteButton_txt'] : 'Website''</a>
</td>'
;
}
// Show chatroomButton
function show_chatroomButton()
{
global $context$txt$modSettings;

if (!$modSettings['chatroomButton_ga'] && $context['user']['is_guest']) return;

echo $context['browser']['is_ie4'] ? '<td class="maintab_active_' $first '">&nbsp;</td>' '''
<td valign="top" class="maintab_back">
<a href="'
, isset($modSettings['chatroomButton_url']) ? $modSettings['chatroomButton_url'] : 'http://www.roadrunner.cx''" target="_blank" alt="', isset($txt['chatroomButtonAlt_txt']) ? $txt['chatroomButtonAlt_txt'] : 'Chatroom''">',
isset($txt['chatroomButton_txt']) ? $txt['chatroomButton_txt'] : 'Chatroom''</a>
</td>'
;
}
// 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''managegames''arcadesettings''arcadecategory''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('usercp','links''gallery','search''arcade''admin''calendar''profile''mlist''register''login''guestBook''help''pm')))
$current_action $context['current_action'];
if ($context['current_action'] == 'usercp')
$current_action 'profile';
      if (
$context['current_action'] == 'search2')
$current_action 'search';
if ($context['current_action'] == 'GuestBook')
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 '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="maintab_' 
$first '">&nbsp;</td>';

// Show the [website] button.

show_websiteButton();
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'home' 'active_back' 'back' '">
<a href="'
$scripturl'">' $txt[103] , '</a>
</td>' 
$current_action == 'home' '<td class="maintab_active_' $last '">&nbsp;</td>' '';
// Show the [guestBook] button.
    
echo ($current_action=='guestBook' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' ' <td valign="top" class="maintab_' $current_action == 'guestBook' 'active_back' 'back' '"> <a href="http://tomswebplace.dyndns.org/guestbook/">guestBook</a> </td>' $current_action == 'guestBook' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

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

    echo ($current_action == 'arcade' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'arcade' 'active_back' 'back' '">
<a href="'
$scripturl'?action=arcade">' $txt['arcade'] , '</a>
</td>' 
$current_action == 'arcade' '<td class="maintab_active_' $last '">&nbsp;</td>' '';// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
<a href="'
$scripturl'?action=search">' $txt[182] , '</a>
</td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'admin' 'active_back' 'back' '">
<a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
</td>' 
$current_action == 'admin' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'profile' 'active_back' 'back' '">
<a href="'
$scripturl'?action=usercp">' $txt['usercp'] , '</a>
      
</td>' 
$current_action == 'profile' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'pm' 'active_back' 'back' '">
<a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
</td>' 
$current_action == 'pm' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
<a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
</td>' 
$current_action == 'calendar' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
<a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
</td>' 
$current_action == 'mlist' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// the [links] button
if ($context['allow_view_smflinks'])
echo ($current_action == 'links' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'links' 'active_back' 'back' '">
<a href="'
$scripturl'?action=links">' $txt['smflinks_menu']  , '</a>
</td>' 
$current_action == 'links' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// the [SMF Gallery] button
if ($context['allow_smfgallery_view'])
echo ($current_action == 'gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'gallery' 'active_back' 'back' '">
<a href="'
$scripturl'?action=gallery">' $txt['smfgallery_menu']  , '</a>
</td>' 
$current_action == 'gallery' '<td class="maintab_active_' $last '">&nbsp;</td>' '';



// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'login' 'active_back' 'back' '">
<a href="'
$scripturl'?action=login">' $txt[34] , '</a>
</td>' 
$current_action == 'login' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'register' 'active_back' 'back' '">
<a href="'
$scripturl'?action=register">' $txt[97] , '</a>
</td>' 
$current_action == 'register' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


// Show the [chatroom] button.

show_chatroomButton();
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
<td valign="top" class="maintab_' 
$current_action == 'logout' 'active_back' 'back' '">
<a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
</td>' 
$current_action == 'logout' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

// The end of tab section.
echo '
<td class="maintab_' 
$last '">&nbsp;</td>
</tr>
</table>'
;

}

// 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']] . '</a>';

$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>';
}

?>
Title: Re: How to add tabs to Core (NDT)?
Post by: Deaks on April 12, 2008, 11:15:22 AM
find

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


and move to before

// The end of tab section.
Title: Re: How to add tabs to Core (NDT)?
Post by: tom155 on April 12, 2008, 11:29:05 AM
Thanks RunicWarrior it worked like a charm  ;D
Title: Re: How to add tabs to Core (NDT)?
Post by: blouogies20 on April 13, 2008, 04:37:57 PM
Does this work with the visionsmc theme also?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on April 14, 2008, 01:18:46 PM
The process should be the same but with slightly different code.
Title: Re: How to add tabs to Core (NDT)?
Post by: blouogies20 on April 14, 2008, 02:17:28 PM
slightly different code ?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on April 15, 2008, 08:43:51 PM
Quote from: blouogies20 on April 14, 2008, 02:17:28 PM
slightly different code ?
Yes, you'll notice that not all themes are coded exactly the same. But if you look for code that is similar you'll find its possible. First thing you should check though, is the theme where the topic was released. Its almost always done in the theme release topic where the authors support their own themes.
Title: Re: How to add tabs to Core (NDT)?
Post by: blouogies20 on April 20, 2008, 06:34:22 AM
Hey Guys

Thanks for the help but I have sorted the button out!!!!
I have changed to TP!!!  And it is very easy to add a link there!!!!
Title: Re: How to add tabs to Core (NDT)?
Post by: tpet96 on May 08, 2008, 07:49:28 PM
Has this changed for 2.0 B3.1?  I cannot seem to get it to work properly. 
Title: Re: How to add tabs to Core (NDT)?
Post by: Zidnen on May 12, 2008, 02:47:27 PM
probably, as i cant make a menu either  :'(
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on May 16, 2008, 07:53:03 PM
Move:

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


to before:

   // Show the [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '">' , $txt[103] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: meast on May 28, 2008, 10:45:09 PM
Added a button for my Coppermine gallery. Just took the Calendar button into Photoshop and altered it. It is exactly the same height as all the rest of the buttons in the menu, but for some reason, it appears two pixels higher than all the rest. I am attaching a ZIP of the Calendar button, the new Gallery button, my index.php file, my template.php file and a screen shot of how the menu bar looks.

Any ideas??

TIA
Title: Re: How to add tabs to Core (NDT)?
Post by: unrelenting on May 30, 2008, 11:28:07 PM
Quote from: meast on May 28, 2008, 10:45:09 PM
Added a button for my Coppermine gallery. Just took the Calendar button into Photoshop and altered it. It is exactly the same height as all the rest of the buttons in the menu, but for some reason, it appears two pixels higher than all the rest. I am attaching a ZIP of the Calendar button, the new Gallery button, my index.php file, my template.php file and a screen shot of how the menu bar looks.

Any ideas??

TIA

You didn't center the picture exactly how the others were even thought the height was the same.

Try this one...
Title: Re: How to add tabs to Core (NDT)?
Post by: meast on May 31, 2008, 03:44:06 AM
Nope. Same deal. Two pixels too high still. Thanks, though.

Any other takers?
Title: Re: How to add tabs to Core (NDT)?
Post by: unrelenting on May 31, 2008, 11:15:32 AM
Quote from: meast on May 31, 2008, 03:44:06 AM
Nope. Same deal. Two pixels too high still. Thanks, though.

Any other takers?

The index.template.php file you posted didn't even contain the line for the gallery so there was no way to see the code. A link to your site would be helpful as well.
Title: Re: How to add tabs to Core (NDT)?
Post by: meast on May 31, 2008, 02:22:28 PM
You're right. My apologies. I went back and looked at the proper index.template.php and found the issue (margin=2). Thanks anyway, guys!
Title: Re: How to add tabs to Core (NDT)?
Post by: assam_siddibapa on June 23, 2008, 09:03:56 AM
For me i was able to add
  thanks alot
Title: Re: How to add tabs to Core (NDT)?
Post by: The 12th Doctor on July 03, 2008, 11:32:29 AM
Managed to do this however the problem im having is that some links are working and showing, and others arent. Well 2 are showing, and 3 aren't, however 1 of the ones that doesnt show on the main index, shows in the Admin panel....Well confusing....

The gap is there for the link, but and works as a link in FF but not IE, however the space where the link should be is there in IE.

I did the exact same for all the links ive added, so i dont know whats gone on. Confusing! >:( :o

If someone knows whats happening and could help that would be great. If you would like to see what i mean the address is http://wiilovegames.xlphp.net

Jon
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 03, 2008, 03:25:13 PM
Remember that this is for the default theme, and most likely the code will be different in custom themes. YOu should seek help from the theme author on custom themes. When having a problem such as this, its best to post your code in the authors topic so that he can see what you did wrong.
Title: Re: How to add tabs to Core (NDT)?
Post by: The 12th Doctor on July 03, 2008, 05:23:53 PM
Quote
<?php
// Version: 1.1; index

/*    This template is, perhaps, the most important template in the theme. It
    contains the main template layer that displays the header and footer of
    the forum, namely with main_above and main_below. It also contains the
    menu sub template, which appropriately displays the menu; the init sub
    template, which is there to set the theme up; (init can be missing.) and
    the linktree sub template, which sorts out the link tree.

    The init sub template should load any data and set any hardcoded options.

    The main_above sub template is what is shown above the main content, and
    should contain anything that should be shown up there.

    The main_below sub template, conversely, is shown after the main content.
    It should probably contain the copyright statement and some other things.

    The linktree sub template should display the link tree, using the data
    in the $context['linktree'] variable.

    The menu sub template should display all the relevant buttons the user
    wants and or needs.

    For more information on the templating system, please see the site at:
    http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
    global $context, $settings, $options, $txt;

    /* Use images from default theme when using templates from the default theme?
        if this is 'always', images from the default theme will be used.
        if this is 'defaults', images from the default theme will only be used with default templates.
        if this is 'never' or isn't set at all, images from the default theme will not be used. */
    $settings['use_default_images'] = 'never';

    /* What document type definition is being used? (for font size and other issues.)
        'xhtml' for an XHTML 1.0 document type definition.
        'html' for an HTML 4.01 document type definition. */
    $settings['doctype'] = 'xhtml';

    /* The version this template/theme is for.
        This should probably be the version of SMF it was created for. */
    $settings['theme_version'] = '1.1';

    /* Set a setting that tells the theme that it can render the tabs. */
    $settings['use_tabs'] = true;

    /* Use plain buttons - as oppossed to text buttons? */
    $settings['use_buttons'] = true;

    /* Show sticky and lock status seperate from topic icons? */
    $settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;

    // Show right to left and the character set for ease of translating.
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '><head>
    <meta http-equiv="Content-Type" content="text/html; charset=', $context['character_set'], '" />
    <meta name="description" content="', $context['page_title'], '" />', empty($context['robot_no_index']) ? '' : '
    <meta name="robots" content="noindex" />', '
    <meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
    <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
    <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
        var smf_theme_url = "', $settings['theme_url'], '";
        var smf_images_url = "', $settings['images_url'], '";
        var smf_scripturl = "', $scripturl, '";
        var smf_iso_case_folding = ', $context['server']['iso_case_folding'] ? 'true' : 'false', ';
        var smf_charset = "', $context['character_set'], '";
    // ]]></script>
    <title>', $context['page_title'], '</title>';

    // The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
    echo '
    <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
    <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';

    /* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
        Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
        Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
        Standards compliance mode happens when you use xhtml... */
    if ($context['browser']['needs_size_fix'])
        echo '
    <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/fonts-compat.css" />';

    // Show all the relative links, such as help, search, contents, and the like.
    echo '
<link rel="forum" href="', $scripturl, '?action=forum" target="_blank" />
<link rel="arcade" href="', $scripturl, '?action=arcade" target="_blank" />
    <link rel="help" href="', $scripturl, '?action=help" target="_blank" />
    <link rel="search" href="' . $scripturl . '?action=search" />
    <link rel="contents" href="', $scripturl, '" />';

    // If RSS feeds are enabled, advertise the presence of one.
    if (!empty($modSettings['xmlnews_enable']))
        echo '
    <link rel="alternate" type="application/rss+xml" title="', $context['forum_name'], ' - RSS" href="', $scripturl, '?type=rss;action=.xml" />';

    // If we're viewing a topic, these should be the previous and next topics, respectively.
    if (!empty($context['current_topic']))
        echo '
    <link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />
    <link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';

    // If we're in a board, or a topic for that matter, the index will be the board's index.
    if (!empty($context['current_board']))
        echo '
    <link rel="index" href="' . $scripturl . '?board=' . $context['current_board'] . '.0" />';

    // We'll have to use the cookie to remember the header...
    if ($context['user']['is_guest'])
        $options['collapse_header'] = !empty($_COOKIE['upshrink']);

    // Output any remaining HTML headers. (from mods, maybe?)
    echo $context['html_headers'], '

    <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
        var current_header = ', empty($options['collapse_header']) ? 'false' : 'true', ';

        function shrinkHeader(mode)
        {';

    // Guests don't have theme options!!
    if ($context['user']['is_guest'])
        echo '
            document.cookie = "upshrink=" + (mode ? 1 : 0);';
    else
        echo '
            smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "', $context['session_id'], '");';

    echo '
            document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

            document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
            document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

            current_header = mode;
        }
    // ]]></script>';

    // the routine for the info center upshrink
    echo '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
            var current_header_ic = ', empty($options['collapse_header_ic']) ? 'false' : 'true', ';

            function shrinkHeaderIC(mode)
            {';

    if ($context['user']['is_guest'])
        echo '
                document.cookie = "upshrinkIC=" + (mode ? 1 : 0);';
    else
        echo '
                smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "', $context['session_id'], '");';

    echo '
                document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

                document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

                current_header_ic = mode;
            }
        // ]]></script>
</head>
<body>
<a name="top"></a>';


//These are the two side background images.
echo '
    <div id="bgLeft">
        <div id="bgRight">';
       
//This is the green circle background.
echo '
            <div id="bgCircles">';
       
//This is the width controlling div. Change in the style.css to set.
echo '
            <div id="widthControl">';
           
//This is the optional logo at the top. It can be the default one or your own.
echo '
                <div style="text-align: left;">';
               
    if (empty($settings['header_logo_url']))
        echo '
                <img src="', $settings['images_url'], '/x360e_toplogo.gif" alt="Xbox360 Elite" />';
    else
        echo '
                <img src="', $settings['header_logo_url'], '" alt="', $context['forum_name'], '" />';
               
echo '
                </div>';
               
//Start the xbox like template.
echo '
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td width="4" height="139"><img src="', $settings['images_url'], '/layout_leftcap.gif" width="4" height="139" alt="" /></td>
            <td width="100%" height="139" class="layout-topCenter" align="left" valign="middle"><div id="layout-topLeft"><span>', $context['forum_name'], '</span></div></td>
            <td width="275" height="139"><img src="', $settings['images_url'], '/layout_topright.gif" width="275" height="139" alt="" /></td>
            <td width="4" height="139"><img src="', $settings['images_url'], '/layout_rightcap.gif" width="4" height="139" alt="" /></td>
        </tr>';
       
echo '
        <tr>
            <td width="4"></td>
            <td colspan="2" width="100%" align="left" valign="top" class="layout-content">';

           
    // Show the menu here, according to the menu sub template.
    template_menu();

    echo '
    <div class="tborder" ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' : '', '>';


    // display user name
    echo '
        <table width="100%" cellpadding="0" cellspacing="0" border="0" >
            <tr>';

    if($context['user']['is_logged'])
        echo '
                <td class="titlebg2" height="32">
                    <span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>
                </td>';

    // display the time
    echo '
                <td class="titlebg2" height="32" align="right">
                    <span class="smalltext">' , $context['current_time'], '</span>';

    // this is the upshrink button for the user info section
    echo '
                    <a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="', $settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
                </td>
            </tr>
            <tr id="upshrinkHeader"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
                <td valign="top" colspan="2">
                    <table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
                        <tr>';

    if (!empty($context['user']['avatar']))
        echo '
                            <td class="windowbg" valign="middle">', $context['user']['avatar']['image'], '</td>';

    echo '
                            <td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">';

    // If the user is logged in, display stuff like their name, new messages, etc.
    if ($context['user']['is_logged'])
    {
        echo '
                                <a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> <br />
                                <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';

    }
    // Otherwise they're a guest - send them a lovely greeting...
    else
        echo $txt['welcome_guest'];

    // Now, onto our second set of info, are they logged in again?
    if ($context['user']['is_logged'])
    {
        // Is the forum in maintenance mode?
        if ($context['in_maintenance'] && $context['user']['is_admin'])
            echo '
                                <b>', $txt[616], '</b><br />';

        // Are there any members waiting for approval?
        if (!empty($context['unapproved_members']))
            echo '
                                ', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '<br />';

        // Show the total time logged in?
        if (!empty($context['user']['total_time_logged_in']))
        {
            echo '
                                ', $txt['totalTimeLogged1'];

            // If days is just zero, don't bother to show it.
            if ($context['user']['total_time_logged_in']['days'] > 0)
                echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

            // Same with hours - only show it if it's above zero.
            if ($context['user']['total_time_logged_in']['hours'] > 0)
                echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

            // But, let's always show minutes - Time wasted here: 0 minutes ;).
            echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
        }
        echo '                </span>';
    }
    // Otherwise they're a guest - this time ask them to either register or login - lazy bums...
    else
    {
        echo '                </span>
                                <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/sha1.js"></script>

                                <form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
                                    <input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
                                    <select name="cookielength">
                                        <option value="60">', $txt['smf53'], '</option>
                                        <option value="1440">', $txt['smf47'], '</option>
                                        <option value="10080">', $txt['smf48'], '</option>
                                        <option value="43200">', $txt['smf49'], '</option>
                                        <option value="-1" selected="selected">', $txt['smf50'], '</option>
                                    </select>
                                    <input type="submit" value="', $txt[34], '" /><br />
                                    <span class="middletext">', $txt['smf52'], '</span>
                                    <input type="hidden" name="hash_passwrd" value="" />
                                </form>';
    }

    echo '
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>';

    echo '
        <table id="upshrinkHeader2"', empty($options['collapse_header']) ? '' : ' style="display: none;"', ' width="100%" cellpadding="4" cellspacing="0" border="0">
            <tr>';

    // Show a random news item? (or you could pick one from news_lines...)
    if (!empty($settings['enable_news']))
        echo '
                <td width="90%" class="titlebg2">
                    <span class="smalltext"><b>', $txt[102], '</b>: ', $context['random_news_line'], '</span>
                </td>';
    echo '
                <td class="titlebg2" align="right" nowrap="nowrap" valign="top">
                    <form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
                        <a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
                        <input type="text" name="search" value="" style="width: 190px;" />&nbsp;
                        <input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
                        <input type="hidden" name="advanced" value="0" />';

    // Search within current topic?
    if (!empty($context['current_topic']))
        echo '
                        <input type="hidden" name="topic" value="', $context['current_topic'], '" />';

        // If we're on a certain board, limit it to this board ;).
    elseif (!empty($context['current_board']))
        echo '
                        <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

    echo '
                    </form>
                </td>
            </tr>
        </table>
    </div>';


    // The main content should go here.
    echo '
    <div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">';
}

function template_main_below()
{
    global $context, $settings, $options, $scripturl, $txt;

    echo '
    </div>';
   
//The rest of the Xbox360 template.
echo '
            </td>
            <td width="4"></td>
        </tr>';
       
echo '
        <tr>
            <td width="4" height="47"><img src="', $settings['images_url'], '/layout_bleftcap.gif" width="4" height="47" alt="" /></td>
            <td width="100%" height="47" class="layout-bottomCenter"><div id="layout-bottomLeft">&nbsp;</div></td>
            <td width="275" height="47"><div id="layout-bottomRight"><a href="#top"><img src="', $settings['images_url'], '/backtotop.gif" alt="Back To Top" /></a></div></td>
            <td width="4" height="47"><img src="', $settings['images_url'], '/layout_brightcap.gif" width="4" height="47" alt="" /></td>
        </tr>
    </table>';
   
    // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
    echo '

    <div id="footerarea" style="text-align: center; padding-bottom: 1ex;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
            function smfFooterHighlight(element, value)
            {
                element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
            }
        // ]]></script>
        <table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
            <tr>
                <td colspan="3" class="smalltext" align="center">Theme by <a href="http://www.webtechnica.net/" target="_blank">Webtechnica.net</a></td>
            </tr>
            <tr>
                <td width="28%" valign="middle" class="smalltext" align="', !$context['right_to_left'] ? 'right' : 'left', '">
                    <a href="http://www.mysql.com/" target="_blank">MySQL</a>
                    <a href="http://www.php.net/" target="_blank">PHP</a>
                </td>
                <td valign="middle" align="center" style="white-space: nowrap;">
                    ', theme_copyright(), '
                </td>
                <td width="28%" valign="middle" align="', !$context['right_to_left'] ? 'left' : 'right', '" class="smalltext">
                    <a href="http://validator.w3.org/check/referer" target="_blank">XHTML 1.0</a>
                    <a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank">CSS</a>
                </td>
            </tr>
        </table>';

        // Show the load time?
    if ($context['show_load_time'])
        echo '
        <span class="smalltext">', $txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

    // This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
    if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
    {
        // The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
        echo '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';

        // Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
        if ($context['browser']['is_safari'])
            echo '
            window.addEventListener("load", smf_codeFix, false);

            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = 0; i < codeFix.length; i++)
                {
                    if ((codeFix.className == "code" || codeFix.className == "post" || codeFix.className == "signature") && codeFix.offsetHeight < 20)
                        codeFix
.style.height = (codeFix.offsetHeight + 20) + "px";
                }
            }';
        elseif ($context['browser']['is_firefox'])
            echo '
            window.addEventListener("load", smf_codeFix, false);
            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = 0; i < codeFix.length; i++)
                {
                    if (codeFix
.className == "code" && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0))
                        codeFix
.style.overflow = "scroll";
                }
            }';           
        else
            echo '
            var window_oldOnload = window.onload;
            window.onload = smf_codeFix;

            function smf_codeFix()
            {
                var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

                for (var i = codeFix.length - 1; i > 0; i--)
                {
                    if (codeFix
.currentStyle.overflow == "auto" && (codeFix.currentStyle.height == "" || codeFix.currentStyle.height == "auto") && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0) && (codeFix.offsetHeight != 0 || codeFix.className == "code"))
                        codeFix
.style.height = (codeFix.offsetHeight + 36) + "px";
                }

                if (window_oldOnload)
                {
                    window_oldOnload();
                    window_oldOnload = null;
                }
            }';

        echo '
        // ]]></script>';
    }

    echo '
    </div>';
   
//End the width control for the template.
echo '
            </div>';

    // The following will be used to let the user know that some AJAX process is running
    echo '
    <div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>';
   
//End the circle bg.
echo '
            </div>';
   
//End the two side background images.
echo '
        </div>
    </div>';
   
//End the body.
echo '
</body></html>';
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
    global $context, $settings, $options;

    echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

    // Each tree item has a URL and name. Some may have extra_before and extra_after.
    foreach ($context['linktree'] as $link_num => $tree)
    {
        // Show something before the link?
        if (isset($tree['extra_before']))
            echo $tree['extra_before'];

        // Show the link, including a URL if it should have one.
        echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

        // Show something after the link...?
        if (isset($tree['extra_after']))
            echo $tree['extra_after'];

        // Don't show a separator for the last one.
        if ($link_num != count($context['linktree']) - 1)
            echo '&nbsp;<span style="font-weight:bold;color:#789e2c;">/</span>&nbsp;';
    }

    echo '</div>';
}

// 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', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm','arcade','forum','gallery','shop')))
        $current_action = $context['current_action'];
    if ($context['current_action'] == 'search2')
        $current_action = 'search';
    if ($context['current_action'] == 'forum')
        $current_action = 'forum';
    if ($context['current_action'] == 'gallery')
        $current_action = 'gallery';
    if ($context['current_action'] == 'shop')
        $current_action = 'shop';
    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 '
            <table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
                <tr>';

    // Show the [home] button.
    echo '
                <td valign="middle" class="mainnav' , $current_action == 'home' ? '_active' : '' , '">
                    <a href="', $scripturl, '">' , $txt[103] , '</a>
                </td>';

    // Show the [forum] button.
    echo '
                <td valign="middle" class="mainnav' , $current_action == 'forum' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=forum">' , $txt[forum] , '</a>
                </td>';

    // Show the [arcade] button.
    echo '
                <td valign="middle" class="mainnav' , $current_action == 'arcade' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=arcade">' , $txt[arcade] , '</a>
                </td>';

    // Show the [arcade] button.
    echo '
                <td valign="middle" class="mainnav' , $current_action == 'gallery' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=gallery">' , $txt[gallery] , '</a>
                </td>';

    // Show the [shop] button.
    echo '
                <td valign="middle" class="mainnav' , $current_action == 'shop' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=shop">' , $txt[shop] , '</a>
                </td>';

    // Show the [help] button.
    echo '
                <td valign="middle" class="mainnav' , $current_action == 'help' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
                </td>';

    // How about the [search] button?
    if ($context['allow_search'])
        echo '
                <td valign="middle" class="mainnav' , $current_action == 'search' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
                </td>';

    // Is the user allowed to administrate at all? ([admin])
    if ($context['allow_admin'])
        echo '
                <td valign="middle" class="mainnav' , $current_action == 'admin' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
                </td>';

    // Edit Profile... [profile]
    if ($context['allow_edit_profile'])
        echo '
                <td valign="middle" class="mainnav' , $current_action == 'profile' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
                </td>';

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

    // The [calendar]!
    if ($context['allow_calendar'])
        echo '
                <td valign="middle" class="mainnav' , $current_action == 'calendar' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
                </td>';

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


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


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


    // Otherwise, they might want to [logout]...
    if ($context['user']['is_logged'])
        echo '
                <td valign="middle" class="mainnav' , $current_action == 'logout' ? '_active' : '' , '">
                    <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
                </td>';

    // The end of tab section.
    echo '
            </tr>
        </table>';

}

// 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']] . '</a>';

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

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

    echo '
        <td class="maintab_back">', implode('', $button_strip) , '</td>';
}

?>
[/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i][/i]


Well this is the code for my index.template
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on July 03, 2008, 06:46:24 PM
Using Quote had a really bad effect on it, can you just attach it?

Full Reply > Additional Options
Title: Re: How to add tabs to Core (NDT)?
Post by: The 12th Doctor on July 03, 2008, 07:09:38 PM
There we go, sorry about that!
Title: Re: How to add tabs to Core (NDT)?
Post by: samames on July 03, 2008, 09:46:14 PM
My forum is at www.liveonfire.net/fuel
and im trying to add a 'Home' link which points to www.liveonfire.net because i have edited the previous home link and hardcoded it to be labeld 'Fuel'... the 'action' stuff is whats baffling me when i attempt to make the new button, here is my attempt:

   // Show the [Home] button.
   echo '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="http://www.liveonfire.net">Home</a>
            </td>'<td class="maintab_active_' . $last . '"> </td>' : '';

but the above brings up this error:
Parse error: syntax error, unexpected ':', expecting ',' or ';' in index.template.php on line 603

So please could somebody kind edit my code to make it work, thanks very much :)
Title: Re: How to add tabs to Core (NDT)?
Post by: samames on July 03, 2008, 10:21:38 PM
where i said 'link' i meant tab
Title: Re: How to add tabs to Core (NDT)?
Post by: samames on July 04, 2008, 09:09:27 AM
this is frustrating, all i need to know is how i can make a new tab for the default theme without the action bits there, i'll figure the rest out myself.
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 04, 2008, 01:06:38 PM
Quote from: samames on July 04, 2008, 09:09:27 AM
this is frustrating, all i need to know is how i can make a new tab for the default theme without the action bits there, i'll figure the rest out myself.
Its been shown in this topic already quite a few times.
Title: Re: How to add tabs to Core (NDT)?
Post by: samames on July 05, 2008, 02:16:06 PM
hmm, perhapse you could re post it or link me... im trawling through loads of stuff, this aint easy... ive tried searching m8, ta
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on July 05, 2008, 02:35:02 PM
Use this:


   // Save me Mr. X! Wait, I'm Mr. X....
   echo '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
               <a href="http://www.liveonfire.net">Home</a>
            </td>';
Title: Re: How to add tabs to Core (NDT)?
Post by: Jamppeli on July 29, 2008, 12:12:02 PM
HELLO DUDEZ! I have a BIG problem!

I have installed SMF 1.1.5 and Coppermine gallery and joined them together... I have tryed to make a simply button to SMF from where people can use the gallery from but i have managed to do nothing! I have been reading these instructions over and over again, but with no results at all!

So, can someone wise help me and give me a full code how i make a link to a coppermine. I am using the default theme . CORE.

Thank you allready from the help!
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 29, 2008, 07:37:32 PM
How about posting the code so we can show you what is wrong?
Title: Re: How to add tabs to Core (NDT)?
Post by: Jamppeli on July 30, 2008, 01:23:04 PM
Quote from: IchBin™ on July 29, 2008, 07:37:32 PM
How about posting the code so we can show you what is wrong?

Hmm.... I don't have a code... I had a code that i copyed from here and tryed it but it didn't work and i deleted it allready. Is there any "basic" code that i can use? I have installed a forum called FOORUMI and a coppermine gallerry called GALLERIA and joined them together so they both use SMF members.  I am now so lost with this...
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 30, 2008, 02:33:41 PM
Just copy the home button in your function. Replace anything that says home with gallery. Following the instructions in the first topic will get you exactly what you need. You can do this Jamppeli! :)
Title: Re: How to add tabs to Core (NDT)?
Post by: Jamppeli on July 30, 2008, 04:06:17 PM
Quote from: IchBin™ on July 30, 2008, 02:33:41 PM
Just copy the home button in your function. Replace anything that says home with gallery. Following the instructions in the first topic will get you exactly what you need. You can do this Jamppeli! :)

Like this?

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


I tryed but it only gives me a new button called Etusivu (HOME) and when i click it, nothing happens? Oh my god this button thing drives me crazy! One little button and so much code and strange words, aargh!

EDIT: Just made a little move and i managed to chance the text in the button to GALLERY! like this:

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


But the button still won't work at all... What i have to chance to link it in coppermine url? I know it's the current action thing, but i don't have a clue what to write in there?

EDIT: I MADE IT BY MYSELF! JIHUU! This is what i used:

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



THANK GOD! Now i have to start coding games :-)
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on July 31, 2008, 12:36:30 AM
haha! Good work! I knew you could do it! :)
Title: Re: How to add tabs to Core (NDT)?
Post by: gamerhookup on August 16, 2008, 07:38:29 PM
Ok, instead of opening an new topic this is related, but not something I have found.. Hopefully i can explain it...

k, I have the 2 new tabs up and working and all that. What is new is that I used the Forums for one tab and the other for Articles under tinyportal. So they are just links. One is an about page in the forum and the other is a guild history in the other tab. Now you see where I am starting from.

The problem is when you click on either tab you do not get an active button lit tab, you get the forum tab in one cause thats where you are. Is ther ea way to make the forum articles show up as an active tab and not the forum even though your in there?

Did that make sense? In other words all tabs lit up except those two, one lit for the forums and one lit for home since it is the tiny portal Article section..

Now I am still fairly new to SMF and yet to find a better looking mod to do what I am looking at unless who reads this can pass me on to a link or a better idea...???

Help, is there any way?
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on August 17, 2008, 10:49:04 PM
If your extra/custom pages do not have an action=page_name then the highlight will not work, unless there is something in your URL that you can identify it by. What are the links to the pages? Maybe someone can write you up a quick piece of code to make it work.
Title: Re: How to add tabs to Core (NDT)?
Post by: gamerhookup on August 19, 2008, 05:42:45 PM
Well since I am using the forums to do this, do you have any idea if there is a mod out there or one that can be written for like a clab/guild/about pages.. 

All this is, is just an area to display what the clan is about and the charter history and a few other thigs on what it is there and how it got there.


http://www.mydomainname.net/index.php?page=6



http://www.mydomainname.net/index.php?topic=22.msg98


Those are the two links, I am willing to do something new, I am just not that good at PHP developement or design for that nature, I can only work out  the details.

Amyhow, any thing you can throw my way as what would or could help would be so greatfull.
Thanks
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on August 19, 2008, 10:24:08 PM
Put this code in towards the top of the template_menu() function where you see the other $current_action array variables getting set.
if (isset($_GET['page']) && $_GET['page'] == 6)
    $current_action = 'page6';

if (isset($_GET['topic']) && $_GET['topic'] == 22)
    $current_action = 'topic22';


Then in your button, replace all of the current_action stuff to match your code above depending on which button it is. <td class="maintab_back', $current_action == 'page6'> etc.
Title: Re: How to add tabs to Core (NDT)?
Post by: gamerhookup on August 19, 2008, 11:20:14 PM
Ok thanks man... The page 6 line worked, but not the forum topic 22 you supplied., So I tried a few other things and so far nothing, So the page 6 fromt he articles section works 100 percent and the button is lit..

Here is what I have so you can tell me if I missed up or am missing something else...


Template action:

if (isset($_GET['page']) && $_GET['page'] == 6)    $current_action = 'page6';if (isset($_GET['topic']) && $_GET['topic'] == 22)    $current_action = 'topic=22.msg98';

if ($context['current_action'] == 'aboutus')
$current_action = 'page6';

if ($context['current_action'] == 'guildhistory')
$current_action = 'topic=22.msg98';


button area:

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

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


K, there ya go, any ideas or did I enter something wrong, keep in mind I only added the .msg98 to the topic 22 since it did not work and that is the action link it is trying to pull...

UPDATE:

I forgot a few of the current actions, no matter still not worked, so i took out all the ms98 to the topic 22 and still nothing, the forum lites up no matter what...(since that is where it is)

If you or we can not fix it, i will just enter a new article and go that route since the about page works now. Inless there is a mod out there that is better..

Thanks for your help!!!!!!
Title: Re: How to add tabs to Core (NDT)?
Post by: Sandokan2 on August 20, 2008, 07:20:39 AM
Hi everyone, I have tried several times to add a button but just can't make it work  :'(
I read every single detail of the tut and still get something else. Who can help me?
I want a new button that says: Video Items and it needs to point to a URL:

http://www.gameroad.nl/videoitems.hml

The file doesn't excist yet but it just needs to point there. Can anyone help me by editing my
Index.template.php? Thanx!!

This is my forum URL:

http://www.gameroad.nl/

My clean unedited index.template.php:

<?php
// Version: 1.1; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;

$settings['tp_images_url'] = $settings['images_url'] . '/tinyportal';
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings$boardurl;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?rc2p"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
// ]]></script>
<title>'
$context['forum_name'] . ' : ' $context['page_title'], '</title>';

// The ?rc2 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?rc2" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?rc2" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="zoeken" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';


// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
$options['collapse_header'] = !empty($_COOKIE['upshrink']);

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>'
;

echo '
</head>
<body>
<div id="wrapper">
<div id="header">
<div id="searcharea">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '">
<input class="inputbox" type="text" name="search" value="'
$txt[182], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt[182], '...\';" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</div>
<div id="logo"><a href="'
.$scripturl.'" title=""></a></div>
</div>
<div id="shad-tr">
<div id="shad-tl">
<div id="toolbar">
'
,template_menu(),'
</div>
<div id="toparea">
<div id="userarea">'
;
if(!empty($context['user']['avatar']))
echo '
<div class="ds-avatar">'
.$context['user']['avatar']['image'].'</div>';
// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<ul>
<li><b>'
$txt['hello_member_ndt'], ' '$context['user']['name'],'</b></li>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo '
<li><a href="'
$scripturl'?action=pm">'$context['user']['messages'], ' '$context['user']['messages'] != $txt[153] : $txt[471], '</a>'$txt['newmessages4'], ' '$context['user']['unread_messages'], ' '$context['user']['unread_messages'] == $txt['newmessages0'] : $txt['newmessages1'],'</li>';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '<li><b>'$txt[616], '</b></li>';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '<li>'$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '</li>';

echo '
<li><a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a></li>
<li><a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a></li>
</ul>'
;
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo '
'
$txt['welcome_guest'], '
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>
<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user"  size="10" />
<input type="password" name="passwrd"  size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="43200">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" />
<input type="hidden" name="hash_passwrd" value="" />
</form>'
$txt['smf52'], '<br /><br />';
}

echo '
</div>
<div id="news">'
;
if (!empty($settings['enable_news']))
echo '
<span class="smalltext"><strong>'
$txt[102], '</strong>:<br />'$context['random_news_line'], '</span>';
echo '
</div>
</div>
<div class="clr"></div>
<div id="bodyarea">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt$user_info;

echo '
</div>
</div>
</div>'
;

echo '
<div id="shad-b">
<div id="shad-bl">
<div id="shad-br">
<div id="footer">
<span class="smalltext">'
theme_copyright(), '<br />
<strong>Indigo</strong> design by <a href="http://www.dzinerstudio.com" target="_blank">DzinerStudio</a></span>'
;

// Show the load time?
if ($context['show_load_time'])
echo '<br /><span class="smalltext">'$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

echo '
</div>
</div>
</div>
</div>'
;

echo 
'
</div>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '
<div class="pathway">'
;
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '">' $tree['name'] . '</a>' $tree['name'] , '&nbsp;&laquo;&nbsp;';
else
echo $tree['name'];

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

}

echo '</div>';
}

// 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''admin''calendar''profile''mlist''register''login''help''pm''forum''tpadmin')))
$current_action $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action 'search';

if (isset($_GET['dl']))
$current_action 'dlmanager';

if (isset($_GET['board']) || isset($_GET['topic']) || $context['current_action']=='forum')
$current_action 'forum';

if ($context['current_action']=='tpadmin')
$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="topmenu">
<ul>'
;

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

if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo '<li><a' $current_action=='forum' ' class="current"' '' ' href="'$scripturl'?action=forum">' $txt['tp-forum'] , '</a></li>';

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

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

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

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

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

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

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

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

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

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

echo '</ul>
</div>'
;
}

// 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']] . '</a>';

$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>';
}

?>


Thank you  :D
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on August 20, 2008, 05:22:01 PM
Quote from: gamerhookup on August 19, 2008, 11:20:14 PM
Ok thanks man... The page 6 line worked, but not the forum topic 22 you supplied., So I tried a few other things and so far nothing, So the page 6 fromt he articles section works 100 percent and the button is lit..

Here is what I have so you can tell me if I missed up or am missing something else...


Template action:

if (isset($_GET['page']) && $_GET['page'] == 6)    $current_action = 'page6';if (isset($_GET['topic']) && $_GET['topic'] == 22)    $current_action = 'topic=22.msg98';

if ($context['current_action'] == 'aboutus')
$current_action = 'page6';

if ($context['current_action'] == 'guildhistory')
$current_action = 'topic=22.msg98';


button area:

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

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


K, there ya go, any ideas or did I enter something wrong, keep in mind I only added the .msg98 to the topic 22 since it did not work and that is the action link it is trying to pull...

UPDATE:

I forgot a few of the current actions, no matter still not worked, so i took out all the ms98 to the topic 22 and still nothing, the forum lites up no matter what...(since that is where it is)

If you or we can not fix it, i will just enter a new article and go that route since the about page works now. Inless there is a mod out there that is better..

Thanks for your help!!!!!!

$current_action = 'topic=22.msg98'; needs to be $current_action = 'topic22'; at the top.

The button code should look like this:
   // Show the [guildhistory] button.
   echo ($current_action=='topic22' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'topic22' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?topic=22.msg98">' , $txt[2001] , '</a>
            </td>' , $current_action == 'topic22' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on August 20, 2008, 05:25:20 PM
Quote from: Sandokan2 on August 20, 2008, 07:20:39 AM
Hi everyone, I have tried several times to add a button but just can't make it work  :'(
I read every single detail of the tut and still get something else. Who can help me?
I want a new button that says: Video Items and it needs to point to a URL:

http://www.gameroad.nl/videoitems.hml

The file doesn't excist yet but it just needs to point there. Can anyone help me by editing my
Index.template.php? Thanx!!

This is my forum URL:

http://www.gameroad.nl/

My clean unedited index.template.php:

Thank you  :D

There's no need to post the whole index.template.php file. If you want help with a custom theme, you should first seek help from the author. Not all themes are the same. This theme's button you posted are not the same as what this topic is about. Just put in the href="http://thelinkyouwant.com/page.html" to make it work.
Title: Re: How to add tabs to Core (NDT)?
Post by: gamerhookup on August 20, 2008, 11:51:11 PM
Quote from: IchBin™ on August 20, 2008, 05:22:01 PM
Quote from: gamerhookup on August 19, 2008, 11:20:14 PM
Ok thanks man... The page 6 line worked, but not the forum topic 22 you supplied., So I tried a few other things and so far nothing, So the page 6 fromt he articles section works 100 percent and the button is lit..

Here is what I have so you can tell me if I missed up or am missing something else...


Template action:

if (isset($_GET['page']) && $_GET['page'] == 6)    $current_action = 'page6';if (isset($_GET['topic']) && $_GET['topic'] == 22)    $current_action = 'topic=22.msg98';

if ($context['current_action'] == 'aboutus')
$current_action = 'page6';

if ($context['current_action'] == 'guildhistory')
$current_action = 'topic=22.msg98';


button area:

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

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


K, there ya go, any ideas or did I enter something wrong, keep in mind I only added the .msg98 to the topic 22 since it did not work and that is the action link it is trying to pull...

UPDATE:

I forgot a few of the current actions, no matter still not worked, so i took out all the ms98 to the topic 22 and still nothing, the forum lites up no matter what...(since that is where it is)

If you or we can not fix it, i will just enter a new article and go that route since the about page works now. Inless there is a mod out there that is better..

Thanks for your help!!!!!!

$current_action = 'topic=22.msg98'; needs to be $current_action = 'topic22'; at the top.

The button code should look like this:
   // Show the [guildhistory] button.
   echo ($current_action=='topic22' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'topic22' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?topic=22.msg98">' , $txt[2001] , '</a>
            </td>' , $current_action == 'topic22' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Ok well i tried all that.. and still it only lites up the forum button... Guess I will just re-do it in the article seciton since you got that working for me...

Thanks anyhow, at least the other is working perfect..
THANKS!
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on August 21, 2008, 10:09:51 AM
It should work. If you post the code you have I can take another look.
Title: Re: How to add tabs to Core (NDT)?
Post by: gamerhookup on August 22, 2008, 11:37:55 PM
K, well her eis the code for that line... A button does lite, it is the forum lite. Just not this lite. No big deal in the end, I think we are just going to do an article since the other one you worked on works. But if you can figure this one out, then were good with that.


if ($context['current_action'] == 'topic22')
$current_action = 'topic22';





// Show the [guildhistory] button.
echo ($current_action=='topic22' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'topic22' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?topic=22">' , $txt[2001] , '</a>
</td>' , $current_action == 'topic22' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: How to add tabs to Core (NDT)?
Post by: the gaffer on August 28, 2008, 10:40:53 PM
Hey all.

Been trawling through this section as a guest for a few days now... tried countless methods, but had no joy at all.

The theme I am using doesn't seem to include a tag for 'forum'... something I've encountered on several. As a short-term solution I've added a menu block via TinyPortal to allow users to get there, but Ideally I'd like it to be a part of the nav bar.

Now, I have successfully added the 'blog' option to that bar using the tutorial described, which is great, and working like a charm.

However, the 'forum' and 'gallery' options just won't appear for me.

The Gallery option is a freshly installed mod.

Forum is of course bulit in to SMF.

Any ideas what could be causing the issue?

Code below      $current_action = 'admin';
   if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'blog', 'forum')))
      $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';
   }

   // Start of the tab section.
echo '
   <ul>';
   
   // Show the default [home] button.
   echo ($current_action=='home' || $context['browser']['is_ie4']) ? '' : '' , '
   <li class="' , $current_action == 'home' ? 'current' : '' , '"><a href="', $scripturl, '">' , $txt[103] , '</a></li>';
     
   // Show the [help] button.
   echo ($current_action=='help' || $context['browser']['is_ie4']) ? '' : '' , '
   <li class="' , $current_action == 'help' ? 'current' : '' , '"><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></li>';

   // How about the [search] button?
   if ($context['allow_search'])
      echo ($current_action=='search' || $context['browser']['is_ie4']) ? '' : '' , '
      <li class="' , $current_action == 'search' ? 'current' : '' , '"><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';

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

   // Edit Profile... [profile]
   if ($context['allow_edit_profile'])
      echo ($current_action=='profile' || $context['browser']['is_ie4']) ? '' : '' , '
      <li class="' , $current_action == 'profile' ? 'current' : '' , '"><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></li>';

  // Show the [blog] button.
   echo ($current_action=='blog' || $context['browser']['is_ie4']) ? '' : '' , '
   <li class="' , $current_action == 'blog' ? 'current' : '' , '"><a href="', $scripturl, '?action=blog">' , $txt[blog] , '</a></li>';[/color][/b]

   // Show the [forum] button.
   echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '' : '' , '
   <li class="' , $current_action == 'forum' ? 'current' : '' , '"><a href="', $scripturl, '?action=forum">' , $txt[forum] , '</a></li>';
Title: Re: How to add tabs to Core (NDT)?
Post by: the gaffer on August 28, 2008, 11:15:07 PM
Solved. Want an even easier, basic way of adding on to the nav bar?

just go

   // The [forum]
   echo '
   <li><a href="http://www.YOURWEBSITE.net/index.php?action=forum">forum</a></li>';

and BAM! It's in there.

Quick, easy, and painless.... Ugh!
Title: Re: How to add tabs to Core (NDT)?
Post by: IchBin™ on September 02, 2008, 11:20:08 PM
Quote from: the gaffer on August 28, 2008, 11:15:07 PM
Solved. Want an even easier, basic way of adding on to the nav bar?

just go

   // The [forum]
   echo '
   <li><a href="http://www.YOURWEBSITE.net/index.php?action=forum">forum</a></li>';

and BAM! It's in there.

Quick, easy, and painless.... Ugh!

That only works on your custom theme. It doesn't apply to the default theme, which this topic is referring to.
Title: Re: How to add tabs to Core (NDT)?
Post by: midas on September 08, 2008, 01:26:41 PM
I've just added a Gallery button which links to a Coppermine installation.

The code I used works fine and was added to my used templates' index.template.php; it is placed toward the bottom of the text in between similar looking code of the other buttons that I wish it to display between.  For the benefit of others, the code is:

Quote// The [gallery] button

                 echo ($current_action=='gallery' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'gallery' ? 'active_back' : 'back' , '">
               <a href="http://www.fantasyxtra.com/gallery/index.php">GALLERY</a>
            </td>' , $current_action == 'gallery' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

I also added the button's name "gallery" to the bit of code that can be found by scrolling upwards from the index.template.php page's bottom (it should be above the code for the other buttons) that looks like this:

Quoteif (in_array($context['current_action'], array('blog', 'treasury', 'forum', 'gallery', 'downloads', 'calendar', 'tags', 'search', 'admin', 'profile', 'mlist', 'register', 'login', 'pm', 'spadmin')))

In the last bit of code, notice that the button's name is placed between two of these " ' " and is separated from the next item by one of these " , "For example 'button_name' ,

I'm not a coder, just modified some original code for a button and took the advice of one of the other posters here (the gaffer, thank you but your code only displayed clickable hyperlink text above the buttons).

To adapt the code for your own button, modify your index.template.php by adding the code (to where I described above), then:Lastly, add your button's title into your bit of code that looks similar to this code section reproduced below:

Quoteif (in_array($context['current_action'], array('blog', 'forum', 'gallery', 'downloads', 'calendar', 'search', 'admin', 'profile', 'register', 'login', 'pm')))

The button's title must be consistent throughout all the code.  Only change the spelling etc.. for the ">bit between here</a>"  as this is how it displays on the menu bar.

(The site referenced above has some adult content so please do not visit unless you are 18 or above and legally mature enough in your location to view said material).
Title: Re: How to add tabs to Core (NDT)?
Post by: alex30 on September 09, 2008, 09:15:47 AM
http://docs.simplemachines.org/index.php?topic=564 -  is this is the only one method of adding tab links?

I read this tutorial and couldn't figure how and where insert URL of a needed page?
Title: Re: How to add tabs to Core (NDT)?
Post by: -x-Rach-x- on September 20, 2008, 05:20:03 PM
Thank you so much, this is a great and easy to follow tut, even for a newbie like me!!
Title: Re: How to add tabs to Core (NDT)?
Post by: legend 1234 on October 13, 2008, 05:59:33 AM
how do i make it so instead of the url being www.advanced-scape.110mb.com/forum ( which is the default url of the tab ) i can make it like www.simplemachines.com ???

code im using is:



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



because atm its doing www.advanced-scape.110mb.com/forum/www.simplemachines.com

thanks alot
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 13, 2008, 02:17:00 PM
That's pretty much it, but it's http://simplemachines.org not .com :P you MUST include the http:// if you're going to include an external link.
Title: Re: How to add tabs to Core (NDT)?
Post by: legend 1234 on October 14, 2008, 03:33:41 AM
ook thanks heaps mate
Title: Re: How to add tabs to Core (NDT)?
Post by: khamseen on October 14, 2008, 07:37:49 PM
I have been going mad trying to add three buttons I need for mods to the menu bar.

I have sat and read through the tutorials and I have searched through my .php files and simply cannot find ANY of the parts you're saying to look for.

Before someone says "What theme though?" I did in fact try it on a custom theme at first, when I couldn't find it I tried to follow the tutorials for the default themes to see if I could find them and I still couldn't.
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 14, 2008, 07:49:24 PM
Look for the template_menu function. It's always in index.template.php
Title: Re: How to add tabs to Core (NDT)?
Post by: khamseen on October 14, 2008, 08:03:51 PM
Yeah, I found that. But that's all I find. Here, take a little look. This is the immediate area after "template_menu"

(From the default theme)


// Show the menu here, according to the menu sub template.
template_menu();

// Show the navigation tree.
theme_linktree();

// The main content should go here.
echo '
<div id="bodyarea">';
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 14, 2008, 10:31:16 PM
That's just the call to it. The actual function is near the bottom.

Ctrl+F for

function template_menu()
Title: Re: How to add tabs to Core (NDT)?
Post by: khamseen on October 14, 2008, 10:36:40 PM
Ok, so I've found this part


function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="clearfix">';

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '">
<a', $button['active_button'] ? ' class="active"' : '', ' title="', $act , '" href="', $button['href'], '">
<span', isset($button['is_last']) ? ' class="last"' : '', '>', ($button['active_button'] ? '<em>' : ''), $button['title'], ($button['active_button'] ? '</em>' : ''), '</span>
</a>
</li>';
}

echo '
</ul>
</div>';
}
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 14, 2008, 11:06:20 PM
You're using 2.0 in which case the method to add menu links would be in Subs.php read this for more info: http://www.smfthemes.org/index.php?topic=177.0
Title: Re: How to add tabs to Core (NDT)?
Post by: khamseen on October 14, 2008, 11:37:03 PM
Aha, yes I knew I was using SMF 2.0 and the tutorial that I looked at which ironically enough linked to this topic said it was for SMF 2.0 strange.

But yes, now that I knew where to look and with the aide of that guide I have been able to add the two buttons I needed. They are hard coded but we only use English on our site so it's not too bad I suppose.

Thank you for the help. ;)
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 15, 2008, 06:19:05 AM
This guide is actually for 1.1, the template_menu was moved to the source files in 2.0 to make mods work across all themes at once, rather then just the default.
Title: Re: How to add tabs to Core (NDT)?
Post by: midas on October 15, 2008, 04:14:37 PM
There are two mods that will allow you to add tabs to the menu bar.  Both work through Admin:

Custom Tabs (http://custom.simplemachines.org/mods/index.php?mod=1402)

Menu Buttons (http://custom.simplemachines.org/mods/index.php?mod=1421)

I use Menu Buttons but only because that's the one I found first.  Custom Tabs apparently gives more control over a custom tab's visibility to guests/members...

For Menu Buttons, I had to edit my customized index.template.php (simple copy and paste, not difficult).
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on October 15, 2008, 06:50:03 PM
Yeah, but on 1.1 you would still need to edit the index.template.php of custom themes anyway, the Custom Tabs mod would work on all themes for it's 2.0 version though.
Title: Re: How to add tabs to Core (NDT)?
Post by: khamseen on October 20, 2008, 04:34:01 AM
Awesome, I shall check them out. Thanks for the tips.
Title: Re: How to add tabs to Core (NDT)?
Post by: jensvanherck on November 01, 2008, 12:10:48 PM
FIXED IT TY
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on November 01, 2008, 12:47:43 PM
I don't see any unlinked items in the template_menu...
Title: Re: How to add tabs to Core (NDT)?
Post by: auss9960 on November 18, 2008, 06:23:54 AM
Quote from: JayBachatero on January 09, 2006, 09:01:28 AM
You want to add a second line of tabs?

-JayBachatero

I managed to add a second and a third line of buttons in BlueAce template like this:

// The NEW IMPROVED menu bar.

   $current_action = 'forum';
   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', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'beaches', 'home', 'about', 'etiquette', 'beaches', 'resorts', 'osbeaches', 'osresorts', 'blog', 'arcade', 'gallery', 'video', 'chat', 'downloads', 'contact', 'members', 'webmail')))
      $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';
echo '

<br>
<div>
 
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber2" width="95%" height="12">
    <tr>
        <td colspan="2" id="menu" width="100%"><ul>
                                        <li><a><font color="#FF00FF">', 'Information', '</font></a></li>';
   // Show the [home] button.
   echo '
               <li', $current_action == 'home' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=home"', $scripturl, '">', 'Home', '</a></li>';

   // Show the [about] button.
   echo '
               <li', $current_action == 'about' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=about"', $scripturl, '">', 'About', '</a></li>';

   // Show the [etiquette] button.
   echo '
               <li', $current_action == 'etiquette' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=etiquette"', $scripturl, '">', 'Etiquette', '</a></li>';

   // Show the [beaches] button.
   echo '
               <li', $current_action == 'beaches' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=beaches"', $scripturl, '">', 'Aussie Beaches', '</a></li>';

   // Show the [resorts] button.
   echo '
               <li', $current_action == 'resorts' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=resorts"', $scripturl, '">', 'Aussie Resorts', '</a></li>';

   // Show the [osbeaches] button.
   echo '
               <li', $current_action == 'osbeaches' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=osbeaches"', $scripturl, '">', 'Overseas Beaches', '</a></li>';

   // Show the [osresorts] button.
   echo '
               <li', $current_action == 'osresorts' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=osresorts"', $scripturl, '">', 'Overseas Resorts', '</a></li>';

   // Show the [rules] button.
   echo '
               <li', $current_action == 'rules' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=rules"', $scripturl, '">', 'Our Rules', '</a></li></ul>

        </td>
    </tr>
</table>

<br></br>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber2" width="95%" height="12">
    <tr>
        <td colspan="2" id="menu" width="100%"><ul>
                                        <li><a><font color="#FF00FF">', 'The Forum', '</font></a></li>';
   // Show the [forum] button.
   echo '
               <li', $current_action == 'forum' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php"', $scripturl, '">', 'Forum', '</a></li>';

   // Show the [blog] button.
   echo '
               <li', $current_action == 'blog' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=blog"', $scripturl, '">', 'Aussie Blog', '</a></li>';

   // Show the [arcade] button.
   echo '
               <li', $current_action == 'arcade' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=arcade"', $scripturl, '">', 'Games', '</a></li>';

   // Show the [gallery] button.
   echo '
               <li', $current_action == 'gallery' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=gallery"', $scripturl, '">', 'Gallery', '</a></li>';

   // Show the [video] button.
   echo '
               <li', $current_action == 'video' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=video"', $scripturl, '">', 'Video', '</a></li>';

   // Show the [chat] button.
   echo '
               <li', $current_action == 'chat' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=chat"', $scripturl, '">', 'Chat Room', '</a></li>';

   // Show the [downloads] button.
   echo '
               <li', $current_action == 'downloads' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=downloads"', $scripturl, '">', 'Downloads', '</a></li>';
   
   // The [calendar]!
   if ($context['allow_calendar'])
      echo '
               <li', $current_action == 'calendar' ? ' id="active"' : '', '><a href="', $scripturl, '?action=calendar">', 'Events', '</a></li>';

   // the [member] list button
   if ($context['allow_memberlist'])
      echo '
               <li', $current_action == 'members' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=members"', $scripturl, '?action=members">' , 'Member List' , '</a></li>

   </ul>

        </td>
    </tr>
</table>
  <br></br>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" id="AutoNumber2" width="95%" height="12">
    <tr>
        <td colspan="2" id="menu" width="100%"><ul>
                                        <li><a><font color="#FF00FF">', 'My Panel', '</font></a></li>';
   
   // Show the [profile] button.
   echo '
               <li', $current_action == 'profile' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=profile"', $scripturl, '">', 'My Profile', '</a></li>';

        // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo '
               <li', $current_action == 'pm' ? ' id="active"' : '', '><a href="', $scripturl, '?action=pm">' , 'Message Bank', ' ', $context['user']['unread_messages'] > 0 ? '<blink>['. $context['user']['unread_messages'] . ']</blink>' : '' , '</a></li>';


   // Show the [webmail] button.
   echo '
               <li', $current_action == 'webmail' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=webmail"', $scripturl, '">', 'Web Mail', '</a></li>';

   // Show the [contact] button.
   echo '
               <li', $current_action == 'contact' ? ' id="active"' : '', '><a href="http://aussienaturists.com/index.php?action=contact"', $scripturl, '?action=contact">', 'Contact Us', '</a></li>';

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

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

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


   // If the user is a guest, show [login] and [register] buttons.
   if ($context['user']['is_guest'])
   {
      echo '
               <li', $current_action == 'login' ? ' id="active"' : '', '><a href="', $scripturl, '?action=login">', $txt[34], '</a></li>
               <li', $current_action == 'register' ? ' id="active"' : '', '><a href="http://aussienaturists.com/myforms/joinform.html"', $scripturl, '?action=register">', $txt[97], '</a></li>';
   }
   // Otherwise, they might want to [logout]...
   else
      echo '
               <li', $current_action == 'logout' ? ' id="active"' : '', '><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', $txt[108], '</a></li>';
   echo '</ul></ul>

        </td>
    </tr>
</table>

Splitting the menu buttons between tables works fine. I have tried various things to get the buttons to be centered in the middle, but failed on all counts. However, if someone can easily tell me how to make a new row of menu buttons appear ONLY for admins and 1 other usergroup I would be very happy. The examples I have seen so far have not been workable. If you could please respond to [removed per user request - Iris] I would be grateful, as I cannot seem to set this forum to notify me of replies. If you'd like to look at my menu solutions you can through http://aussienaturists.com
Title: Re: How to add tabs to Core (NDT)?
Post by: TeaTephi on December 04, 2008, 08:38:11 PM
Ok I need to add three tabs
"chat", "bookmarks", and "gallery"
I tried to follow the direction for chat, and it almost worked only it said "help", but it was really chat.  So I changed the text string to $txt['chat'] = 'Chat'; and look what happened. 

The same thing happened when I tried to add a line in index.english
$txt[120] = 'Chat';
and I also put in index.template to point to the 120 string, I obviously don't know what I'm doing . . .

I'm confused can someone tell me what I'm doing wrong?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 05, 2008, 04:39:51 AM
Dont change any of the current language strings. Use $txt['chat'].

Though if you're using one language you may as well just hard code it into the template, and bypass the whole language string thing.
Title: Re: How to add tabs to Core (NDT)?
Post by: TeaTephi on December 05, 2008, 07:53:08 AM
It only works if I type this in (and I get two help buttons, where one is help the other chat)

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


If I type $txt['chat'] it doesn't do anything!  Isn't that weird?
Title: Re: How to add tabs to Core (NDT)?
Post by: Gary on December 05, 2008, 08:55:56 AM
Add

$txt['chat'] = 'Chat'; to Modifications.language.php then call it.

Or change ' , $txt[119] , ' to just plain Chat forcing it in without using a string.
Title: Re: How to add tabs to Core (NDT)?
Post by: TeaTephi on December 05, 2008, 11:17:18 PM
I changed it to plain chat and it worked! Ahhh, much better.

Thanks!

Going to try my bookmark and gallery tab the same way. 
Title: Re: How to add tabs to Core (NDT)?
Post by: jeff_ddaz on December 08, 2008, 06:26:01 PM
hey all, noob here....I've referenced http://www.smfthemes.org/index.php?topic=177.0 for adding a new tab. I've yet to try it, however, i need to add my own image to it....I'm using the extreme6 theme and love how he did the main menu, but I'd like to add "New Posts" to it and remove "show unread posts since last visit". please see the link below, I'd like to add the "New Posts" next to the "Home" tab. I've created the image that will be in there, how can I implement this change?

http://www.desertdiamondsaz.com/forum_beta/
Title: Re: How to add tabs to Core (NDT)?
Post by: Xarcell on December 08, 2008, 06:46:03 PM
It's not that hard to do, but this is the wrong topic.

There is instructions for adding tabs to the main menu in another thread for SMF 2.0. Try searching for it. This thread instructs for 1.1.x, which won't help you.
Title: Re: How to add tabs to Core (NDT)?
Post by: jeff_ddaz on December 08, 2008, 06:50:18 PM
oh ok, will do...just saw a link in a prev post about 2.0
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Gary on December 08, 2008, 07:32:03 PM
Since people seem to be getting a little confused with which version this is for, which is understandable, I've edited the topic title to indicate that this is for 1.1
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Xarcell on December 08, 2008, 10:19:17 PM
Quote from: Gazmanafc on December 08, 2008, 07:32:03 PM
Since people seem to be getting a little confused with which version this is for, which is understandable, I've edited the topic title to indicate that this is for 1.1

Thanks.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: flamechica on January 03, 2009, 03:28:15 AM
Ok, I am a little confused too....I want to add a tab to the top of my theme (which isn't a default theme) and want it to go to an external location. I followed the instructions in this tutorial. The tab shows up but it is blue (which doesn't match the theme I am using) and it is pushed all the way over to the right hand side of the screen which pushes all the rest of the tabs to the top of the screen and makes the just plain links. I don't get it.

If this is the wrong tutorial, could someone point me to one that will help me?
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Tyrsson on January 03, 2009, 03:50:45 AM
Which version of SMF are you using?

Also depending on how you coded it it is more than likely calling the default tab image.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: flamechica on January 03, 2009, 04:48:45 AM
I'm using SMF 1.1.7

Here is my 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', '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'] == 'chat')
      $current_action = 'chat';
   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 '';

   // Show the [home] button.
   echo'
               <a href="', $scripturl, '">' , $txt[103] , '</a>';

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

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

      // Show the [chat] button.
if ($context['user']['is_logged'])
   echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="http://rsdlaughter.shoutmix.net/">Chat</a>
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';   

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

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

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

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

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


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


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


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

   // The end of tab section.
   echo '';

}
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Tyrsson on January 03, 2009, 05:12:48 AM
I think this will be an easier solution for you :)

1. Remove the code that you added in the edit above so that the file is in its original form.

2. Make a backup of the file so that you will have a good copy :)

3.Install this mod:

Custom Tab (http://custom.simplemachines.org/mods/index.php?mod=1402)

4. If it does not show in your theme simply look to the manual install instructions and edit the files that are referenced in the install instructions and present in your custom theme.

The advantage of this mod is that you can change the link through the adminCp with no additional edits once its installed :)
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: flamechica on January 05, 2009, 02:10:34 AM
Tyrsson,
Thanks a ton. That worked like a charm!
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Tyrsson on January 05, 2009, 03:15:20 AM
No problem :)

Glad it helped :)
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: LSPdznr on January 12, 2009, 05:02:05 PM
I'm running into a similar issue. I've created a custom theme and added new tabs. Unfortunately, that code was added in an older version. When I updated to 1.1.7, the code no longer seems to work. Here is the 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('treasury','staff','links','contact','search', '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'] == 'newsandevents')
          $current_action = 'newsandevents';
   
    if ($context['current_action'] == 'scholarships')
          $current_action = 'scholarships';
   
    if ($context['current_action'] == 'history')
          $current_action = 'history';

    if ($context['current_action'] == 'photos')
          $current_action = 'discussions';

    if ($context['current_action'] == 'discussions')
          $current_action = 'discussions';
   
    if ($context['current_action'] == 'aboutus')
          $current_action = 'aboutus';
   
    if ($context['current_action'] == 'shop')
          $current_action = 'shop';
   
    if ($context['current_action'] == 'links')
          $current_action = 'links';

    if ($context['current_action'] == 'home')
          $current_action = 'home';
   
       if (isset($_GET['dl']))
          $current_action = 'dlmanager';
   
       if (isset($_GET['board']) || isset($_GET['topic']) || $context['current_action']=='forum')
          $current_action = 'forum';
   
       if ($context['current_action']=='tpadmin')
          $current_action = 'admin';
   
       if ($context['current_action']=='mgallery')
          $current_action = 'mgallery';
       if ($context['current_action'] == 'theme')
          $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
   
       if (in_array($context['current_action'], array('blogControlPanel', 'blogs')) || !empty($context['current_blog']))
          $current_action = 'blog';

   if (isset($_GET['dl']))
      $current_action = 'dlmanager';

   if (isset($_GET['board']) || isset($_GET['topic']) || $context['current_action']=='forum')
      $current_action = 'forum';

   if ($context['current_action']=='tpadmin')
      $current_action = 'admin';

   if ($context['current_action']=='mgallery')
      $current_action = 'mgallery';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

   if (in_array($context['current_action'], array('blogControlPanel', 'blogs')) || !empty($context['current_blog']))
      $current_action = 'blog';

   // Are we using right-to-left orientation?
   if ($context['right_to_left'])
   {
      $first = 'last';
      $last = 'first';
   }
   else
   {
      $first = 'first';
      $last = 'last';
     
   // are we viewing a page in the blogging community?
   if (!empty($context['zc']['show_zc_nav']) && !empty($context['blog_community']))
      $current_action = 'zc';
   }

   // Show the [News & Events] button.
       echo ($current_action=='newsandevents' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
                <td valign="top" class="maintab_' , $current_action == 'newsandevents' ? 'active_back' : 'back' , '">
                   <a href="/index.php?blog=6.0"><strong>News & Events</strong></a>
                </td>' , $current_action == 'newsandevents' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
       
       // Show the [Scholarships] button.
       echo ($current_action=='scholarships' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
                <td valign="top" class="maintab_' , $current_action == 'scholarships' ? 'active_back' : 'back' , '">
                   <a href="/index.php?blog=8.0"><strong>Scholarships</strong></a>
                </td>' , $current_action == 'scholarships' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
   
       // Show the [History] button.
       echo ($current_action=='history' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
                <td valign="top" class="maintab_' , $current_action == 'history' ? 'active_back' : 'back' , '">
                   <a href="/index.php?blog=7.0"><strong>History</strong></a>
                </td>' , $current_action == 'history' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

       // Show the [Photos] button.
       echo ($current_action=='photos' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
                <td valign="top" class="maintab_' , $current_action == 'photos' ? 'active_back' : 'back' , '">
                   <a href="/index.php?action=mgallery"><strong>Photos</strong></a>
                </td>' , $current_action == 'photos' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

       // Show the [Discussions] button.
       echo ($current_action=='discussions' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
                <td valign="top" class="maintab_' , $current_action == 'discussions' ? 'active_back' : 'back' , '">
                   <a href="/index.php?action=forum"><strong>Discussions</strong></a>
                </td>' , $current_action == 'discussions' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
   
       // Show the [About Us] button.
       echo ($current_action=='aboutus' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
                <td valign="top" class="maintab_' , $current_action == 'aboutus' ? 'active_back' : 'back' , '">
                   <a href="/index.php?cat=16"><strong>About Us</strong></a>
                </td>' , $current_action == 'aboutus' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
   
       // Show the [Shop] button.
       echo ($current_action=='shop' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
                <td valign="top" class="maintab_' , $current_action == 'shop' ? 'active_back' : 'back' , '">
                   <a href="/index.php?cat=19"><strong><strong>Shop</strong></strong></a>
                </td>' , $current_action == 'shop' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
   
       // Show the [Links] button.
       echo ($current_action=='links' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
                <td valign="top" class="maintab_' , $current_action == 'links' ? 'active_back' : 'back' , '">
                   <a href="/index.php?action=links"><strong>Links</strong></a>
                </td>' , $current_action == 'links' ? '<td class="maintab_active_' . $last . '"> </td>' : '';
     
   // If the user is a guest, show [login] button.
   if ($context['user']['is_guest'])
      echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=login"><strong>' , $txt[34] , '</strong></a>
            </td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '"> </td>' : '';


   // If the user is a guest, also show [register] button.
   if ($context['user']['is_guest'])
      echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
            </td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '"> </td>' : '';


   // Otherwise, they might want to [logout]...
   if ($context['user']['is_logged'])
      echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
            </td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '"> </td>' : '';

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

   // The end of tab section.
   echo '
            <td class="maintab_' , $last , '"> </td>
';
// TinyPortal
    if($context['TPortal']['leftbar'])
             echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderLeftbar(!current_leftbar); return false;"><img id="upshrinkLeftbar" src="', $settings['images_url'], '/', empty($options['collapse_leftbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempLeftbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
         if($context['TPortal']['rightbar'])
             echo '<td style="padding-left: 1ex;"><a href="javascript:void(0);" onclick="shrinkHeaderRightbar(!current_rightbar); return false;"><img id="upshrinkRightbar" src="', $settings['images_url'], '/', empty($options['collapse_rightbar']) ? 'upshrink.gif' : 'upshrink2.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 0;" border="0" /></a><img id="upshrinkTempRightbar" src="', $settings['images_url'], '/blank.gif" alt="" style="margin-right: 0ex;" /></td>';
// TinyPortal end
echo '
         </tr>
      </table>';

}


I know the code is a mess and I want to start over and try the Custom Tab mod but I don't want to revert the entire template. Is there a way to restore that chunk of code to it's original form without reverting the entire page? I didn't save the page before making my changes.
Title: Re: How to add tabs to Core (NDT)?
Post by: Jago^ on January 18, 2009, 01:18:20 PM
Quote from: JayBachatero on March 11, 2006, 02:56:02 PM
He did this on the index.template.php.  On the include part change that to the file you want to include.  Follow the steps to add the tabs.


function template_banner()
{
     //Load the main_above template.  This is the header part
     template_main_above();
     //Load the file needed to be loaded
     include('banner.txt');
     //Load the copyright and so on.
     template_main_below();
}
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'blah')
{
     //Make use of SMF's layer system
     $context['template_layers'] = array();
     $context['sub_template'] = 'banner';
}


Quite an old post, but this is what i'm looking for. I still don't really understand which code should go where though, except for that they all go into index.template.php.
Would it be possible to add this page inside the forum that way (between header/ copyright)? http://www.thepicwhorez.com/irc/tPW_JavaChat.html

edit: http://www.simplemachines.org/community/index.php?topic=286824.0
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: TerryMullins on February 27, 2009, 01:10:44 PM
I am trying to add a tab to my menu to take me to a new page inside of the smf directory.
The link is for a database that I am creating using dreamweaver cs4.  I am using SSI.php in the page that I am going to... www.fivestarcleaningplus.com/leadgenerationforum/database/index.php (http://www.fivestarcleaningplus.com/leadgenerationforum/database/index.php)

My problem is that if you are logged into the forum and you go directly to the /database/index.php file, everything works correctly with regard to the session information carrying over.
The forum is located at www.fivestarcleaningplus.com/leadgenerationforum/index.php (http://www.fivestarcleaningplus.com/leadgenerationforum/index.php)

However, when I follow the instructions that I've read so far, I am able to create a new tab... and when you click on the tab, the correct page loads properly, except that the session gets lost.

I created a user name of : smfuser and password of : smfuser
to gain access and see what I am talking about more clearly...

I would add code to this... but I don't know what code is pertinent...

**  UPDATE : I have been using firefox 3.03 and this problem occurs...
When I use IE 7.06, the page works perfectly with all of the session information working properly.

I found the solution here... http://www.simplemachines.org/community/index.php?topic=285876.msg1877830#msg1877830

Not that this REALLY solves any problems... but it does actually work...



Terry Mullins
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 18, 2009, 04:47:05 PM
I have read everypage in this thread, and have noticed alot of people have been having problems with the new tab being the visibly active tab.

I also suffer from this problem, and do not understand any of the solutions given.

My tab is linked to an outside page, but does not change to be the active tab while I am on the outside page. Can anyone help me?
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: IchBin™ on May 18, 2009, 05:06:09 PM
How are you viewing the page in SMF if it is external? Can you show the example links to your forum and your external page?
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 19, 2009, 02:21:23 AM
sorry, I didn't explain that very well.
What I meant was external from the forum folder.

Here is the url:
http://www.flashuk1983.byethost4.com

The tab I have added is the "frontpage" tab
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: TerryMullins on May 19, 2009, 06:14:45 AM
Flash,

Can you show us the code that you are using for this ?
I'm sure that it must be some small thing that just isn't right there...

Terry
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 19, 2009, 07:32:34 AM
Sure, the code I used it plainly here........
http://www.simplemachines.org/community/index.php?topic=63203.0 (http://www.simplemachines.org/community/index.php?topic=63203.0)
I've done both steps and tried both versions
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: TerryMullins on May 19, 2009, 09:33:36 AM
I was referring to the 'actual code' in your page... not the code that was offered for demonstration purposes... :D

If you can post the snippet of code, (that you are trying to make work) here, perhaps we can review it and possibly determine where the problem(s) are...
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 19, 2009, 10:06:12 AM
That IS the code I'm using.
substituted the word chat for the word frontpage and altered the url for the url of my frontpage.
but if it helps here's what I did...

Found if ($context['current_action'] == 'search2')
$current_action = 'search';

added after   if ($context['current_action'] == 'frontpage')
      $current_action = 'frontpage';


found // Show the [home] button.
added before       // Show the [frontpage] button.
       echo ($current_action=='frontpage' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
                               <td valign="top" class="maintab_' , $current_action == 'frontpage' ? 'active_back' : 'back' , '">
                                       <a href="http://www.flashuk1983.byethost4.com">frontpage</a>
                               </td>' , $current_action == 'frontpage' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



It does exactly what it says it should, and adds a new tab, but I don't know how to make the tab visibly active (ie. change colour while on that page)
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: IchBin™ on May 19, 2009, 02:43:28 PM
You can't really do it that way. $current_action is equal to the url in SMF where it says "action=forum" or "action=profile". If your page does not put the action in the URL you cannot use $current_action like you have done.

You will have to assign $current_action='frontpage'; by doing some custom coding. However, I'm not sure it will work since your custom page lives at /index.php and your forum lives at forum/index.php.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: unrelenting on May 21, 2009, 11:45:37 PM
FlashUK1983, try it without the


   if ($context['current_action'] == 'frontpage')
      $current_action = 'frontpage';


I set mine up a long time ago and just looked it over. It doesn't have that line but it does have the button code and it works as it should.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 22, 2009, 07:48:33 AM
Thanks for trying, but that didn't work.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: IchBin™ on May 22, 2009, 03:18:52 PM
Ok, I will try to explain how this works so that maybe some of you will understand why it's "not" working for you.

$current_action is what is grabbed from the URL. When you look at your URL throughout the forum you will see at certain points that action=pm, aciton=profile, or action=admin etc. action is what $current_action is set to. So, if you are on a page like your viewing boards board=1.0 or a topic where topic=586 in the URL. You will notice that the home button is always highlighted. This is because in the template_menu function there is no check for board or topic in the URL. There is ONLY checks for $current_action (action in the URL). So naturally, you need to ask yourself "How can I detect the current page that I'm on so I can highlight the button?". What can you check in the URL?

FlashUK1983, your page isn't even inside SMF since its at a different URL. Going to be hard to tell you how it should work if you don't show us how you're doing your "frontpage".
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 22, 2009, 05:11:03 PM
Quote from: IchBin™ on May 22, 2009, 03:18:52 PM
FlashUK1983, your page isn't even inside SMF since its at a different URL. Going to be hard to tell you how it should work if you don't show us how you're doing your "frontpage".

I understand everything before this, but I don't understand what you meant by "How you're doing your "frontpage"."
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: TerryMullins on May 22, 2009, 05:29:03 PM
I think that he meant, how you are using the 'outside page', outside of SMF.

Terry
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 22, 2009, 08:41:00 PM
Aaaah, simple

URL -
       ->forum->forum /smf folders and info
       ->index.php (AKA "frontpage")
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: IchBin™ on May 22, 2009, 08:54:08 PM
Are you using a mod to make the frontpage, or is it just a PHP page? Can you post the code for that page?
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 22, 2009, 08:58:59 PM
It's just a PHP page.

<?php 

$ssi_theme 
0;
$ssi_layers = array('main');
require(
"MYPAGEURL/forum/SSI.php"); 
?>


<HTML>
<center>
THIS PAGE IS STILL UNDER CONSTRUCTION,<br>
PLEASE TRY AGAIN AT A LATER DATE<br>
<img src="URL">
</center>


</HTML>
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: IchBin™ on May 22, 2009, 09:04:57 PM
And since you're not using the default theme that this topic is referring to, can you post the code to your template_menu function too please?
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 22, 2009, 09:07:48 PM
I am using the default theme.

I have admin set to use the default theme and I test everything on that first.
All of my members and guests are defaulted to a different theme.

sorry if I'm clutching at straws here, but would it be possible to use a code which says along the lines of "If Url = ?????????? then highlight this tab".

After scanning through the current code I'm using, it seems to be doing that now, but saying"If action=" instead.

Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: IchBin™ on May 22, 2009, 09:14:17 PM
You might try setting in your custom page $current_action = 'frontpage'; and see if that changes it. If not, I'm not sure how to get it to work then since you are using a page that is outside of SMF.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 23, 2009, 07:34:05 PM
Just thought I'd drop by and let you know, I've solved my problem.

Instead of using
   if ($context['current_action'] == 'frontpage')
      $current_action = 'frontpage';


I used the following instead

        if ($_SERVER['REQUEST_URI']=='/')
$current_action = 'frontpage';




Thank you to everyone who tried to help me.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: TerryMullins on May 23, 2009, 08:12:52 PM
I just went to your page and tried it clicked on 'Frontpage' but it did not work as you wanted it to.

I tried again and got:
Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.

Terry
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 23, 2009, 08:15:55 PM
The errors you see are because I am currently setting up the other themes.
If you try it now, while the default theme is active, you will see it in action.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: TerryMullins on May 23, 2009, 08:17:30 PM
I tried again and your page displays except that the 'frontpage' is not highlighted when you are on the frontpage.

Have you looked into tinyportal ?  It looks to me like it might work for what you're trying to do.

Terry
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: TerryMullins on May 23, 2009, 08:19:31 PM
It most certainly does work.
Job well done... I will have to make a note of this for the future..

Terry
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 23, 2009, 08:20:54 PM
Thank you.

I'm having a little trouble transferring it over to my other themes, but I'm working on that now.
I think there may be a small piece of coding I've missed somewhere
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: FlashUK1983 on May 23, 2009, 08:37:43 PM
OK, so to add a tab for a page outside of the forum, but still using the forum theme from the SSI.php (click here for help on SSI.php) (http://docs.simplemachines.org/index.php?topic=400)

find$current_action = 'home';

add after  ($_SERVER['REQUEST_URI'], '/')
$current_action = 'chat';


then find<td class="maintab_' , $first , '">&nbsp;</td>';

add after  // Show the [chat] button.
   echo ($current_action=='chat' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'chat' ? 'active_back' : 'back' , '">
               <a href="http://www.mysite.com/chat.php">chat</a>
            </td>' , $current_action == 'chat' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


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


and change the line <a href="', $scripturl, '">' , $txt[103] , '</a>

to <a href="http://www.mysite.com/forum/index.php">' forum'</a>


I hope this little tutorial is helpful and easy to understand.

Also, this code works fine for the default theme. It may need tweeking in some places for other themes.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Cavalier07 on June 22, 2009, 07:53:03 PM
I'm having trouble with this as I'm hopeless with these sort of things.

I'm trying to create a link to my forum as I have SimplePortal enabled and when I edit the script all I get are errors with the code

So can anyone do this I want Forum as the 1st link and well the forum is at http://legitsites.com/index.php?action=forum.

I'll attach the file and hope someone can do this quick edit
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: .Vapor on July 07, 2009, 10:40:25 AM
Here ya go:


<?php
// Version: 1.1.5; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '1.1';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as oppossed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status seperate from topic icons? */
$settings['seperate_sticky_lock'] = true;
}

// The main sub template above the content.
function template_main_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"'
$context['right_to_left'] ? ' dir="rtl"' '''><head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title'], '" />', empty($context['robot_no_index']) ? '' '
<meta name="robots" content="noindex" />'
'
<meta name="keywords" content="PHP, MySQL, bulletin, board, free, open, source, smf, simple, machines, forum" />
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/script.js?fin11"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";
// ]]></script>
<title>'
$context['page_title'], '</title>';

// The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/style.css?fin11" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/print.css?fin11" media="print" />';

/* Internet Explorer 4/5 and Opera 6 just don't do font sizes properly. (they are big...)
Thus, in Internet Explorer 4, 5, and Opera 6 this will show fonts one size smaller than usual.
Note that this is affected by whether IE 6 is in standards compliance mode.. if not, it will also be big.
Standards compliance mode happens when you use xhtml... */
if ($context['browser']['needs_size_fix'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/fonts-compat.css" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" target="_blank" />
<link rel="search" href="' 
$scripturl '?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name'], ' - RSS" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="' 
$scripturl '?board=' $context['current_board'] . '.0" />';

// We'll have to use the cookie to remember the header...
if ($context['user']['is_guest'])
{
$options['collapse_header'] = !empty($_COOKIE['upshrink']);
$options['collapse_header_ic'] = !empty($_COOKIE['upshrinkIC']);
}

// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'], '

<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header = '
, empty($options['collapse_header']) ? 'false' 'true'';

function shrinkHeader(mode)
{'
;

// Guests don't have theme options!!
if ($context['user']['is_guest'])
echo '
document.cookie = "upshrink=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink").src = smf_images_url + (mode ? "/upshrink2.gif" : "/upshrink.gif");

document.getElementById("upshrinkHeader").style.display = mode ? "none" : "";
document.getElementById("upshrinkHeader2").style.display = mode ? "none" : "";

current_header = mode;
}
// ]]></script>'
;

// the routine for the info center upshrink
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
var current_header_ic = '
, empty($options['collapse_header_ic']) ? 'false' 'true'';

function shrinkHeaderIC(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkIC=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_ic", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";

current_header_ic = mode;
}
// ]]></script>
</head>
<body>'
;

//Display ads on the top of the page
if (function_exists("show_topofpageAds"))
 {
$ads show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
 }




echo 
'
<table cellspacing="0" cellpadding="0" border="0" width="100%">

<tr>
<td  style="padding: 0ex 0px 0ex 0px;"><a href="'
.$scripturl.'?action=forum" title=""><img src="'$settings['images_url'], '/logo.png"  alt="" /></a></td>';
//Welcome Ads
if (function_exists("show_welcomeAds"))
{
$ads show_welcomeAds();
if(!empty($ads))
{
echo '<td class="windowbg2">';
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
echo '</td>';
}
unset($ads);
}
echo '</tr></table>';

echo 
'


'
;



echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' style="width: 100%;"' '''>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="catbg" height="32">'
;

if (empty($settings['header_logo_url']))
echo '
<span style="font-family: Verdana, sans-serif; font-size: 140%; ">'
$context['forum_name'], '</span>';
else
echo '
<img src="'
$settings['header_logo_url'], '" style="margin: 4px;" alt="'$context['forum_name'], '" />';

echo '
</td>
<td align="right" class="catbg">
<img src="'
$settings['images_url'], '/smflogo.gif" style="margin: 2px;" alt="" />
</td>
</tr>
</table>'
;


// display user name
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr>'
;

if($context['user']['is_logged'])
echo '
<td class="titlebg2" height="32">
<span style="font-size: 130%;"> '
$txt['hello_member_ndt'], ' <b>'$context['user']['name'] , '</b></span>
</td>'
;

// display the time
echo '
<td class="titlebg2" height="32" align="right">
<span class="smalltext">' 
$context['current_time'], '</span>';

// this is the upshrink button for the user info section
echo '
<a href="#" onclick="shrinkHeader(!current_header); return false;"><img id="upshrink" src="'
$settings['images_url'], '/', empty($options['collapse_header']) ? 'upshrink.gif' 'upshrink2.gif''" alt="*" title="'$txt['upshrink_description'], '" align="bottom" style="margin: 0 1ex;" /></a>
</td>
</tr>
<tr id="upshrinkHeader"'
, empty($options['collapse_header']) ? '' ' style="display: none;"''>
<td valign="top" colspan="2">
<table width="100%" class="bordercolor" cellpadding="8" cellspacing="1" border="0" style="margin-top: 1px;">
<tr>'
;

if (!empty($context['user']['avatar']))
echo '
<td class="windowbg" valign="middle">'
$context['user']['avatar']['image'], '</td>';

echo '
<td colspan="2" width="100%" valign="top" class="windowbg2"><span class="middletext">'
;

// If the user is logged in, display stuff like their name, new messages, etc.
if ($context['user']['is_logged'])
{
echo '
<a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a> <br />
<a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a><br />';

}
// Otherwise they're a guest - send them a lovely greeting...
else
echo $txt['welcome_guest'];

// Now, onto our second set of info, are they logged in again?
if ($context['user']['is_logged'])
{
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '
<b>'
$txt[616], '</b><br />';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '
'
$context['unapproved_members'] == $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] == $txt['approve_member'] : $context['unapproved_members'] . ' ' $txt['approve_members'], '</a> '$txt['approve_members_waiting'], '<br />';

// Show the total time logged in?
if (!empty($context['user']['total_time_logged_in']))
{
echo '
'
$txt['totalTimeLogged1'];

// If days is just zero, don't bother to show it.
if ($context['user']['total_time_logged_in']['days'] > 0)
echo $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2'];

// Same with hours - only show it if it's above zero.
if ($context['user']['total_time_logged_in']['hours'] > 0)
echo $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{
echo ' </span>
<script language="JavaScript" type="text/javascript" src="'
$settings['default_theme_url'], '/sha1.js"></script>

<form action="'
$scripturl'?action=login2" method="post" accept-charset="'$context['character_set'], '" class="middletext" style="margin: 3px 1ex 1px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' $context['session_id'] . '\');"' '''>
<input type="text" name="user" size="10" /> <input type="password" name="passwrd" size="10" />
<select name="cookielength">
<option value="60">'
$txt['smf53'], '</option>
<option value="1440">'
$txt['smf47'], '</option>
<option value="10080">'
$txt['smf48'], '</option>
<option value="43200">'
$txt['smf49'], '</option>
<option value="-1" selected="selected">'
$txt['smf50'], '</option>
</select>
<input type="submit" value="'
$txt[34], '" /><br />
<span class="middletext">'
$txt['smf52'], '</span>
<input type="hidden" name="hash_passwrd" value="" />
</form>'
;
}

echo '
</td>
</tr>
</table>
</td>
</tr>
</table>'
;

echo '
<table id="upshrinkHeader2"'
, empty($options['collapse_header']) ? '' ' style="display: none;"'' width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>'
;

// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<td width="90%" class="titlebg2">
<span class="smalltext"><b>'
$txt[102], '</b>: '$context['random_news_line'], '</span>
</td>'
;
echo '
<td class="titlebg2" align="right" nowrap="nowrap" valign="top">
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '" style="margin: 0;">
<a href="'
$scripturl'?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value="" style="width: 190px;" />&nbsp;
<input type="submit" name="submit" value="'
$txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />'
;

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</td>
</tr>
</table>
</div>'
;


// Show the menu here, according to the menu sub template.
template_menu();

//Below the menu ads
if (function_exists("show_indexAds") && function_exists("show_towerleftAds") && function_exists("show_towerrightAds"))
{
$ads show_indexAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);

//Tower left Ads
$ads show_towerleftAds();
if(!empty($ads))
echo '<table><tr><td valign="top">'$ads['type']==$ads['content'] : eval($ads['content']) ,'</td><td width="100%" valign="top">';

unset($ads);
//Tower Right Ads
$ads show_towerrightAds();
if(!empty($ads))
echo '<table><tr><td width="100%" valign="top">';
unset($ads);
}


// The main content should go here.
echo '
<div id="bodyarea" style="padding: 1ex 0px 2ex 0px;">'
;
}

function 
template_main_below()
{
global $context$settings$options$scripturl$txt;

echo '
</div>'
;

//Close table for towerright ads
if (function_exists("show_towerrightAds") && function_exists("show_towerleftAds") && function_exists("show_bottomAds"))
{
$ads show_towerrightAds();
if(!empty($ads))
echo '</td><td valign="top">'$ads['type']==$ads['content'] : eval($ads['content']) ,'</td></tr></table>'

unset($ads);
//Close table for towerleft ads
$ads show_towerleftAds();
if(!empty($ads))
echo '</td></tr></table>';
unset($ads);

//Show ads on the bottom of the page
$ads show_bottomAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
}

     
// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '

<div id="footerarea" style="text-align: center; padding-bottom: 1ex;'
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
function smfFooterHighlight(element, value)
{
element.src = smf_images_url + "/" + (value ? "h_" : "") + element.id + ".gif";
}
// ]]></script>
<table cellspacing="0" cellpadding="3" border="0" align="center" width="100%">
<tr>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'right' 'left''">
<a href="http://www.mysql.com/" target="_blank"><img id="powered-mysql" src="'
$settings['images_url'], '/powered-mysql.gif" alt="'$txt['powered_by_mysql'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://www.php.net/" target="_blank"><img id="powered-php" src="'
$settings['images_url'], '/powered-php.gif" alt="'$txt['powered_by_php'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
<td valign="middle" align="center" style="white-space: nowrap;">
'
theme_copyright(), '



<br />

<a href="http://www.bilisimzamani.net" title="DK THEME" target="_blank"> Asalet Theme: deruni </a>




</td>
<td width="28%" valign="middle" align="'
, !$context['right_to_left'] ? 'left' 'right''">
<a href="http://validator.w3.org/check/referer" target="_blank"><img id="valid-xhtml10" src="'
$settings['images_url'], '/valid-xhtml10.gif" alt="'$txt['valid_xhtml'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
<a href="http://jigsaw.w3.org/css-validator/check/referer" target="_blank"><img id="valid-css" src="'
$settings['images_url'], '/valid-css.gif" alt="'$txt['valid_css'], '" width="54" height="20" style="margin: 5px 16px;" onmouseover="smfFooterHighlight(this, true);" onmouseout="smfFooterHighlight(this, false);" /></a>
</td>
</tr>
</table>'
;

// Show the load time?
if ($context['show_load_time'])
echo '
<span class="smalltext">'
$txt['smf301'], $context['load_time'], $txt['smf302'], $context['load_queries'], $txt['smf302b'], '</span>';

// This is an interesting bug in Internet Explorer AND Safari. Rather annoying, it makes overflows just not tall enough.
if (($context['browser']['is_ie'] && !$context['browser']['is_ie4']) || $context['browser']['is_mac_ie'] || $context['browser']['is_safari'] || $context['browser']['is_firefox'])
{
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA['
;

// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix[i].className == "code" || codeFix[i].className == "post" || codeFix[i].className == "signature") && codeFix[i].offsetHeight < 20)
codeFix[i].style.height = (codeFix[i].offsetHeight + 20) + "px";
}
}'
;
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = 0; i < codeFix.length; i++)
{
if (codeFix[i].className == "code" && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0))
codeFix[i].style.overflow = "scroll";
}
}'
;
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;

function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");

for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix[i].currentStyle.overflow == "auto" && (codeFix[i].currentStyle.height == "" || codeFix[i].currentStyle.height == "auto") && (codeFix[i].scrollWidth > codeFix[i].clientWidth || codeFix[i].clientWidth == 0) && (codeFix[i].offsetHeight != 0 || codeFix[i].className == "code"))
codeFix[i].style.height = (codeFix[i].offsetHeight + 36) + "px";
}

if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}'
;

echo '
// ]]></script>'
;
}

echo '
</div>'
;

// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;'
$context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' '''">'$txt['ajax_in_progress'], '</div>
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context$settings$options;

echo '<div class="nav" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;">';

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo '<b>'$settings['linktree_link'] && isset($tree['url']) ? '<a href="' $tree['url'] . '" class="nav">' $tree['name'] . '</a>' $tree['name'], '</b>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo '&nbsp;>&nbsp;';
}

echo '</div>';
}

// 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''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 '
         <center><table width="100%" cellpadding="0" cellspacing="0" border="0" style="margin-left: 0px;">
            <tr>
               <td class="maintab_' 
$first '">&nbsp;</td>';

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

    
// Show the [forum] button.
   
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'?action=forum">Forums</a>
            </td>' 
$current_action == 'forum' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

   
// Show the [help] button.
   
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'help' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=help">' $txt[119] , '</a>
            </td>' 
$current_action == 'help' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

   
// How about the [search] button?
   
if ($context['allow_search'])
      echo (
$current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'search' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=search">' $txt[182] , '</a>
            </td>' 
$current_action == 'search' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

   
// Is the user allowed to administrate at all? ([admin])
   
if ($context['allow_admin'])
      echo (
$current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'admin' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=admin">' $txt[2] , '</a>
            </td>' 
$current_action == 'admin' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

   
// Edit Profile... [profile]
   
if ($context['allow_edit_profile'])
      echo (
$current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'profile' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=profile">' $txt[79] , '</a>
            </td>' 
$current_action == 'profile' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

   
// Go to PM center... [pm]
   
if ($context['user']['is_logged'] && $context['allow_pm'])
      echo (
$current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'pm' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=pm">' $txt['pm_short'] , ' '$context['user']['unread_messages'] > '[<strong>'$context['user']['unread_messages'] . '</strong>]' '' '</a>
            </td>' 
$current_action == 'pm' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

   
// The [calendar]!
   
if ($context['allow_calendar'])
      echo (
$current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'calendar' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=calendar">' $txt['calendar24'] , '</a>
            </td>' 
$current_action == 'calendar' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

   
// the [member] list button
   
if ($context['allow_memberlist'])
      echo (
$current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'mlist' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=mlist">' $txt[331] , '</a>
            </td>' 
$current_action == 'mlist' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


   
// If the user is a guest, show [login] button.
   
if ($context['user']['is_guest'])
      echo (
$current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'login' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=login">' $txt[34] , '</a>
            </td>' 
$current_action == 'login' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


   
// If the user is a guest, also show [register] button.
   
if ($context['user']['is_guest'])
      echo (
$current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'register' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=register">' $txt[97] , '</a>
            </td>' 
$current_action == 'register' '<td class="maintab_active_' $last '">&nbsp;</td>' '';


   
// Otherwise, they might want to [logout]...
   
if ($context['user']['is_logged'])
      echo (
$current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' $first '">&nbsp;</td>' '' '
            <td align="center" valign="top" class="maintab_' 
$current_action == 'logout' 'active_back' 'back' '">
               <a href="'
$scripturl'?action=logout;sesc='$context['session_id'], '">' $txt[108] , '</a>
            </td>' 
$current_action == 'logout' '<td class="maintab_active_' $last '">&nbsp;</td>' '';

   
// The end of tab section.
   
echo '
            <td class="maintab_' 
$last '">&nbsp;</td>
         </tr>
      </table></center>'
;

}

// 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']] . '</a>';

$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>';
}

?>




I have made the edit for you but in the future...just add this:


// Show the [forum] button.
   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, '?action=forum">Forums</a>
            </td>' , $current_action == 'forum' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: qu3ll0 on August 07, 2009, 08:31:43 AM
I need some help please.

I'm trying to add a custom tab as follow:

if (isset($_GET['board']) && $_GET['board'] == 25)
                $current_action = 'tracker';


and then

// Show the [tracker] button.
      if ($context['user']['is_logged'])
                echo ($current_action == 'tracker' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
                              <td  class="maintab_' , $current_action == 'tracker' ? 'active_back' : 'back' , '">
                                      <a href="', $scripturl, '?board=25">' , $txt['tracker'] , '</a>
                              </td>' , $current_action == 'tracker' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


$txt['tracker'] is correctly defined in the language file.

I did the modifications to the index.template.php of the Enterprise theme.

The tab correctly works but when I click on it the 'forum' tab became active instead of the 'tracker' tab.

Could some one find what is wrong in my code? I cannot find any error...

Thanks in advance.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: abcd789 on September 28, 2009, 01:29:14 PM
sir i want to add games option i.e arcade to the menu after forum in the site... how to do that...plzz help.... thank u in advancce...
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Gary on October 01, 2009, 12:47:27 PM
Just follow the instructions in the first post. :P
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Natolii on October 05, 2009, 10:11:37 AM
Okay, My question is kinda simple.

I'm currently running the dark4 theme and want to get mt new links to open a new window (or tab) in the browser. The links work as they should, I just want to add the additional feature of not having to navigate off the forum page.

// Show the [chat] button.
echo '<li><a' , $current_action=='chat' ? ' class="current"' : '' , ' href="http://ladykayle.com/forum/chat/flashchat.php"><span>' , 'Chat' , '</span></a></li>';

// Show the [gallery] button.
echo '<li><a' , $current_action=='gallery' ? ' class="current"' : '' , ' href="http://ladykayle.com/gallery/index.php"><span>' , 'Gallery' , '</span></a></li>';
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: IchBin™ on October 06, 2009, 08:22:30 PM
All you need is to add the target="" attribute.

// Show the [chat] button.
echo '<li><a' , $current_action=='chat' ? ' class="current"' : '' , ' href="http://ladykayle.com/forum/chat/flashchat.php" target="_blank"><span>' , 'Chat' , '</span></a></li>';
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Natolii on October 06, 2009, 09:06:16 PM
Can we say Duh? ;)

Thanks Ichbin. I wasn't thinking that the obvious code would work.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Digger1874 on October 25, 2009, 06:20:10 PM
I am using the Headline theme and I've followed the instruction on page 1.

I get the buttons to show up on the menu bar but the ones I've added seem jumbled up and not all in one line.

I'm thinking that this has to do with the width of the menu bar perhaps? Any help would be most appreciated.

Using smf 1.1.10
Tp.1.04 and various mods
I am attaching my index.template.php
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: IchBin™ on October 25, 2009, 08:08:21 PM
Digger, this guide is only a guide for the default theme. Any custom theme will need to have different code. What you need to do, is look at the code of your other buttons. Copy one of the buttons like the help button, and then change it to be gallery instead of help in the pertinent parts of the code. Also, don't forget to check the topic of the theme that you download, as most likely someone has already done a button code or something.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Digger1874 on October 25, 2009, 08:34:01 PM
thanks, I'll try there  ;D
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: bigt62187 on November 17, 2009, 12:45:54 PM
i dont know where to post this but im useing the xbox 360 theam and i have some mod that put tabs on the meun and they dont look the same can some one help me ive been use smf for about 4 day so im kinda new to this ive looked tho the coad i put in but just cant do it hears a link to my site http://02ee24b.netsolhost.com/Fourm/index.php
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: webriq on November 26, 2009, 02:22:38 AM
Thanks for the information
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: pitchawp on December 30, 2009, 06:43:45 PM
Hi

I was wondering if any of you guys could help me out.

I have TinyPortal installed and is set as my homepage which displays the latest news submissions, it would be nice to do it by wordpress like vbulletin sites can do :S

But anyways, I would like a a separate page on my navbar that links to my Forums page (forum index). Do you get me?

So it will go:  HOME   FORUMS   HELP   SEARCH .... and so on

My site: scoopda .com

Thanks a lot if anyone can help me, much appreciated.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: learnenglishonline on April 05, 2011, 04:44:33 AM
Thank you so much sharing for nice information. It's very important post. Great!!!

_______
Daniel
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: bluehaze1991 on September 01, 2011, 11:41:11 PM
Do i need to have buttons created to add buttons for the Essence theme for smf 1.1.14??

I want to add the media button for (Aeva)
A forum button for my (forum)
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Gary on September 02, 2011, 12:06:30 AM
If the theme you're using uses images for buttons, yes. If not, then no, you can just edit a few lines of code in index.template.php.
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: bluehaze1991 on September 02, 2011, 12:35:46 AM
yeah it only uses text..how do i add the url to the index template...i tried understanding whati read on this board but im still not sure where i add the url that will have the tab direct to [forum][gallery] ect
Title: Re: [1.1] How to add tabs to Core (NDT)?
Post by: Jane77 on May 29, 2012, 08:06:43 AM
I've been adding tabs successfully to my SMF 1.1.15 following:

http://docs.simplemachines.org/index.php?topic=564.msg927#msg927

however when I tried the same procedure (with "obvious"? modification) for adding a tab that would only be visible to admins I got the tab and it went to the url I defined but the tab was called "admin". Can anyone advise how I can do it correctly? (yes I changed all instances of "admin" to my desired tab name in the relevant piece of code but no luck).

Thanks,

Jane