MyBB Community Forums

Full Version: Check if user is banned?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I check if user is banned?

I want to do so there comes a warning sign up at the members profile if that member is banned.

I have installed the plugin to be able to use PHP in templates from MyBB Hacks.

Anyone got any ideas?
Just customize the user name style for banned group, put a strike through it.
Or with php in templates, something like,

<if $GLOBALS['mybb']->user['usergroup'] == 5 then>

HUGE RED TEXT STATING USER IS BANNED HERE

</if>

in the profile template.
The usergroup id of banned group is 7 by default.
I forgot, not used mybb for a while now.
(2012-04-19, 09:58 PM)Solidus Wrote: [ -> ]Just customize the user name style for banned group, put a strike through it.
Or with php in templates, something like,

<if $GLOBALS['mybb']->user['usergroup'] == 5 then>

HUGE RED TEXT STATING USER IS BANNED HERE

</if>

in the profile template.

Thanks, just one problem, that $GLOBALS['mybb']->user is the viewer?
I need to check the owner of the member page?

I tried doing it this way?
<if $usergroup == 7 then>

HUGE RED TEXT STATING USER IS BANNED HERE

</if>

But that doesn't work, only if I put a "!" up before $usergroup. Any ideas?
Try this;
<if $user['usergroup'] == 7 then>
// red text goes here.
</if>
(2012-04-19, 10:30 PM)Yaldaram Wrote: [ -> ]Try this;
<if $user['usergroup'] == 7 then>
// red text goes here.
</if>

No luck there either -.-
But thanks for trying.
Oh, you're asking this on member's profile, I thought you meant memberlist.

Try this;
<if $memprofile['usergroup'] == 7 then>
// red text goes here.
</if>
(2012-04-19, 10:50 PM)Yaldaram Wrote: [ -> ]Oh, you're asking this on member's profile, I thought you meant memberlist.

Try this;
<if $memprofile['usergroup'] == 7 then>
// red text goes here.
</if>

Thanks, and sorry for the misunderstanding Big Grin