TinyPortal

Development => Support => Topic started by: bigsimon on January 26, 2009, 10:28:35 PM

Title: So I got TP working with 1.1.7... but...
Post by: bigsimon on January 26, 2009, 10:28:35 PM
Yeah.  Piece of cake.  TP seems to have come a long way since I tried (and failed) installing it a couple years back.  I'm having a minor problem, however, and was wondering if someone could lend me a hand.

I'm using the wow-DK (http://custom.simplemachines.org/themes/index.php?lemma=78) theme, and have added in the Forum tab at the top.  Problem is, I can't get its background to change like the other tabs when they're selected.

Here's the code I've got for that tab, along with the code of the two tabs to either side of it.

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'off_back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

}

//TP Tab Code Begin

if($settings['TPortal_front_type']!='boardindex')
// Show the [forum] button.
echo ($current_action=='forum' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
<td valign="top" class="maintab_' , $current_action == 'forum' ? 'active_back' : 'off_back' , '">
<a href="', $scripturl, '?action=forum">' , $txt['tp-forum'].'</a>
</td>' , $current_action == 'forum' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';

//TP Tab Code End


// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '<td class="maintab_off_' . $first . '">&nbsp;</td>' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'off_back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '<td class="maintab_off_' . $last . '">&nbsp;</td>';


You can see that I've modified the tab code to include the tab background CSS, but for some reason when I click the Forum tab, the Admin tab stays active, in appearance only.  In other words, an active tab should be red, but when the Forum tab is active, the Admin tab is red.  Make sense?

Lemme know if you need any more code.  I'd appreciate any help I can get.
Title: Re: So I got TP working with 1.1.7... but...
Post by: G6Cad on January 26, 2009, 10:39:55 PM
Did you add the 'forum', to the array ?   
Just over the button code you have a long row "if in array" ( 'admin', 'bla', 'bla' etc ) 
Add in the forum there and see if it helps
Title: Re: So I got TP working with 1.1.7... but...
Post by: Crip on January 26, 2009, 10:43:59 PM
Which TP version?
Title: Re: So I got TP working with 1.1.7... but...
Post by: bigsimon on January 26, 2009, 10:44:36 PM
Ah!  There were two areas with "if {in_array".  I had only added 'forum' to one of them.

Thank you.  That fixed it.

Oh... and 1.06beta2, working with SMF1.1.7.
Title: Re: So I got TP working with 1.1.7... but...
Post by: Crip on January 26, 2009, 10:46:49 PM
Cool!
Title: Re: So I got TP working with 1.1.7... but...
Post by: G6Cad on January 27, 2009, 06:09:58 AM
I will mark this solved then  :up: