Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 26-03-08
Registered User
 
Join Date: Oct 2006
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
jaykay is an unknown quantity at this point
  Rotating Banners?

Hi
I wanted to put rotating banners on my home page but I've no idea how to go about it - can anyone give me any advice please? i.e. what code do I use?
Thanks
Jay
__________________
Jaykay
http://www.homeworking4me.co.uk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 26-03-08
Bud's Avatar
Bud Bud is online now
Registered User
 
Join Date: Nov 2006
Posts: 506
Thanks: 10
Thanked 6 Times in 4 Posts
Bud seems to know their stuff
  Re: Rotating Banners?

I have tried a few methods, most were too complicated for me, but I found this piece of code which is really easy to use:

HTML Code:
<script language=JavaScript>

var img_width = "120";
var img_height = "600";
var img_title = "Click Here";

var ad=new Array()
//insert your images src
ad[0]=' ***url*** '; // 1st banner image source
ad[1]=' ***url*** '; // 2nd banner image source
ad[2]=' ***url*** '; // 3rd banner image source

var links=new Array()
//insert your links
links[0]=' ***url*** '; // 1st banner destination url
links[1]=' ***url*** '; // 2nd banner destination url
links[2]=' ***url*** '; // 3rd banner destination url etc

var xy=Math.floor(Math.random()*ad.length);
document.write('<a href="'+links[xy]+'" target="_blank"><img src="'+ad[xy]+'" width="'+img_width+'" border="0" height="'+img_height+'" alt="'+img_title+'"></a>');
</SCRIPT>

Simply cut and paste into your html replacing ***url*** as required and you'll get a randomly selected banner when the page is loaded.

As you can see this is for 120x600 banners and you can add you own alt text (var img_title).

Simply add more banner lines as required using ad[3], ad[4] etc, making sure you match them with additional links[3], links[4] etc

Hopefully that'll do the job for you!

__________________
Bud

Great Shopping That Doesn't Cost The Earth: www.TheOffsetShop.co.uk
"Will Dance for Discount Codes!"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 27-03-08
Paulzie's Avatar
Registered User
 
Join Date: Jan 2006
Location: Edinburgh
Posts: 84
Thanks: 0
Thanked 1 Time in 1 Post
Paulzie is an unknown quantity at this point
  Re: Rotating Banners?

I used to use that java script also. Wrote a wee script that would generate the script if you know what I mean.

Unfortunatly it would only show the first 20 or so banners - something to do with the way it generates a random number.

After a few months I invested the time to change to PHPAdsNew (renamed to OpenAds, now called OpenX). It's a wee bit daunting but works.

I also read somewhere that Google was going to offer a similar system. Think it was on the openX web page. This wouldn't be just ad sense, but would allow you to add your own banners.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 27-03-08
Registered User
 
Join Date: Mar 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
affMonkey is an unknown quantity at this point
  Re: Rotating Banners?

If you have php running on your server can be done with a simple little script like this. Just edit hrefs, alts and image locations in the $myClasses array.

PHP Code:
<?php
function randomBanner $array ) {
  
$total count($array);
  
$call rand(0,$total-1);
  return 
$array[$call];
}

$myClasses = array (
  
"<a href=\"url\"><img src=\"banner1.gif\" alt=\"banner1\" /><br />Banner1 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner2.gif\" alt=\"banner2\" /><br />Banner2 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner3.gif\" alt=\"banner3\" /><br />Banner3 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner4.gif\" alt=\"banner4\" /><br />Banner4 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner5.gif\" alt=\"banner5\" /><br />Banner5 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner6.gif\" alt=\"banner6\" /><br />Banner6 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner7.gif\" alt=\"banner7\" /><br />Banner7 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner8.gif\" alt=\"banner8\" /><br />Banner8 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner9.gif\" alt=\"banner9\" /><br />Banner9 text if needed</a>",
  
"<a href=\"url\"><img src=\"banner10.gif\" alt=\"banner10\" /><br />Banner10 text if needed</a>"
);
$bannerClass ''.randomBanner($myClasses).'';
echo 
"$bannerClass";
?>
hope this helps
__________________
Band, Music T-shirts & Hoodies
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 27-03-08
Registered User
 
Join Date: Oct 2006
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
jaykay is an unknown quantity at this point
  Re: Rotating Banners?

Thanks guys. I'm only going to put a handful of banners on so the code should be fine for me. I'm going to tackle it later today.
Thanks again - much appreciated.
Jay
__________________
Jaykay
http://www.homeworking4me.co.uk
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-04-08
Registered User
 
Join Date: Mar 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
paulsquiz is an unknown quantity at this point
  Re: Rotating Banners?

For those who are interesting in including a _lot_ more banners on their sites, i have found that adpeeps is a fantastic little script. adpeeps.com. (I am in no way affiliated to them by the way).

The script generates a script that you can put on your site, where you want banners placed, unlimited amounts of banner scripts/positions.

But the beauty of this script is that it can do geotargeting, so you can show different adverts to visitors from different countries, just like adsense can. Plus you can put text link ads into it and it will output code that looks like adsense. Unlimited definable banner ad sizes too. I also chuck my adsense ad codes and adsense referrals codes into the rotator too.

Really, I cannot speak highly enough about it. Not too cheap for the beginner but well worth it for CTR optimisation on larger sites.
__________________
Free Quiz Questions - Tens of thousands of great Trivia Quiz Questions
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kitbag banners to reflect our 75% off shirt sale prices and new shirts johnlfitz TradeDoubler 0 08-02-08 05:08 PM
Kitbag banners to reflect our 75% off shirt sale prices and new shirts johnlfitz Affiliate Window 0 08-02-08 05:07 PM
Kitbag banners to reflect our 75% off shirt sale prices and new shirts johnlfitz Affiliate Future 0 08-02-08 05:02 PM
Kitbag banners to reflect our 75% off shirt sale prices and new shirts johnlfitz Website Promotion 0 08-02-08 05:00 PM
Rotating Banners / Content Units? mikey_freedom Affiliate Future 3 03-02-06 08:34 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7