The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How do I pass the userid in a URL
I'm integrating a 3rd party script. When the user clicks on a particular link, I need to attach a the userid of the currently logged in user as a subid in the URL.
I'm sure it's buried somewhere in the documentation, but I can't find it. I've tried www.url.com/randomscript.php?subid=userid but that didn't appear to work. |
#2
|
|||
|
|||
Try the actual userid number. ie: subid=1
It's carried in.. Code:
$vbulletin->userinfo['userid'] |
#3
|
|||
|
|||
You would need to verify the id when it's sent via a url.
|
#4
|
|||
|
|||
Quote:
This is just a link that I'll be putting into a thread/post. Can I access $vbulletin->userinfo['userid'] from within a thread post? Basically, I'll be starting a new thread that explains the 3rd part script, then says Please Click Here to launch the script. How do I get the current user's userid in the <userid> part of that link? |
#5
|
|||
|
|||
What are you trying to do exactly?
You pass the url like this: Code:
$urlcode = "<a href='www.domain.com/file.php?id=".$vbulletin->userinfo['userid']."'>Link</a>"; echo $urlcode; Code:
$userid = $_GET['id']; //sanitize if used in a query $userid = mysql_real_escape_string($userid); |
#6
|
|||
|
|||
Nevermind, thanks.
|
#7
|
|||
|
|||
Did you mean in a template? You should be able to use $bbuserinfo['userid'], if you want the userid of the user clicking the link. If you want the id of the uiser who wrote the post it would be $post[userid].
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|