vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Banner Rotational / Changes. (https://vborg.vbsupport.ru/showthread.php?t=289424)

killerford 10-21-2012 07:28 PM

Banner Rotational / Changes.
 
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.
Code:

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_image_background' => $php_include));

Now edit your header template of your theme. Search for where ever the logo is being called at, and replace
Code:

<img src="blablabla" />
with
Code:

<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

Quote:

Originally Posted by killerford (Post 2375469)
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

Quote:

Originally Posted by Revelence (Post 2375470)
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

Quote:

Originally Posted by Revelence (Post 2375451)
If you're trying to just rotate the banner, you can make a plugin. Here's a plugin that should work.
Code:

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_image_background' => $php_include));

Now edit your header template of your theme. Search for where ever the logo is being called at, and replace
Code:

<img src="blablabla" />
with
Code:

<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

Quote:

Originally Posted by killerford (Post 2375507)
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.


All times are GMT. The time now is 05:50 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01149 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete