View Full Version : userinfo vars
thepomonacow
02-11-2006, 05:13 AM
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???
chdir('/home/mysite/public_html/connect');
require_once('./global.php');
$id = $vbulletin->userinfo['userid'];
$name = $vbulletin->userinfo['username'];
echo $id, $name;
Daniel
02-11-2006, 05:38 AM
May have better luck in this forum:
https://vborg.vbsupport.ru/forumdisplay.php?f=111
Logikos
02-11-2006, 05:42 AM
I've had this problem when I was creating my custom portal. Things you should remember: Cookies need to be set, try logging in from the forums and then going back to that page with a CRT+F5. (Hard Refresh)
Make sure all paths in your HTML is correct. vBulletin default template point to URL like so:
<script type="text/javascript" src="clientscript/vbulletin_global.js"></script>
<script type="text/javascript" src="clientscript/vbulletin_menu.js"></script>
Use full URLS like:
<script type="text/javascript" src="$vboptions[bburl]/clientscript/vbulletin_global.js"></script>
Since your no longer in the forums directory. Should work, as I don't see a problem with your code. :)
Edit: This might help, adding a slash...
chdir('/home/mysite/public_html/connect');
To:
chdir('/home/mysite/public_html/connect/');
Trigunflame
02-11-2006, 05:43 AM
This forum category is not for posting questions.
thepomonacow
02-11-2006, 07:47 PM
So sorry trigunflame!!!!!!
Logikos
02-11-2006, 08:26 PM
thepomonacow, Just ignore those who have enough time to correct your posting abilities, but not enough time to answer the threads question. I reported the thread to the staff asking them to move it when you first posted this. Not everyone understands that people make mistakes. Anyway, did my post above happen to help at all?
Adrian Schneider
02-11-2006, 10:01 PM
Check your vB cookie settings, you may have specified the cookies for a certain folder.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.