News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Help add forum Botton

Started by dumpster1979, March 28, 2010, 03:35:09 AM

Previous topic - Next topic

dumpster1979

i added a forum botton and it works the only thing im trying to fix is ware it say forum that is a little higher then home botton
can someone tell me how to move it down
I have SMF 1.1.11 and im use BlackRain Theme
here is a pic of it


here is the code i used

  // Show the [forum] button.      global $modSettings;      if (in_array($modSettings['sp_portal_mode'], array(1, 3)))     
echo '<li', $current_action=='forum' ? ' id="active"' : '', '><a href="', $scripturl, '?action=forum">Forum</a></li>';

Matthew K.

Code (Replace) Select

// Show the [forum] button.
global $modSettings;
if (in_array($modSettings['sp_portal_mode'], array(1, 3)))     
echo '<li', $current_action=='forum' ? ' id="active"' : '', '><a href="', $scripturl, '?action=forum">Forum</a></li>';

dumpster1979

Ok i will try this and let you no if it work's

Thank's

NoSoKoMoS™

man tell me please how you add it please! i want add Shop Button. please. man

dumpster1979

Quote from: Labradoodle-360 on March 28, 2010, 03:45:19 AM
Code (Replace) Select

// Show the [forum] button.
global $modSettings;
if (in_array($modSettings['sp_portal_mode'], array(1, 3)))     
echo '<li', $current_action=='forum' ? ' id="active"' : '', '><a href="', $scripturl, '?action=forum">Forum</a></li>';


All that did was remove the forum botton

NoSoKoMoS™

the code i add into index.template.php??

Matthew K.

Take a look at the condition.
if (in_array($modSettings['sp_portal_mode'], array(1, 3)))     
Is that true, and it's still not showing?
Labradoodle-360

dumpster1979

Quote from: NoSoKoMoS™ on March 28, 2010, 04:08:40 AM
the code i add into index.template.php??

Yes i replaced my code with ur's and it took the forum botton off

Matthew K.

What I am trying to say is, it may have taken it off because the condition is not true, so it doesn't output the button.

How it was written before, the globalization and the condition were commented out, which may be the reason it now doesn't show, if the condition is false.

Labradoodle-360

dumpster1979

Quote from: Labradoodle-360 on March 28, 2010, 04:10:26 AM
Take a look at the condition.
if (in_array($modSettings['sp_portal_mode'], array(1, 3)))     
Is that true, and it's still not showing?
Labradoodle-360

Yes it is true i just looked at it 4 times to make sure and then i replaced that and still gone

NoSoKoMoS™

who know SMFShop button code?

Matthew K.

@NoSoKoMoS™
SMFShop's Mod Support Topic ;) Where all SMFShop questions should be posted.

Labradoodle-360

dumpster1979

#12
I tryed the code agin and it is still missing then it comes back with my code butt still to high

Here is the code after i save it and i copy the home and help code maybe that will help
// Show the [home] button.
    echo '<li', $current_action == 'home' ? ' id="chosen"' : '', '><a href="', $scripturl, '"><span>' , $txt[103] , '</span></a></li>';

      // Show the [forum] button.   global $modSettings;   if (in_array($modSettings['sp_portal_mode'], array(1, 3)))        echo '<li', $current_action=='forum' ? ' id="active"' : '', '><a href="', $scripturl, '?action=forum">Forum</a></li>';

// Show the [help] button.
    echo '<li', $current_action == 'help' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=help"><span>' , $txt[119] , '</span></a></li>';

// How about the [search] button?
if ($context['allow_search'])
    echo '<li', $current_action == 'search' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=search"><span>' , $txt[182] , '</span></a></li>';

Antechinus

You didn't copy the format for the other buttons correctly. Notice how they have <li><a><span>

You didn't put the span tags in, so the your new button isn't picking up the same css as the other buttons.
You also should be using id="chosen" for this theme instead of id="active". Do it like this:

// Show the [forum] button.   global $modSettings;   if (in_array($modSettings['sp_portal_mode'], array(1, 3)))        echo '<li', $current_action=='forum' ? ' id="chosen"' : '', '><a href="', $scripturl, '?action=forum"><span>Forum</span></a></li>';

Advertisement: