• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

get username logged in help

#1
i want to get the logged in user and past it in to this simple line of code
where "username" is the logged in user ;)
Code:
if(!isset($user)) $user = "username";
would it be possible to get custom profile "lines" or "bars" not sure what i shall call it, but you know, like "Location:"
 

Jake Bunce

XenForo moderator
Staff member
#2
In your PHP code you can use this to access the username of the logged in user:

Code:
$visitor = XenForo_Visitor::getInstance();
$user = $visitor['username'];