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 ~ Rotation Iframe adverts Details »»
UKBL ~ Rotation Iframe adverts
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.1 Rating:
Released: 03-20-2009 Last Update: Never Installs: 17
Template Edits
Re-useable Code Translations  
No support by the author.

UKBL ~ Rotation Iframe adverts


Now you can add timed rotational adverts 468 x 60 Banners or any other size you want, anywhere on your forums, You can add it in more than one template and have as many different rotating ads as you want.

DEMO SITE: http://hearts4horses.net/member_forum/upload/index.php



This hack works in two parts, some of the code is written by Dyamic Drive so please keep the credits intact if you use.

Installation

1. Download the iframeads.zip

2. Firstly open the advertiser.txt file in notepad and find the following

Code:
<iframe id="tickermain" src="http://ukbusinesslive.co.uk/forum/adverts.htm" width=486 height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></iframe>
Then change My forum url for yours and also the size of the ads that you'll be showing (I've shown it in red)

Thats all you need to do on that file so now save your edits and open the adverts.htm file in notepad.

You'll see the first part of the code is like this

Code:
<script language="JavaScript1.2">

//IFRAME Advertiser by UKBL2009

//Rotation code by Dynamic Drive, please leave intact if you use.

//configure delay between changing adverts (5000=5 seconds)
var delay=5000

var ie4=document.all

var curindex=0
var totalcontent=0

function get_total(){
if (ie4){
while (eval("document.all.content"+totalcontent))
totalcontent++
}
else{
while (document.getElementById("content"+totalcontent))
totalcontent++
}
}

function contract_all(){
for (y=0;y<totalcontent;y++){
if (ie4)
eval("document.all.content"+y).style.display="none"
else
document.getElementById("content"+y).style.display="none"
}
}

function expand_one(which){
contract_all()
if (ie4)
eval("document.all.content"+which).style.display=""
else
document.getElementById("content"+which).style.display=""
}

function rotate_content(){
get_total()
contract_all()
expand_one(curindex)
curindex=(curindex<totalcontent-1)? curindex+1: 0
setTimeout("rotate_content()",delay)
}

window.onload=rotate_content

</script>

<BODY bgColor=#FFFFFF>
The only bit you need to change is the very begining

Code:
//configure delay between changing adverts (5000=5 seconds)
var delay=5000
This is the delay for each ad, if you want to change the time that each add shows edit the Var delay, so if you wanted each ad to show for 3 seconds, you'd change this value to 3000

now we come to the addition of the Advertising banners.

First you need to do a little bit of work, making each banner clickable and pointing to an url, so for this we'll use a simple bit of code below

Code:
<a href="URL GOES HERE"><img src="picture.jpg"></a>
Its really easy, You just add the url to the front of the code and the Image url goes in the second part, Do that for all your adverts and you should get something like this...

Code:
<a href="http://ukbl.co.uk" target="_blank"><img src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/topHeader.gif" border=0></a>
Notice two additions to the code also, First is the target="_blank" this makes sure that the ad opens up in a new window, otherwise we'll have the url opening in a 468x60 window, Not good at all, so make sure this remains, after each url

Secondly, we have added border=0 to the end of the Image url, This prevents a url border from showing, so make sure this is added to each advert code.

Once you've made all your ads clickable then ad them to the end of the adverts.htm code like my example below

Code:
<!--ADD YOUR ADVERTISEMENT CONTENT BELOW, by wrapping each one inside a <DIV> as shown below.-->
<!--For each DIV, increment its ID attribute for each additional content (ie: "content1", "content2" etc)-->


<div id="content0" style="display:''">

<!-- ADD clickable banner code ADVERT #1 HERE--------------------->

<a href="http://ukbusinesslive.co.uk/forum" target="_blank"><img src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/UKBLForumpic.jpg" border=0></a>

<!-- END ADVERT #1----------------->

</div>

<div id="content1" style="display:none">

<!-- ADD clickable banner code ADVERT #2 HERE--------------------->

<a href="http://ukbl.co.uk" target="_blank"><img src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/topHeader.gif" border=0></a>

<!-- END ADVERT #2----------------->

</div>

<div id="content2" style="display:none">

<!-- ADD clickable banner code ADVERT #3 HERE--------------------->

<a href="http://ukbusinesslive.co.uk/forum" target="_blank"><img src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/30dollarmenus.png" border=0></a>

<!-- END ADVERT #3----------------->

</div>

<div id="content3" style="display:none">

<!-- ADD clickable banner code ADVERT #4 HERE--------------------->

<a href="http://ukbusinesslive.co.uk" target="_blank"><img src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/banner11.jpg" border=0></a>

<!-- END ADVERT #4----------------->

</div>
I've only shown 4 adverts but if you add another block befor the end </div> like below, you'll be able to add unlimited ads

Code:
<!-- ADD clickable banner code ADVERT #1 HERE--------------------->

<a href="http://ukbusinesslive.co.uk/forum" target="_blank"><img src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/UKBLForumpic.jpg" border=0></a>

<!-- END ADVERT #1----------------->
Thats its, just save the file and we're ready to upload.

A quick tip to see if your adverts.htm file is working, just click on it in your desktop and you'll see your ads rotating

Now, for the uploads

Firstly, The adverts.htm file which you've just added your ads to, need to go into the forum root directory, once uploaded you can test it by going to http://yourforum.com/adverts.htm

You should see your banners rotating, if so then alls well

