TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,966
  • Latest: safir45
Stats
  • Total Posts: 195,993
  • Total Topics: 21,324
  • Online today: 368
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 205
  • Total: 206
  • @rjen

Added a new link, and now...

Started by Animal, November 10, 2006, 03:50:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Animal

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.

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
            </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.


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


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.

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.



G6Cad

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.

IchBin

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.

Animal

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!

Assistance


Animal

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

This website is proudly hosted on Crocweb Cloud Website Hosting.