View Full Version : Banner Rotational / Changes.
killerford
10-21-2012, 07:28 PM
I see mods for Rotational banners that's for ad's on your forum but nothing like this for banners as in your website banner.. I run a gaming forum and have loads of different themes and colours and different banners. I would like to get it down to one theme and colour and a rotational banners for all different games that we play.
Is this possible?
killerford
10-23-2012, 12:34 AM
Anyone know?
Lynne
10-23-2012, 04:13 PM
Yes, it is possible. Have you done a search? I see a ton of banner mods for vB4 that are not ad related.
killerford
10-23-2012, 07:04 PM
Am I searching for the wrong key words? I just see ad banners. You have any links?
Revelence
10-23-2012, 07:21 PM
If you're trying to just rotate the banner, you can make a plugin. Here's a plugin that should work.
ob_start();
$banners = array('banner_1', 'banner_2', 'banner_3');
$rand = rand(0, count($banners) - 1);
echo $banners[$rand];
$php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('header',array('random_im age_background' => $php_include));
Now edit your header template of your theme. Search for where ever the logo is being called at, and replace <img src="blablabla" />
with
<img src="{vb:raw random_image_background}" />
Replace the banner_1, banner_2, and so on with your banners. You can add more then 3, and you don't need more then 1.
killerford
10-23-2012, 08:07 PM
Sorry but, how do you make a plugin? Never done a plugin.
Revelence
10-23-2012, 08:09 PM
Sorry but, how do you make a plugin? Never done a plugin.
Admincp -> Plugins & Products -> Add New Plugin
Also make the hook location global_bootstrap_init_start
killerford
10-23-2012, 08:19 PM
Admincp -> Plugins & Products -> Add New Plugin
Also make the hook location global_bootstrap_init_start
And where do I change the hook location?
Revelence
10-23-2012, 08:24 PM
It's in option when creating a new plugin. Here's an example, this is how mine was when I was testing the plugin.
https://vborg.vbsupport.ru/external/2012/10/31.png
killerford
10-23-2012, 10:23 PM
If you're trying to just rotate the banner, you can make a plugin. Here's a plugin that should work.
ob_start();
$banners = array('banner_1', 'banner_2', 'banner_3');
$rand = rand(0, count($banners) - 1);
echo $banners[$rand];
$php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('header',array('random_im age_background' => $php_include));
Now edit your header template of your theme. Search for where ever the logo is being called at, and replace <img src="blablabla" />
with
<img src="{vb:raw random_image_background}" />
Replace the banner_1, banner_2, and so on with your banners. You can add more then 3, and you don't need more then 1.
Could you give me a little more help regarding this post? You say search where my logo is being placed? you mean in my FTP? If so it's in the theme that I'm using so Seamus and misc. Or is there something I've missed? With this Seamus theme I have our clan logo in the left hand side and behind it I have a 1225x300 banner that I'm wanting to have rotate with different banners which is located in the same area but in a background folder.
Revelence
10-23-2012, 10:27 PM
Could you give me a little more help regarding this post? You say search where my logo is being placed? you mean in my FTP? If so it's in the theme that I'm using so Seamus and misc. Or is there something I've missed? With this Seamus theme I have our clan logo in the left hand side and behind it I have a 1225x300 banner that I'm wanting to have rotate with different banners which is located in the same area but in a background folder.
No, you edit your template. Go to the header template, and replace the image src with what I told you.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.