MyBB Community Forums

Full Version: the name of the user?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi. I want to print the name of the user(when the user open the page).
I did write:
chdir('../'); // path to MyBB
define("IN_MYBB", 1);
require './global.php';
$GLOBAL['dispalypageok']=false;
if($mybb->user['uid']){
// The user is logged in, say Hi
$GLOBAL['dispalypageok']=true;
echo "Hey, $mybbuser[username].<br>
}

But the username of the user never printed out?! $mybbuser[username] retreive nothing?!
Also, I want to display the number of posts of that user(the user who entered the page containing this code)
Thank's in advance
You got $mybb->user['uid'] right, not sure where $mybbuser[username] came from... the one for the username is the same as for the uid, just change uid to username.... same for posts, change uid to postnum
Thank's alot bro.. now it worked!
another question.. how can I know that the user is banned or not?
is this correct if($mybb->user['banned']==true) //banned
is there any reference that contains all the available variable $mybb->user['x'] ...
$mybb->user['banned'] is it correct?
Thank's alot