News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

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

wilcosky

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!

Deaks

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
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Gummo

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...:(
Could some kind person please solve my problem?
http://www.simplemachines.org/community/index.php?topic=160310.0

npereira

this is good, but how do you add a tab in the admin section under Features and Options?

Gummo

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'?>
Could some kind person please solve my problem?
http://www.simplemachines.org/community/index.php?topic=160310.0

MinasC

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 !

wolfcry

#266
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.

wolfcry

I need help with this so I'm bumping it up....thanks all

wolfcry

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.

Head_Worx

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

Head_Worx

the main problem is that i cant see where do i have to put the code

wolfcry

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

wolfcry


wolfcry

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.



nuva

I don't get it, how do i use the link? if the action = chat nothing will happen...
Alone for a while I've been searching through the dark
For traces of the love you left inside my lonely heart
To weave by picking up the pieces that remain
Melodies of life--love's lost refrain

Gary

You can change the "chat" to something else like "downloads" if you want.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

nuva

Alone for a while I've been searching through the dark
For traces of the love you left inside my lonely heart
To weave by picking up the pieces that remain
Melodies of life--love's lost refrain

wolfcry

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.

Iomega0318

#278
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?
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

DealerISM

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.

Advertisement: