MyBB Community Forums

Full Version: How to know that the user is banned or not?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
how can I know that the user is banned or not?
is this correct if($mybb->user['banned']==true) //banned

Thank's in advance
Quite a number of ways... Smile

Through AdminCP > Configurations > Banning >

Also Through Modeartor Control Panel.

and yes the syntax is correct..
The banned usergroup ID is 7 so you could do:

<?php
if($mybb->user['usergroup']=="7")
{
	echo "You are banned.";
}
else
{
	echo "You are not banned.";
}
?>

or you could do

<?php
if($mybb->usergroup['isbannedgroup']=="1")
{
	echo "You are banned.";
}
else
{
	echo "You are not banned.";
}
?>

(2009-07-04, 11:20 AM)ghazal Wrote: [ -> ]and yes the syntax is correct..

Is it...?? Confused
I did used it, but a problem occur. which is, a full forum page contain an error like "You has been banned" when I used this code:
chdir('../'); // path to MyBB
define("IN_MYBB", 1);
require './global.php';
$GLOBAL['dispalypageok']=false;
if($mybb->user['usergroup']=="7")
{
    echo "You are banned.";
    exit;
}

While I just want the page to display "You are banned" and exit from the page( do not excute the remaining code ).
how can I used that? I mean if($mybb->user['usergroup']=="7") didn't excuted, I think there is an if like this in global.php
What is the solution?

thank's in advance