Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-21-2012, 07:28 PM
killerford's Avatar
killerford killerford is offline
 
Join Date: Jan 2012
Location: United Kingdom
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 10-23-2012, 12:34 AM
killerford's Avatar
killerford killerford is offline
 
Join Date: Jan 2012
Location: United Kingdom
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone know?
Reply With Quote
  #3  
Old 10-23-2012, 04:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, it is possible. Have you done a search? I see a ton of banner mods for vB4 that are not ad related.
Reply With Quote
  #4  
Old 10-23-2012, 07:04 PM
killerford's Avatar
killerford killerford is offline
 
Join Date: Jan 2012
Location: United Kingdom
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Am I searching for the wrong key words? I just see ad banners. You have any links?
Reply With Quote
  #5  
Old 10-23-2012, 07:21 PM
Revelence Revelence is offline
 
Join Date: Apr 2011
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 10-23-2012, 08:07 PM
killerford's Avatar
killerford killerford is offline
 
Join Date: Jan 2012
Location: United Kingdom
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry but, how do you make a plugin? Never done a plugin.
Reply With Quote
  #7  
Old 10-23-2012, 08:09 PM
Revelence Revelence is offline
 
Join Date: Apr 2011
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by killerford View Post
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
Reply With Quote
  #8  
Old 10-23-2012, 08:19 PM
killerford's Avatar
killerford killerford is offline
 
Join Date: Jan 2012
Location: United Kingdom
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Revelence View Post
Admincp -> Plugins & Products -> Add New Plugin

Also make the hook location global_bootstrap_init_start
And where do I change the hook location?
Reply With Quote
  #9  
Old 10-23-2012, 08:24 PM
Revelence Revelence is offline
 
Join Date: Apr 2011
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's in option when creating a new plugin. Here's an example, this is how mine was when I was testing the plugin.

Reply With Quote
  #10  
Old 10-23-2012, 10:23 PM
killerford's Avatar
killerford killerford is offline
 
Join Date: Jan 2012
Location: United Kingdom
Posts: 173
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Revelence View Post
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:53 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.13460 seconds
  • Memory Usage 2,260KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete