The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Different Banners
Im making a adv. forum and I want to know how to get banners to change everytime the index.php refreshs.
|
#2
|
|||
|
|||
use java or cgi
|
#3
|
||||
|
||||
I did used to know the code for that using javascript. I guess I can use all my brainpower to think of it for you. Otherwise you'll have to use PHP, which is for vB.org.
I think I know the code for it in PHP as well EDIT: Ok, I remembered it almost straight away. here it is (Add this to your body tag, where you want the banner to appear.) Bits in blue require you to change whatever is there. This will have 3 different images each time the person refreshes DOnt forget to change the width/height ETC. Code:
<SCRIPT LANGUAGE="JavaScript"> var how_many_ads = 3; var now = new Date() var sec = now.getSeconds() var ad = sec % how_many_ads; ad +=1; if (ad==1) { txt="TEXT"; url="URL"; alt="ALT TEXT"; banner="BANNER URL"; width="468"; height="60"; } if (ad==2) { txt="TEXT"; url="URL"; alt="ALT TEXT"; banner="BANNER URL"; width="468"; height="60"; } if (ad==3) { txt="TEXT"; url="URL"; alt="ALT TEXT"; banner="BANNER URL"; width="468"; height="60"; } document.write('<center>'); document.write('<a href=\"' + url + '\" target=\"_top\">'); document.write('<img src=\"' + banner + '\" width=') document.write(width + ' height=' + height + ' '); document.write('alt=\"' + alt + '\" border=0><br>'); document.write('<small>' + txt + '</small></a>'); document.write('</center>'); </SCRIPT> I think thats it |
#4
|
|||
|
|||
ok ty
|
#5
|
||||
|
||||
If that doesnt work, PM me
|
#6
|
|||
|
|||
ok well im purchasing my license this weekend so Ill be testing it sometime next week. But if it doesnt work I'll PM you for sure...thanks again
|
#7
|
||||
|
||||
Ah, ok, hope it works
No problem |
#8
|
||||
|
||||
That would be a useful script. But remember, this is a Template discussion forum. For files head over to vB.org.
Thank you. |
#9
|
||||
|
||||
Its not a PHP file edit though? But I think I see the point you're making. No JS or PHP, only HTML???
|
#10
|
|||
|
|||
vb.com is a churchs website,lol
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|