I am having a hell of a time trying to get the userinfo['userid'] and userinfo['username'] variables from vbulletin. I have attached my code to sho how I am trying to do it. I am trying to use the variables on a page outside of the forum directory.
the result printed out is "0,Unregistered". I know for a fact that I am logged in. Does anyone see anything I am doing wrong???
Code:
chdir('/home/mysite/public_html/connect');
require_once('./global.php');
$id = $vbulletin->userinfo['userid'];
$name = $vbulletin->userinfo['username'];
echo $id, $name;