SimplePortal

Support => English Support => Topic started by: Sniff on March 31, 2010, 09:59:50 AM

Title: "Forum" button looks funky.
Post by: Sniff on March 31, 2010, 09:59:50 AM
URL: http://www.seirindojo.com/stranges/index.php

how do I make the forum button look like the others there? I thought I had done everything correctly but it winds up looking really terrible! any assistance would be appreciated!

index.template.php attached if you want to take a look.
Title: Re: "Forum" button looks funky.
Post by: AngelinaBelle on March 31, 2010, 04:29:02 PM
The code you used for the forum button looks like it comes from a very different template from the code you used for the other buttons. So it is not surprising it looks different.
Code: [Select]
  // Show the [home] button.
echo '
<td align="center"><a href="', ($modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl), '">' , $txt[103] , '</a></td>';

vs
 
Code: [Select]
  // Show the [forum] button.
if (empty($context['disable_sp']) && in_array($modSettings['sp_portal_mode'], array(1, 3)))
echo
($current_action=='forum' || $context['browser']['is_ie4'])
? '<td class="maintab_active_' . $first . '">&nbsp;</td>'
: '' ,
'
<td valign="top" class="maintab_' ,
$current_action == 'forum'
? 'active_back'
: 'back' , '"><a href="', $scripturl .
($modSettings['sp_portal_mode'] == 1
? '?action=forum'
: ''),
'">',
empty($txt['sp-forum'])
? 'Forum'
: $txt['sp-forum'],
'</a>
</td>' , $current_action=='forum' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

To make it look like the others, you can code it up like the others.  I have put in some carriage returns just ke it all more clear to my eyes. you might try something along the lines of:
Code: [Select]
  if (empty($context['disable_sp']) && in_array($modSettings['sp_portal_mode'], array(1, 3)))
{
   echo '  <td align="center">',
'<a href="',  $scripturl ,  ( $modSettings['sp_portal_mode'] == 1 ? '?action=forum' : '' ), '">',
 ( empty($txt['sp-forum'])  ? 'Forum' : $txt['sp-forum']) ,
 '</a>
</td>' ;
Title: Re: "Forum" button looks funky.
Post by: Sniff on March 31, 2010, 06:35:51 PM
I am a noob, but I see now what I did wrong, thank you so much for taking the time to show me the bogus code. it's a very good learning experience. your help is much appreciated (it looks perfect now!).
Title: Re: "Forum" button looks funky.
Post by: AngelinaBelle on March 31, 2010, 08:11:19 PM
You are very welcome -- I got a lot of help around here when I first started, too. Maybe you can pass the favor along some day.
 
Can you change your message item to the green "solved" checkmark?
 
Thanks
SimplePortal 2.3.8 © 2008-2024, SimplePortal