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

How to call user information in a PHP file?

Discussion in 'XenForo Development Discussions' started by Richey, Apr 9, 2011.

  1. Richey

    Richey Member

    Hey guys,

    how can I get user information inside of a php file I include via addon?

    In vBulletin it was something like:
    global $vbulletin;
    $username = $vbulletin['username']

    How to do this in xenForo?

    Have a nice weekend! :)
  2. Onimua

    Onimua Well-Known Member

    $visitor XenForo_Visitor::getInstance();
    $visitor['user_id']; // user id
    Richey likes this.
  3. Richey

    Richey Member

    Works perfect, thank you Onimua!
    Onimua likes this.

Share This Page