The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
calling an external script with arguments
Greetings,
I tried this in Templates but either it went unnoticed or no-one knew/cared? I have put together a vbulletin/photopost integration that will print several of a user's last photopost uploads in their profile. to get this to work, I have to be able to call an external php script and pass the userid as a command line argument, something like thumbnail.php?user=$userid This way the script knows which user's photos to print! But, when I do this, I don't get the $userid variable passed. When I put that into phpinclude template the script gets called but it passes "$userid" instead of the actual variable content (id of the user). Does anyone know how to call an external script passing arguments like this? Thanks! Matt |
#2
|
||||
|
||||
To call the userid of the logged user, in templates, you should use $bbuserinfo[userid].
|
#3
|
|||
|
|||
Thanks, but actually that's not the question. The question is how to pass a variable or argument (such as $bbuserinfo[userid]) or any vB variable for that matter, to an external target script as in the include call, such as:
myphpscript?variable=$bbuserinfo[user] at any rate I want the userid of the profiled user, not the logged user. I keep getting the literal text, such as, "$bbuserinfo[user]" not the variable contents, sent. Regards, Matt |
#4
|
|||
|
|||
Greetings,
I find it hard to believe no one had passed a vbulletin variable to an external script. Is it not possible? Regards, Matt |
#5
|
||||
|
||||
Hiya... post a small snippet of your code... the part where you are trying to do this task?
Perhaps it's just somthing simple, like, you are generating the URL outside of the <?php ... ?> tags. |
#6
|
|||
|
|||
Thanks for a response,
at any rate, I have an independent script. I just want to pass the USERID to it so that it can print the appropriate thumbnails and call it from within the user's profile template. the actual url I am including is like: http://www.ip-sys.com/~bonsai/pictur....php?myuser=XX I want to pass the user id to it so when you're in Vbulletin user 37's profile it includes a) http://www.ip-sys.com/~bonsai/pictur....php?myuser=37 when you're in user 5 it includes b) http://www.ip-sys.com/~bonsai/pictur...r.php?myuser=5 Those are live links by the way. I think the actual code is irrelevant to the question. It's a question of how to pass variables from vBulletin to another script, any script. obviously, I need to append a vBulletin variable in place of the XX in myuser=XX, but no matter which one I include, my script receives the variable NAME not its value. Getting the generic include to show in the user profile is no problem, I just can't get the userid variable to pass. It keeps getting sent as a variable name and not resolved to a number. Thanks again, Matt |
#7
|
||||
|
||||
Ooo... me girlfriend keeps asking me for one of them trees.
Anyway... where did you say you were calling the external script from again? And, in that PHP code, are you using somthing similar to : PHP Code:
I'm doing somthing very similar, with userid, username and sessionhash at the place i'm currently building, and it works. I'm doing these things from scripts completely independant from the vB scripts, and it's just a case of putting : PHP Code:
Another thing to watch for, is trying to use variables outside the <?php ...... ?> tags.... i've done that before now, and pulled my hair out wondering why variables aren't being processed. :classic: As the recieving script is recieving your variable name, i'll assume for now that you have the generating PHP, outside the PHP tags. :smoke: :smoke: :smoke: relax, it'll get working soon enough. |
#8
|
|||
|
|||
Hi there tD,
Are you suggesting that I put the <?php ...... ?> right into the template, or something else? I am trying to get it to display in the action=getinfo display, so I called the script the way I did my other includes. Those work, but don't require any info from vB: 1. So, put the script call into php-include template: Quote:
called "getinfo" Quote:
Thanks for looking! Matt |
#9
|
||||
|
||||
I didn't realise you were using the templates... that bombs out the thought of dodgy PHP tags.
Ummm... i'm just extremely tired... I should have been in bed hours ago... i'll be a zomby at work tomorrow (today, technically). If i'm giving you no joy, hopfully at least this can get the ball rolling for others to help. Anyway... i'm not sure about the php-include template... i've never been sure of it's stability in doing code for extra needs. But, try putting your link/url generating code into the vB script that you need it from... or whack it into the global.php script if you need it everywhere. .. then your $userthumb values may work. In the admin/functions.php, you see : // ###################### Start getuserinfo ####################### ... after that... well, you can guess. Put your code after all the userinfo generating, if you wish. Or in the forums/global.php, after : // ###################### Start functions ####################### .. where the functions.php get's "required". |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|