Current time: 02-07-2012, 05:07 AM Hello There, Guest! (LoginRegister)


How to know that the user is banned or not?
07-04-2009, 11:13 AM
Post: #1
Solved: 1 Year, 4 Months, 1 Week, 1 Day, 15 Hours, 3 Minutes, 6 Seconds ago 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
07-04-2009, 11:20 AM
Post: #2
Solved: 1 Year, 4 Months, 1 Week, 1 Day, 15 Hours, 3 Minutes, 6 Seconds ago 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..
Visit this user's website Find all posts by this user
07-04-2009, 11:24 AM (This post was last modified: 07-04-2009 11:31 AM by MattRogowski.)
Post: #3
Solved: 1 Year, 4 Months, 1 Week, 1 Day, 15 Hours, 3 Minutes, 6 Seconds ago 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

Download My Plugins
My Personal Site - Twitter
[Image: eX4bjF]
Visit this user's website Find all posts by this user
07-04-2009, 01:41 PM (This post was last modified: 07-04-2009 01:43 PM by newaccount.)
Post: #4
Solved: 1 Year, 4 Months, 1 Week, 1 Day, 15 Hours, 3 Minutes, 6 Seconds ago 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


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication