Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
UKBL ~ Timed Rotating Ad Banners Details »»
UKBL ~ Timed Rotating Ad Banners
Version: 1.00, by UKBusinessLive UKBusinessLive is offline
Developer Last Online: Feb 2012 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 3.8.0 Rating:
Released: 01-15-2009 Last Update: Never Installs: 31
Template Edits
Re-useable Code Translations  
No support by the author.

UKBL ~ Timed Rotating Ad Banners

Live Demo http://www.ukbusinesslive.co.uk/forum

I've been wanting to display some banners on my site but i didn't just want the same banner just showing until you go to another page or hit the refresh button, Some people may stay on the forum home for quite some time, This is not the ideal way to display banners, as they'll only see the one ad in all that time.

Well thats about to change with UKBL ~ Timed Rotating Ad Banners

Now as Admin you'll be able to make some serious money by showing a wider variety of banners which change after so many seconds, as opposed to changing on refreshes.

You can sign up to a number of affiliate sites and download banners to your forums, a list of affiliate sites to help you is at the end of this post.



To install this to your forums is so easy

First you need to edit the code to suit your requirements
Copy the following code to a text editor like notepad or word

Code:
<html>
<head>
<title>UKBL ~ 10 Second Banner Rotator</title>
</head>
<body>
<DIV ALIGN=CENTER>
<script language="JavaScript">
<!--
function adArray() {
 for (i=0; i*2<adArray.arguments.length; i++) {
  this[i] = new Object();
  this[i].src = adArray.arguments[i*2];
  this[i].href = adArray.arguments[i*2+1];
 }
 this.length = i;
}
function getAdNum() {
 dat = new Date();
 dat = (dat.getTime()+"").charAt(8);
 if (dat.length == 1)
  ad_num = dat%ads.length;
 else
  ad_num = 0;
 return ad_num;
}
 var ads = new adArray(
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/1-3.gif",
"http://aavaninsurance.at/ukbusinesslive",
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/banner11.jpg",
"http://www.ukbusinesslive.co.uk/forum",
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/2-2.gif",
"http://tradebusiness.at/ukbusinesslive",
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/7-2.gif",
"http://skytv.at/ukbusinesslive"
);

var ad_num = getAdNum(); 

document.write('<table cellpadding=0 cellspacing=1 border=0><tr><td '
+'align="left">'
+'<A href="'+ads[ad_num].href+'"><IMG SRC="'+ads[ad_num].src+'" '
+'height="60" width="468" border="0" name="js_ad"></a></td></tr></table>');

link_num = document.links.length-1;

function rotateBanner() {
 if (document.images) {
  ad_num = (ad_num+1)%ads.length;
  document.js_ad.src = ads[ad_num].src;
  document.links[link_num].href = ads[ad_num].href;
  setTimeout("rotateBanner()",10000);
 }
}
setTimeout("rotateBanner()",10000);

// -->
</script>
</DIV>
</body>
</html>
The look for the following....

Code:
"http://i475.photobucket.com/albums/rr114/ukbusinesslive/1-3.gif",
"http://aavaninsurance.at/ukbusinesslive",
Basically what you see is what you get, the top line is the url of your image, you can save it to forums/images/misc or even photobucket, like my example above, The second line is the url to the site, Thats its just repeat this for all the ad banners you have and write up the code. Easy. You can use 2 banners or 200 the choice is yours






Then once you've edited your banners and their URL's you need to scroll down to..

Code:
  setTimeout("rotateBanner()",10000);
 }
}
setTimeout("rotateBanner()",10000);
Now you need to change the time delay, its in milliseconds, don't forget that, so if you want your ads to change every 10 seconds like the code above, you leave it on 10000, if you want 8 seconds, you need to change the code to 8000 in both lines, likewise 5 seconds = 5000

Then just save the file

To install to your Site.

For ease of application i've installed it in the header, right at the end, so heres what to do...

ACP> Style Manager > Your site's style > header

Just copy and paste the entire code that you've just edited and paste it at the very end of the header template, Click save. Thats its

if you experiment you can add these banners to the footer, in the posts and in different forums, Try and see what works for you the most

If you want to try the code first i've included a few banner gif's in the zipped file so you can try.

Affiliate Schemes that Pay YOU!! Some are UK based but have US section too

Commision Junction = http://www.cj.com/
Buy.at = http://buy.at/ (UK) http://www.advertising.com/buyat/ (US)

Plus loads more and details on the zip file

