Current time: 03-20-2010, 04:37 PM Hello There, Guest! (LoginRegister)


Post Reply 
How to know that the user is banned or not?
07-04-2009, 11:13 AM
Post: #1
How to know that the user is banned or not?
how can I know that the user is banned or not?
is this correct if($mybb->user['banned']==true) //banned

Thank's in advance
Find all posts by this user
Quote this message in a reply
07-04-2009, 11:20 AM
Post: #2
RE: How to know that the user is banned or not?
Quite a number of ways... Smile

Through AdminCP > Configurations > Banning >

Also Through Modeartor Control Panel.

and yes the syntax is correct..

<font size too large, removed. use NORMAL size only, like below>
FIND OUT ABOUT MYBBCODES.COM
Visit this user's website Find all posts by this user
Quote this message in a reply
07-04-2009, 11:24 AM (This post was last modified: 07-04-2009 11:31 AM by MattRogowski.)
Post: #3
RE: How to know that the user is banned or not?
The banned usergroup ID is 7 so you could do:

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

or you could do

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

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

Is it...?? Confused

My Personal Site - Twitter
MyBB Support Team
[Image: lqscs]
Visit this user's website Find all posts by this user
Quote this message in a reply
07-04-2009, 01:41 PM (This post was last modified: 07-04-2009 01:43 PM by newaccount.)
Post: #4
RE: How to know that the user is banned or not?
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:
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
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: