PDA

View Full Version : Getting Userid


BeatificFaith
12-28-2006, 01:15 PM
I would like to use the userid field in a query in order to place the users custom field information in specified places on the member.php page.

I've tried using: $vbulletin->userinfo[userid] and $userinfo[userid] but both display my userid on every page, instead of the actual users id of the profile.

How would I instead call the user id of the profile instead of the user id of the viewer?

Tommy12345
12-28-2006, 04:33 PM
try $post[userid] ?

BeatificFaith
12-29-2006, 05:45 AM
try $post[userid] ?

No, that doesn't work either :( . AFAIK that displays the id of the person who posted the post in a thread.

Adrian Schneider
12-29-2006, 05:48 AM
$userinfo[userid] is the userid of the profile you are viewing
$bbuserinfo / $vbulletin->userinfo [userid] is for the current user
$post[userid] is the poster's id

etc

BeatificFaith
12-29-2006, 06:06 AM
I see my mistake... I was attempting to assign $userinfo[userid] to a variable as a plugin. When inserting $userinfo[userid] into the actual member.php template it displays the user id.

I'm still unsure why I cannot insert it into a variable in a plugin, but this works better for me anyway.

Thanks to all who helped.

Adrian Schneider
12-29-2006, 06:08 AM
Which hook are you using for your plugin? The variable may be defined later, or you could be inside a class/function meaning it's not in scope.