Current time: 02-09-2010, 03:41 PM Hello There, Guest! (LoginRegister)


Post Reply 
the name of the user?
07-03-2009, 02:55 PM
Post: #1
the name of the user?
hi. I want to print the name of the user(when the user open the page).
I did write:
Code:
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
Find all posts by this user
Quote this message in a reply
07-03-2009, 03:01 PM (This post was last modified: 07-03-2009 03:02 PM by MattRogowski.)
Post: #2
RE: the name of the user?
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

My Personal Site - Twitter
MyBB Support Team
MyBB Directory, coming soon.
[Image: lqscs]
Visit this user's website Find all posts by this user
Quote this message in a reply
07-03-2009, 03:16 PM (This post was last modified: 07-03-2009 06:23 PM by newaccount.)
Post: #3
RE: the name of the user?
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
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: