The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
[Solved] get the userid?
I'm creating a small php script that should run within vb4.
I need to pass the logged-in users userid forward with the script, but how do I get it? I guess that it's something like $userid, but what exactly is it? Is there a list of all variables set by vBulletin? |
#2
|
||||
|
||||
Probably $vbulletin->userinfo['userid']
|
#3
|
|||
|
|||
Ok.
I've tried this: $userid = $vbulletin->userinfo['userid']; But that don't seem to work, am I using it wrong? |
#4
|
||||
|
||||
I don't know. You have told me nothing else about your code. If you have included the global.php file, then that variable should be available for use. You may need to pass it if it's being used in a function though.
|
#5
|
|||
|
|||
Ok, I'm new to PHP and scripting for vB.
I have however some experience with ASP classic back in the days I have created a small webpage, that I load into a widget. PHP Code:
It will be completed with a form, witch will be inserted into the database for further processing. Right now I'm just trying to figure out how all this works |
#6
|
||||
|
||||
You are loading that into a widget? You should not be putting doctype or head or body tags in there - only the table html. And, if it's a widget, then you'll want to use vB::$vbulletin->userinfo['userid'] as the variable. You also really shouldn't use echo either.... I wrote a php widget, you can see my profile for a link to it. You may want to see how I went about it.
|
#7
|
|||
|
|||
Oh, thanks!
It works now! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|