Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: liability - toukokuu 24, 2011, 12:08:32 AP

Otsikko: if ($context['user']['is_logged']) - not working
Kirjoitti: liability - toukokuu 24, 2011, 12:08:32 AP
Hi everyone,

Does the following code require anything else to work? Nothing displays, whether someone is logged in or not.

SMF 1.1.3
index.template.php
It's in the template_main_above() function with the global $context, $settings, $options, $scripturl, $txt, $modSettings included.



       // Are they logged in?
if ($context['user']['is_logged'])
{
echo '<b>', $txt['hello_member_ndt'], ' ', $context['user']['name'], '</b><br />
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br /><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
}
// Otherwise they're a guest - this time ask them to either register or login
else
{
echo ' ', $txt['welcome_guest'], '</div> ';
}


Pretty sure I'm missing something, just not sure what. Any guidance would be appreciated!
Otsikko: Re: if ($context['user']['is_logged']) - not working
Kirjoitti: Sir Osis of Liver - toukokuu 24, 2011, 12:14:42 AP
Careful, they'll spank you for double posting this topic.  (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.thekrashsite.com%2Fpics%2Fcop.gif&hash=6bb2ef0a259624a0a98af863b25c6476d82c4423)

Replied to your other thread.

Otsikko: Re: if ($context['user']['is_logged']) - not working
Kirjoitti: liability - toukokuu 24, 2011, 12:51:29 AP
ah man, I thought it was in the wrong place so I tried to delete it :(

Appreciate the response - will check it out now.
Otsikko: Re: if ($context['user']['is_logged']) - not working
Kirjoitti: Aleksi "Lex" Kilpinen - toukokuu 24, 2011, 12:53:28 AP
Both boards are fine for stuff like this, but let's continue the discussion over there then ;)
http://www.simplemachines.org/community/index.php?topic=435182