The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Putting a variable in a hook
Hi everyone,
This is my first post, so I hope I'm asking this question in the right place. Im trying to add a plugin with a variable $bbuserinfo[field#], I have been doing a lot of research and cant seem to get it to work In the PHP Code for the plugin, the variable is attached to the end of a URL. Below would be an example of how it looks: PHP Code:
PHP Code:
Can anyone help me? |
#2
|
|||
|
|||
Quote:
Which hook are you using? Also shouldn't the url have something like example.xml?do=".$bbuserinfo[fieldx]; |
#3
|
|||
|
|||
Hi EnIgMa1234,
Im trying to gather information from an xml file. I created a custom hook called $template_hook[custom_1]. I placed that in a custom page called test.php which has the hook inside the php as well (So, that's all set up right, I think?). And for the url, I'm not sure, I only tried what I posted above Below would be an example of what is inside the PHP Code: PHP Code:
|
#4
|
||||
|
||||
$template_hooks are to be used in templates and thus you may only put html in them. If you have php, then you need to put it in your custom page and then assign the output to a variable which you spit out in a template. In your php page, don't use echo, use something like this:
PHP Code:
|
#5
|
|||
|
|||
Hi Lynne,
I'm a little confused I created a plugin and inserted this is the PHP Code box: PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
#6
|
||||
|
||||
Since you are creating your own php page, you really don't need to use any plugins. You should put all your php in your test page right after the START MAIN SCRIPT lines (before $navbits). Put all the php there. Then, to eval your template, you would go:
PHP Code:
PHP Code:
You also need lines at the top of the page to 'include' the template. This should help - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. |
#7
|
|||
|
|||
It works! Thank you very very much Lynne!
I have one more quick question Would it be possible to then also have this in peoples profiles? So far I have test.php with the variable But, to make it so you can view other peoples (I am not sure ) --------------- Added [DATE]1243297579[/DATE] at [TIME]1243297579[/TIME] --------------- I am just about to get the above to work, though I dont know how I can convert this: PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|