The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello,
I use this script for a simple rotating banner in the header: http://www.vbulletin.com/forum/showthread.php?t=170826 And it works fine. Now I am trying to put a second rotating banner after the firts post in every thread. But it does not work. Nothing shows up. I am replacing all instances of $random_banner with $random_banner2: Code:
$random_number = rand(1, 4); $random_banner2[1] = '<a href="http://www.mysite.com"><img src="http://www.mysite.com/banner1.gif" alt="" border="0" /></a>'; $random_banner2[2] = '<a href="http://www.mysite.com"><img src="http://www.mysite.com/banner2.gif" alt="" border="0" /></a>'; $random_banner2[3] = '<a href="http://www.mysite.com"><img src="http://www.mysite.com/banner3.gif" alt="" border="0" /></a>'; $random_banner2[4] = '<a href="http://www.mysite.com"><img src="http://www.mysite.com/banner4.gif" alt="" border="0" /></a>'; Code:
$random_banner2[$random_number] Please help me! Regards, Fredrik_Arvid |
#2
|
||||
|
||||
![]()
Try this:
Code:
$random_number2 = rand(1, 4); $random_banner2[1] = '<a href="http://www.mysite.com"><img src="http://www.mysite.com/banner1.gif" alt="" border="0" /></a>'; $random_banner2[2] = '<a href="http://www.mysite.com"><img src="http://www.mysite.com/banner2.gif" alt="" border="0" /></a>'; $random_banner2[3] = '<a href="http://www.mysite.com"><img src="http://www.mysite.com/banner3.gif" alt="" border="0" /></a>'; $random_banner2[4] = '<a href="http://www.mysite.com"><img src="http://www.mysite.com/banner4.gif" alt="" border="0" /></a>'; Code:
$random_banner2[$random_number2] |
#3
|
|||
|
|||
![]()
Hello Dismounted,
I tried your solution but that did not work. I am putting the code block in Admin CP -> Styles & Templates -> Style Manager -> ? ? -> Postbit Templates -> postbit at the very bottom: Code:
<!-- / post $post[postid] popup menu --> <if condition="$post[postcount] == 1 AND $GLOBALS[threadinfo][replycount] >= 2"> <div style="padding: $stylevar[cellpadding]px 0px 0px 0px"> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="thead" align="left">Annons</td> </tr> <tr> <td class="alt1" align="center"> $random_banner[$random_number] </td> </tr> </table> </div> </if> (I have got the first simple banner rotator - the one that works fine - in the footer template.) |
#4
|
||||
|
||||
![]()
Where are you putting the code block (PHP code)?
|
#5
|
|||
|
|||
![]()
I am putting it as a new plugin in: Plugin & Products System
|
#6
|
||||
|
||||
![]()
At which hook?
|
#7
|
|||
|
|||
![]()
Hook location: parse_templates
|
#8
|
|||
|
|||
![]()
Is it OK to put it in the pare_templates?
|
#9
|
||||
|
||||
![]()
Try changing to hook location to global_start.
|
#10
|
|||
|
|||
![]()
It didn`t work.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|