The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to get current user thier ID?
Hi Guys,
First time developing a plugin for vBulletin, and i think im about to pass out xD. I'm trying to do the following: Code:
$userid = $vbulletin->userinfo[userid]; $sql="SELECT `xp` FROM `rank` WHERE `userid` = '".$userid."'"; |
#2
|
|||
|
|||
$vbulletin->userinfo[userid] should work. Depending on what hook location you're using, you may need "global $vbulletin'" at the beginning of your code.
|
#3
|
|||
|
|||
I am using init_startup, putting a Global didn't work.
|
#4
|
|||
|
|||
Oh, that's why - init_startup is too early. Maybe try global_bootstrap_init_start.
|
#5
|
|||
|
|||
And ur right again, thanks man. i should hire you =p haha.
|
#6
|
||||
|
||||
try adding global $vbulletin; as first line
|
#7
|
|||
|
|||
What is the variable to get the User ID of the currently showing MEMBERINFO (users profile ID)? Can't seem to find it.
EDIT: Got it, $vbulletin->GPC['userid']; Thanks guys =D! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|