Give it a go and see if it works for you, remember to leave a comment and if i can help at all, i will.

If you only want to show banners to un registered members or guests then you could add a condition at the begining like this

Code:
<if condition="is_member_of($bbuserinfo, X,X)">
With X the id of the usergoup that you want to show the banners to, don forget the add the </if> tag at the end of the script

Please Remember to click installed

Download Now

File Type: zip Timed Ads.zip (170.4 KB, 188 views)

Screenshots

File Type: png ads.png (84.8 KB, 0 views)
File Type: gif 1.gif (22.1 KB, 0 views)
File Type: gif 4.gif (16.0 KB, 0 views)
File Type: gif 6.gif (24.8 KB, 0 views)
File Type: gif 7.gif (15.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 02-06-2009, 04:30 PM
honken honken is offline
 
Join Date: Mar 2008
Location: Sweden
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by UKBusinessLive View Post
Not on this version but i will be adding that shortly
thanks, looking forward to that one then.
Reply With Quote
  #13  
Old 02-27-2009, 11:57 PM
CFodder CFodder is offline
 
Join Date: Mar 2008
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great little mod thanks UK. We don't have ads on our site but I've used it to rotate a few piccies .
Reply With Quote
  #14  
Old 02-28-2009, 10:27 AM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CFodder View Post
Great little mod thanks UK. We don't have ads on our site but I've used it to rotate a few piccies .
Great idea
Reply With Quote
  #15  
Old 03-06-2009, 09:10 PM
mrtroybaker mrtroybaker is offline
 
Join Date: Feb 2009
Posts: 142
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Been looking for this exact thing. Thanks
Reply With Quote
  #16  
Old 03-07-2009, 04:53 AM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mrtroybaker View Post
Been looking for this exact thing. Thanks
hope it works for you :up:
Reply With Quote
  #17  
Old 05-30-2009, 02:39 AM
BGObsession's Avatar
BGObsession BGObsession is offline
 
Join Date: Apr 2009
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This seems to work extremely well. Very simple and easy to use. Only problem I'm having is that I'm trying to use it on a right side module of my CMPS page, not as a 'banner rotator', but to rotate images advertising other sites we have a relationship with. I set the module up as a php module, and its working fine in terms of rotating the images. I did have to select the 'clean file output' option to get it to show in the right column. My problem is, although the images rotate fine and look good in the right hand column module, my footer and footer navbar links are now messed up. Any idea what I need to tweak so that the footer formatting doesnt get messed up?
Reply With Quote
  #18  
Old 05-30-2009, 10:17 AM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BGObsession View Post
This seems to work extremely well. Very simple and easy to use. Only problem I'm having is that I'm trying to use it on a right side module of my CMPS page, not as a 'banner rotator', but to rotate images advertising other sites we have a relationship with. I set the module up as a php module, and its working fine in terms of rotating the images. I did have to select the 'clean file output' option to get it to show in the right column. My problem is, although the images rotate fine and look good in the right hand column module, my footer and footer navbar links are now messed up. Any idea what I need to tweak so that the footer formatting doesnt get messed up?
If your using it in your CMPS page then you might be better off using this https://vborg.vbsupport.ru/showthread.php?t=209005

Its an Iframe based HTMl coded Rotating banner mod which you could use for your sponsors or any advertising. Might be better in your CMPS box as opposed to a javascript hack.

Let us know how you got on
Reply With Quote
  #19  
Old 08-16-2009, 02:44 AM
jkcerda jkcerda is offline
 
Join Date: Mar 2008
Posts: 425
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

reserved
Reply With Quote
  #20  
Old 10-18-2009, 11:13 AM
ElizeF's Avatar
ElizeF ElizeF is offline
 
Join Date: May 2008
Location: South-Africa
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

UKBusinessLive, I followed all the instructions as explained and I can not get my banners to work - I do not even see my banners.
Any suggestions where I can look to see what I did wrong
Thanks
Reply With Quote
  #21  
Old 02-07-2010, 03:51 PM
FuegoMCS FuegoMCS is offline
 
Join Date: Jun 2009
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

n00b question - Is this something that I could drop into a module to be displayed on our CMPS homepage? We have a number of club sponsoring vendors and would like to have a non-header/sidebar module on our homepage that rotates through sponsor logos (linked)
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 11:51 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.12156 seconds
  • Memory Usage 2,351KB
  • Queries Executed 26 (?)
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
  • (4)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete