![]() |
Can't access variables in the advertisment HTML
I want to generate a random number and use it in the ad HTML to rotate banners, but I can't find the right hook to do it.
In a plugin (which one?!) PHP Code:
HTML Code:
<vb:if condition="$rotate_banner">banner.gif</vb:else>...</vb:if> Anoyne has any idea? |
Dammit, I found the solution in an older plugin of mine; I already solved this before.
For future reference PHP Code:
Change the template name according to the ad position. |
This drives me crazy.
At my test installation, the variable is preregistered alright. At the live instance, the variable is not preregistered and I can't access it from the template ad_global_below_navbar. The plugin is the same. The ad code is the same. But it just doesn't preregister on the live installation. Do you have any ideas why? |
Can we see all of the code in question, it seems like the logic in your first and second posts are different (defining a dynamic boolean in the former and not in the latter).
|
Hi Danny, thanks.
I modified it a bit between the posts. Plugin at global_bootstrap_complete PHP Code:
Code:
<!-- rotation: {vb:raw rotation} --> |
I think it is the hook location that is causing the problem, have tried one of the global_ hooks? global_start or global_setup_complete ?
|
Oh my, thank you Danny for the kick in the ass! After playing around with it, I found that the hook cache_templates works just fine.
It's still a mystery to me why it works on the test installation and not on the live one, but that is probably due to a different configuration and plugins. Thanks a lot. |
I'm curious too, is your test installation running the same version?
|
All times are GMT. The time now is 12:04 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|