PDA

View Full Version : New PHP File - Pulling Logged-in User ID?


Elenna
12-01-2008, 07:11 PM
I am trying to make a custom .php page for my site, and have the basics working (PHP file linked to template and displaying okay).

I am trying to pull some fields by linking to the currently logged-in user's UserID. In my select portion I am trying to have it pull the info using $bbuserinfo[userid] and $userinfo[userid], but neither is working.

I have also tried setting a variable to the above, and referencing the variable in the query, but that doesn't work either.

Is there a way to do this? I'm so sorry for the newbie-ish question!

Lynne
12-01-2008, 07:58 PM
If you want to pull the info of the person viewing the page, you would use $bbuserinfo. In order to use it though, you need to have global.php included in the page. See these articles - How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164) or [How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)

Elenna
12-01-2008, 08:17 PM
Many thanks! I had already tried one of those tutorials, but it apparently wasn't pulling the correct things. That error has been sorted out, now onto the actual coding!

ReCom
12-01-2008, 09:58 PM
$vbulletin->userinfo['userid']