TinyPortal

General => Chit chat => Topic started by: Animal on November 10, 2006, 03:50:41 AM

Title: Added a new link, and now...
Post by: Animal on November 10, 2006, 03:50:41 AM
Hi all,

I'm running SMF RC3 with TP 0.9.6 I have added a new button to my site as described in this tutorial. (http://www.tinyportal.net/smf/index.php?topic=9919)

The code changes, here

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

and here.  I've also attached the index template. 

Quote</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';
   // Show the [downloads] button.
   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' , '">
               Downloads (http://www.simjunkies.org/Forum/index.php?action=tpmod;dl)
            </td>' , $current_action == 'downloads' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
        // Show the [help] button.

However I now have a silly issue.  I am hoping someone might have seen this and be able to help.  When in the downloads section. (The new button was added for this section) It doesn't display the main_tab_active.gif.  In other words it doesn't highlight the button for this section.

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi74.photobucket.com%2Falbums%2Fi247%2FSJ_Animal%2FSP32-20061109-152324.jpg&hash=aa11bb94e6a32c666f60dee54ca54839bf3a13e9)

Also when you view the help section it cuts off part of the help button.

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fi74.photobucket.com%2Falbums%2Fi247%2FSJ_Animal%2Fhelpbuttonproblem.jpg&hash=184fdd2f53a7e93a12bfed30b71fedf5215a634a)

These aren't really big issues.  Rather just annoying to me.  I guess I can live with it if need be.  But it would be great to have the buttons looking right.  You can view my site here. (http://www.simjunkies.org/Forum/index.php?action=forum)

Thanks in advance,

Marcus

Edit: With help from Rebel Rose the help button now appears normally.  However the downloads tab still comes up without the "main_tab_active" or highlighted tab if you prefer.


Title: Re: Added a new link, and now...
Post by: G6Cad on November 10, 2006, 07:58:07 AM
Try this instead

Array code
if (in_array($context['current_action'], array('search', 'admin', 'arcade','calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin', 'tpmod')))

Button Code

</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';
// Show the [downloads] button.
echo ($current_action == 'tpmod' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tpmod' ? 'active_back' : 'back' , '">
<a href="http://www.simjunkies.org/Forum/index.php?action=tpmod;dl">Downloads</a>
</td>' , $current_action == 'tpmod' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
        // Show the [help] button.
Title: Re: Added a new link, and now...
Post by: IchBin on November 10, 2006, 05:13:10 PM
You'll need to add this to your template_menu() function.


if (isset($_GET['dl']))
$current_action = 'dlmanager';


Then in your code change download to dlmanager for the button. You don't need tpmod in the array if you do this.
Title: Re: Added a new link, and now...
Post by: Animal on November 10, 2006, 11:22:03 PM
Quote from: G6 on November 10, 2006, 07:58:07 AM
Try this instead

Array code
if (in_array($context['current_action'], array('search', 'admin', 'arcade','calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin', 'tpmod')))

Button Code

</td>' , $current_action=='forum' ? '<td class="maintab_active_last">&nbsp;</td>' : '';
// Show the [downloads] button.
echo ($current_action == 'tpmod' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tpmod' ? 'active_back' : 'back' , '">
<a href="http://www.simjunkies.org/Forum/index.php?action=tpmod;dl">Downloads</a>
</td>' , $current_action == 'tpmod' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
        // Show the [help] button.


Thanks for the response.  I tried the code, but the same problem persists.  :)

Quote from: IchBinâââ,¬Å¾Ã,¢ on November 10, 2006, 05:13:10 PM
You'll need to add this to your template_menu() function.


if (isset($_GET['dl']))
$current_action = 'dlmanager';


Then in your code change download to dlmanager for the button. You don't need tpmod in the array if you do this.

I hate to ask. But I'm not exactly sure where to put this code.  Would you please give me a little more information? 

Thank you!
Title: Re: Added a new link, and now...
Post by: Assistance on November 10, 2006, 11:47:46 PM
below the other Array code?
Title: Re: Added a new link, and now...
Post by: Animal on November 11, 2006, 12:10:02 AM
Quote from: Assistance on November 10, 2006, 11:47:46 PM
below the other Array code?

I guess I should have found that.   :o  But thank you.

I did as Ichbin suggested.  It worked perfectly!  :D  Thanks all of you for the help.

-Marcus