News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[1.1] How to add tabs to Core (NDT)?

Started by JayBachatero, December 31, 2005, 04:21:57 PM

Previous topic - Next topic

marinelife

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

JayBachatero

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
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

marinelife

thanks that worked, but any way to split them to a second line

JayBachatero

You want to add a second line of tabs?

-JayBachatero
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

marinelife

Yeah I have a good amount and tabs I need

JayBachatero

That I don't know how to do.  Sorry.

-JayBachatero
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

marinelife

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!

JayBachatero

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
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Reason

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?

JayBachatero

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
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

haktanir2

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.

haktanir2

And where can you define where the $txt[103]  (or whatever number) should be?

JayBachatero

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 ' '
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert



JayBachatero

You're welcome.  Glad to hear it worked for you.

-JayBachatero
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Acf

#36

**removed**


Any way to make the tab active?
Sigh...

JayBachatero

I believe it can be done.  I'll hit you up tom from school when  I get a chance :)
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Acf

#38
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 ;)
Sigh...

Acf

#39
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(); ?>
Sigh...

Advertisement: