The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
|||
|
|||
|
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).
|
|
#5
|
|||
|
|||
|
Hi Danny, thanks.
I modified it a bit between the posts. Plugin at global_bootstrap_complete PHP Code:
Code:
<!-- rotation: {vb:raw rotation} -->
<object width="234" height="60">
<param name="movie" value="example<vb:if condition="$rotation == 2">-2</vb:if>.swf">
<param name="wmode" value="opaque" />
<param name="allowScriptAccess" value="always">
<embed src="example<vb:if condition="$rotation == 2">-2</vb:if>.swf" width="234" height="60" allowScriptAccess="always" wmode="opaque"></embed>
</object>
|
|
#6
|
|||
|
|||
|
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 ?
|
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
I'm curious too, is your test installation running the same version?
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|