Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: dumpster1979 on March 28, 2010, 03:35:09 AM

Title: Help add forum Botton
Post by: dumpster1979 on March 28, 2010, 03:35:09 AM
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
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi769.photobucket.com%2Falbums%2Fxx339%2Fdumpster1979%2FForumBotton-1.jpg&hash=e285f440db1d04f0cb088c031d320572d6818fa6)

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>';
Title: Re: Help add forum Botton
Post by: Matthew K. 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>';
Title: Re: Help add forum Botton
Post by: dumpster1979 on March 28, 2010, 03:55:11 AM
Ok i will try this and let you no if it work's

Thank's
Title: Re: Help add forum Botton
Post by: NoSoKoMoS™ on March 28, 2010, 03:57:53 AM
man tell me please how you add it please! i want add Shop Button. please. man
Title: Re: Help add forum Botton
Post by: dumpster1979 on March 28, 2010, 04:05:58 AM
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
Title: Re: Help add forum Botton
Post by: NoSoKoMoS™ on March 28, 2010, 04:08:40 AM
the code i add into index.template.php??
Title: Re: Help add forum Botton
Post by: Matthew K. 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
Title: Re: Help add forum Botton
Post by: dumpster1979 on March 28, 2010, 04:12:02 AM
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
Title: Re: Help add forum Botton
Post by: Matthew K. on March 28, 2010, 04:17:43 AM
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
Title: Re: Help add forum Botton
Post by: dumpster1979 on March 28, 2010, 04:18:27 AM
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
Title: Re: Help add forum Botton
Post by: NoSoKoMoS™ on March 28, 2010, 04:20:47 AM
who know SMFShop button code?
Title: Re: Help add forum Botton
Post by: Matthew K. on March 28, 2010, 04:21:59 AM
@NoSoKoMoS™
SMFShop's Mod Support Topic (http://www.simplemachines.org/community/index.php?topic=22396.0) ;) Where all SMFShop questions should be posted.

Labradoodle-360
Title: Re: Help add forum Botton
Post by: dumpster1979 on March 28, 2010, 04:27:09 AM
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>';
Title: Re: Help add forum Botton
Post by: Antechinus on April 21, 2010, 07:55:24 AM
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>';