I figured it out. Here is the code I use if anyone else needs it.
Code:
<?php
$root_path = $_SERVER['DOCUMENT_ROOT'];
chdir($root_path."/forum/");
require($root_path."/forum/global.php");
require_once($root_path."/forum/includes/functions_login.php");
$username = $vbulletin->userinfo['username'];
$userid = $vbulletin->userinfo['userid'];
if ($userid !=0)
{
echo "Hello $username";
}
else {
echo "No account logged in";
}
?>
--------------- Added [DATE]1370528102[/DATE] at [TIME]1370528102[/TIME] ---------------
Thanks KH99!