1. 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

Discussion in 'XenForo Development Discussions' started by Glacksy, Feb 29, 2012.

  1. Glacksy

    Glacksy Member

    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 ;)
    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:"
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    In your PHP code you can use this to access the username of the logged in user:

    $visitor = XenForo_Visitor::getInstance();
    $user = $visitor['username'];
  3. Glacksy

    Glacksy Member

    nice, but it return "blank"
    not sure why, maybe some other issues which is causing it tho ;)

    - thanks

Share This Page