$context['user']['is_mod'] is not working

Started by lexqqq, March 09, 2010, 12:55:32 PM

Previous topic - Next topic

lexqqq

hello, I am using SMF 1.1.11 and SSI.php file to recognize is user registered or not on my site.
But I have a problem, $context['user']['is_mod'] is not working.

For example if I put code:

if($context['user']['is_logged']){
echo 'Welcome ' . $context['user']['name'] . '!!!<br />';

if($context['user']['is_mod']){
echo 'You are moderator!!!';
}
if($context['user']['is_admin']){
echo 'You are admin!!!';
}

} else if($context['user']['is_guest']) {
echo 'Welcome Guest!!!';
} else {
die("dont know what you are so i killed you");
}


everything works fine except $context['user']['is_mod'], which is never active, not even if I am admin, user, global moderator or moderator

please help

smp420

try if(allowedTo('moderate_board') && (!$context['user']['is_admin']))
"Things turn out best for those who make the best of the way things turn out." -Jack Buck

lexqqq


Oranos

global $user_info;

if (in_array(2, $user_info['groups']))
echo 'they are a global moderator';

if (array_intersect(array(1, 2), $user_info['groups']))
echo 'they are an admin or a global moderator';

lexqqq


Advertisement: