News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

What am I doing wrong? (if & is_admin / is_mod help)

Started by cotdagoo, April 27, 2006, 06:14:30 AM

Previous topic - Next topic

cotdagoo

Been trying to change the 'dont show last edit if admin' to include moderators as well.. Can't seem to figure out why the following code isn't working. Seems to pass the variable fine if the user is admin, but when the user is a  mod the last edit time still shows. I would think that if the admin part worked the mod part would as well.. I'm pretty new to php, anyone have a suggestion?

if (($user_info['is_admin']) || ($user_info['is_mod'])){
$msgOptions['modify_time'] = 0;
}

Sverre

For Administrators, Global Moderators and Moderators you can use this if statement:

if (in_array(1, $GLOBALS['user_info']['groups']) || in_array(2, $GLOBALS['user_info']['groups']) || in_array(3, $GLOBALS['user_info']['groups']))

Or if you add/have added $user_info to your global statement, you can use this instead:

if (in_array(1, $user_info['groups']) || in_array(2, $user_info['groups']) || in_array(3, $user_info['groups']))

cotdagoo


Advertisement: