MyBB Community Forums

Full Version: problem with global.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I did used it this code to know is the user banned or not, if he/she is banned then print a message, but a problem occur. which is, a full forum page contain an error like "You has been banned" when I used the code, instead of my text that I want it to appear.

chdir('../'); // path to MyBB
define("IN_MYBB", 1);
require './global.php';
if($mybb->user['usergroup']=="7")
{
    echo "You are banned.";//I just want this to appear not a full web
                                    //page contains an error
    exit;
}

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
is there a way to test if the user is blocked or not without include global.php?

Thank's in advance
it seems that I have to edit the global.php
But I afraid of errors that may occur when I do modifications.
If anybody have a better idea please share it with us

Thank's in advance Rolleyes