Rotate banners

DA MADFACE

Junior Member
Joined
Aug 27, 2011
Messages
167
Reaction score
25
Hi,

I want to rotate banners in all my websites.
But I want to use the same code to all my websites
And I want to be able to edit the banners and links without having to go to my websites and edit them.

What do you guys suggest?
 
Google "free banner rotator html" or if your using WP there are many free plugins for this :)

All the best!
 
Thanks, but can you tell me one that actually work...
I dont want to use a script from any website since it can be a scam
 
Thanks, but can you tell me one that actually work...
I dont want to use a script from any website since it can be a scam

What are you using HTML or a CMS (Content Management system i.e Wordpress) ?
 
HTML....I want to use it for wordpress and blogger...but I dont want a wordpress plugin, because it need to work for all blogs
 
It's a long time since I've used it, but I believe this would be possible with openx.
 
and i also want different banners by countries
 
Doesn't DoubleClick do this???
I am not very familiar with it, but I think that DoubleClick can do this for you.
 
Can do some simple Java
Code:
<script type="text/javascript"><!--
//I. Array of banner that will randomly appear


var randompic = new Array ( );
randompic[0] = "";
randompic[1] = "";
randompic[2] = "";
randompic[3] = "";
randompic[4] = "";
randompic[5] = "";
randompic[6] = "";
randompic[7] = "";
randompic[8] = "";
randompic[9] = "";
//II. Array of links that will randomly appear


var randomlink = new Array ( );
randomlink[0] = "";
randomlink[1] = "";
randomlink[2] = "";
randomlink[3] = "";  
randomlink[4] = ""; 
randomlink[5] = "";
randomlink[6] = "";
randomlink[7] = ""; 
randomlink[8] = "";
randomlink[9] = "";
//III. function to generate number from 0 to n


function randomzero (n)
{
  return ( Math.floor ( Math.random ( )*0.9999999999999999* (n + 1)) );
}


//IV. assign any random number from 0 to 2 to x.


x = randomzero(9);


//V. display the image
document.write('<a href="http://' + randomlink[x] + '" rel="nofollow">');
document.write('<img alt="random ad banner" src="' + randompic[x] + '"/>');
document.write('</a>');
//-->
</script>

Just change randomzero value to the number of banners you want to rotate in that location. So if you have filled in up to randompic 6, enter 6 as the value. I have another piece of Java that does the same thing, once you feed the banners in once it can be placed on all your websites. You need to remove the http:// off the front of the URL as the http:// is added in the document write function. Can handle Java and HTML ads not flash though.

Or
Code:
<script language="JavaScript"><!-- Begin
var total_banner = 3;
var actual_time = new Date()
var second = actual_time.getSeconds()
var show_the_banner = second % total_banner;
show_the_banner +=1;
if (show_the_banner==1) {
txt="";
url="";
alt="";
banner="";
width="";
height="";
}
if (show_the_banner==2) {
txt="";
url="";
alt="";
banner="";
width="";
height="";
}
if (show_the_banner==3) {
txt="";
url="";
alt="";
banner="";
width="";
height="";
}
document.write('<center>');
document.write('<a rel="nofollow" href=\"' + url + '\" target=\"_top\">');
document.write('<img src=\"' + banner + '\" width=')
document.write(width + ' height=' + height + ' ');
document.write('alt=\"' + alt + '\" border=0><br>');
document.write('<small>' + txt + '</small></a>');
document.write('</center>');
// End -->
</script>
The second piece of code is easier to use most probably. Though neither will do country geo-targetting, to do that you need a much more complicated Java set-up and it's a pain have looked into myself.
 
Last edited:
Okay have worked out how to implement what you need, though I'm not going to give it away for free.
 
Back
Top