The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
ad_showthread_firstpost_start troubles with plugin
Hi!
I created a plugin (admincp ->Plugins & Products -> Add New Plugin) with: Product: Vbulletin Hook Location: global_start Plugin PHP Code: PHP Code:
I tried adding the variable in global too: PHP Code:
How can I fix it? |
#2
|
|||
|
|||
The problem is that the ad_showthread_firstpost_start template is processed in the function construct_postbit (in includes/class_postbit.php), so it can't see that variable you created. Putting "global $variable_name" in your plugin doesn't help because it needs to be in the function where the variable is used.
There is a hook "postbit_display_complete" right before the ad_showthread_firstpost_start is processed, so if you could make a plugin to set your variable there that should work. If not, maybe you could create a plugin that simply has "global $variable_name;" and put it on the postbit_display_complete hook. |
#3
|
||||
|
||||
that's sad...
BTW I tried global just thingking that it was in a function |
#4
|
|||
|
|||
Well, I wasn't clear - putting "global $variable_name;" before the assignment *might* have worked in a different situation, it just turns out in this case it's the template eval that's in a function.
--------------- Added [DATE]1260467433[/DATE] at [TIME]1260467433[/TIME] --------------- Oh yeah, another thing I meant to mention - if that's the only code in your plugin, I don't think you need the ob_start() and ob_end_clean(), you only really need that when your php code produces output you want to capture. |
#5
|
||||
|
||||
no it isin't, there are other parts, it was only an example
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|