The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to use variables created inside a hook
I have created a hook, attached at location showthread_postbit_create, in showthread.php. The code in the hook does some calculations and returns some values to some variables, let's call them $show1, $show2 etc.
At the end of the hook, I check the variables, by echoing them, and they are correct. However, when I try to use them inside postbit template, they are empty. Is there a specific way to call these variables? I even tried making them global, still no luck. Rgds and tnx |
#2
|
|||
|
|||
I'd like to know that too.
|
#3
|
|||
|
|||
Did you use a global before assigning the vaules?
|
#4
|
|||
|
|||
Quote:
|
#5
|
|||
|
|||
Unfortunatelly yes, you have to declare them as global, as I find out.
|
#6
|
|||
|
|||
Really? Crap. Well then, it would be IMHO the best to use those variables as $GLOBALS['var']
its less clutter than global $var; $var = |
#7
|
||||
|
||||
Another possibility:
In the Hook: $vbulletin->foo = 'bar'; In the Postbit {$this->registry->foo} |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|