View Full Version : rotating banners
barbiedoll
01-10-2007, 12:17 AM
:) I am new to all this.. And am looking for some help getting rotating banners in the header of our website.. I have a picture there now.. I have downloaded a rotating banner mod from here.. but have tried.. & tried & cannot get it to work. I know I am just missing something really small & stupid..
I have examples of what I am doing in another thread in Mod section
Here is the link.. https://vborg.vbsupport.ru/showthread.php?p=1152912#post1152912
Kirk Y
01-10-2007, 12:34 AM
This is what I do...
Create a new Plugin at hook location 'global_start' with the following contents:
$random_number = rand(1, 4);
$random_banner[1] = 'images/logo1.jpg';
$random_banner[2] = 'images/logo2.jpg';
$random_banner[3] = 'images/logo3.jpg';
$random_banner[4] = 'images/logo4.jpg';
If you want to add a banner, just add a new line, change the variable name (_banner[x]), and then increase the rand(1,4), where 4 is the number of banners you have. If you want to remove a banner, just get rid of the line and then decrease the rand(1,4).
Then edit your 'header' template as follows...
Find: $stylevar[titleimage]
Replace with: $random_banner[$random_number]
barbiedoll
02-01-2007, 12:36 AM
Thank you.. !!!! How about centering it??
Kirk Y
02-01-2007, 12:51 AM
Find:
<td align="$stylevar[left]">
Replace with:
<td align="center">
Should do it...
barbiedoll
03-18-2007, 02:12 AM
Thank you !!!!!
Is there any way to add links to the banner's.. So if you would click on the banner it would take you to that ad's website??
Chicago_VLNU_4s
03-18-2007, 02:48 AM
good work acid. Could be useful
4x4 Mecca
03-18-2007, 04:01 AM
This is what I do...
Create a new Plugin at hook location 'global_start' with the following contents:
$random_number = rand(1, 4);
$random_banner[1] = 'images/logo1.jpg';
$random_banner[2] = 'images/logo2.jpg';
$random_banner[3] = 'images/logo3.jpg';
$random_banner[4] = 'images/logo4.jpg';
If you want to add a banner, just add a new line, change the variable name (_banner[x]), and then increase the rand(1,4), where 4 is the number of banners you have. If you want to remove a banner, just get rid of the line and then decrease the rand(1,4).
Then edit your 'header' template as follows...
Find: $stylevar[titleimage]
Replace with: $random_banner[$random_number]
Thanks! I've set it up, and it works great!
mamashid
03-19-2007, 05:29 PM
i cant get it to work either way...LOL
Chicago_VLNU_4s
04-04-2007, 07:35 PM
ok, got it finally. What about if I wanted it in user cp? I tried to make this same hook in Usercp_complete and it displayed at the very top
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.