Next we need to go to our admin cp and in your styles header, we need to add the small call up file which we saved as advertiser.txt. So open up this file again in notepad and copy and paste to the end of your styles Header.

Now when you go to your forum you should see your ads rotating nicely.

You can be more adventurous and add the call up code to any template you want, each time your adds will show anywhere in your forums, You can of course duplicate the code and with an additional .htm code on your forums root, you'll be able to have more banners showing, different sizes etc..

Hope you enjoy this simple addition

If you click Install then i'll support you 100%


If you've installed this on your site, drop me a PM and i'll add it to the Live Demo at the begining of this post

Download Now

File Type: zip iframeads.zip (54.5 KB, 98 views)

Screenshots

File Type: png adverts.png (57.5 KB, 0 views)

Show Your Support

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

Comments
  #12  
Old 08-07-2009, 09:57 PM
River_rush River_rush is offline
 
Join Date: Mar 2004
Location: Basingstoke
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just a small non important related thing but your forum Horse Rescue Organzation of the Month is missing an "i"
Reply With Quote
  #13  
Old 08-07-2009, 11:42 PM
bmckinley's Avatar
bmckinley bmckinley is offline
 
Join Date: Jun 2009
Location: Texas
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks River Rush for the eye on my "i". Updated.
Reply With Quote
  #14  
Old 08-08-2009, 03:07 PM
yeku yeku is offline
 
Join Date: May 2005
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello friend UKBusinessLive, you know if works with TradeDoubler to insert link?

thank
Reply With Quote
  #15  
Old 08-08-2009, 05:05 PM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yeku View Post
Hello friend UKBusinessLive, you know if works with TradeDoubler to insert link?

thank
Hiya Buddy,

Not tried with TradeDoubler, But why don't you give it a go and let us know. The beauty of these mods is the fun we have adapting them to our sites.

Try it and let us know, and perhaps i'll add it to the first post as an extra (credits to you!!)

Don't forget to click installed!!

Have fun

Gerry
Reply With Quote
  #16  
Old 08-08-2009, 09:53 PM
yeku yeku is offline
 
Join Date: May 2005
Posts: 134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I must say that it works with TradeDoubler links.

I completely replaced by this line:

PHP Code:
<div id="content0" style="display:''">

<!-- 
ADD clickable banner code ADVERT #1 HERE--------------------->

<a href="http://ukbusinesslive.co.uk/forum" target="_blank"><img src="http://i475.photobucket.com/albums/rr114/ukbusinesslive/UKBLForumpic.jpg" border=0></a>

<!-- 
END ADVERT #1----------------->

</div
And put the link and TradeDoubler:

PHP Code:
<div id="content0" style="display:''">

<!-- 
ADD clickable banner code ADVERT #1 HERE--------------------->

<script type="text/javascript">
var 
uri 'h**p://impes.tradedoubler.com/imp?type(iframe)g(*******)a(*******)' + new String (Math.random()).substring (211);
document.write('<iframe src="'+uri +'" width="468" height="60" frameborder="0" border="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>');
</
script>

<!-- 
END ADVERT #1----------------->

</div
and works perfect, I have changed var delay=5000 a 7000, seems more appropriate ..


greetings
Reply With Quote
  #17  
Old 08-12-2009, 03:57 AM
bmckinley's Avatar
bmckinley bmckinley is offline
 
Join Date: Jun 2009
Location: Texas
Posts: 111
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quick note:

We installed 3.8.4 WITHOUT a TMS and the UKBL mod has no problems. I think 3.8.4 will be OK with most mods because 3.8.4 has no template edits.

(or it could be Gerry's uncanny ability to build in forward compatibility...)
Reply With Quote
  #18  
Old 08-12-2009, 04:44 AM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bmckinley View Post

(or it could be Gerry's uncanny ability to build in forward compatibility...)
I'm thinking Years in advance buddy,
Reply With Quote
  #19  
Old 11-01-2009, 05:53 PM
DZaidle DZaidle is offline
 
Join Date: Oct 2009
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it does not work in Firefox due to the JavaScript window.onload event not working properly in Firefox. All other browsers okay.

This is a major bug and I cannot use this mod until it is fixed.
Reply With Quote
  #20  
Old 12-18-2009, 04:39 PM
imsick imsick is offline
 
Join Date: Nov 2009
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i'm in the same boat.....
firefox users can not see anything below the banner.
Reply With Quote
  #21  
Old 01-28-2010, 05:44 PM
Stefanus Stefanus is offline
 
Join Date: Aug 2007
Location: RSA - Boerland
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DZaidle View Post
it does not work in Firefox due to the JavaScript window.onload event not working properly in Firefox. All other browsers okay.

This is a major bug and I cannot use this mod until it is fixed.
Quote:
Originally Posted by imsick View Post
i'm in the same boat.....
firefox users can not see anything below the banner.
Hmm, works ok in Firefox.

To correct the Firefox problem edit the "advertiser.txt" to the following:
I use this on vB 4.0.1 (SevenSkins TwinColumn).

Code:
                <!-- Contents -->
                <iframe id="tickermain" src="http://www.yourforum.com/forum/adverts.htm" width="150" height="252" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>                          
                <!-- Contents -->
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:49 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.11240 seconds
  • Memory Usage 2,363KB
  • 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
  • (8)bbcode_code
  • (2)bbcode_php
  • (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
  • (2)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