Hey i have a vbulletin forum and what i want is to have say 8 banners that all link to different advertisers. Is there any simple way to do this? Anyhelp is appreciated.
You can do that with javascript : <script type="text/javascript"> var randomnumber=Math.floor(Math.random()*101) if(randomnumber>50){ var banner1 = "Here Banner 1"; document.write(banner1); } else { var banner2 = "Here Banner 2"; document.write(banner2); } </script> Code (markup): Add this code to a page and refresh it to see how it works. Where is "Here Banner 1" and "Here Banner 2" you will have to ad the banner code. For 8 different banners you will need to add multiple banner vars like var banner3 ="Here Banner 3" Code (markup):
So will that work on refresh i.e i want it like the ads at the top right of this forum. But on refresh say google ads, then an affiliate, then ebay etc, amazon and so on. Thanks for the help man
On my example the script generate a random number and if the number is greater than 50 then the script will show the 2nd banner(you can use a infinite number of banners). BTW be careful if you use a adsense code for example you will need to escape the quotes and to add \n\ for a new line like in this example : <script type="text/javascript"> var randomnumber=Math.floor(Math.random()*101) if(randomnumber>50){ // START ADSenses ADS var googleadss = "\ <script type=\"text/javascript\"><!--\n\ google_ad_client = \"pub-3084505037735566\";\n\ google_ad_slot = \"1731171369\";\n\ google_ad_width = 468;\n\ google_ad_height = 60;\n\ //--><\/script>\n\ <script type=\"text/javascript\"\n\ src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">\n\ <\/script>\n\ "; document.write(googleadss); // END Adsenses ADS } else { // BEGIN ADSENSE ADS var googleads = "\ <script type=\"text/javascript\"><!--\n\ google_ad_client = \"pub-3084505037735566\";\n\ google_ad_slot = \"1581398381\";\n\ google_ad_width = 728;\n\ google_ad_height = 90;\n\ //--><\/script>\n\ <script type=\"text/javascript\"\n\ src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">\n\ <\/script>\n\ "; document.write(googleads); } // END ADSENSE ADS </script> Code (markup): I use this type of script on many websites and is simple but powerfull.
on PHP enabled servers I use imagerotator.php meanwhile there appear to be several versions online that is a simple php script installed IN the banner folder of your site and rotates each time a page loads to show a new banner each time I have it since many years on my blog ( see sig link below ) and it works perfectly. it also works for other file extensions. it is ONE single file you upload into the one directory storing all your banners and there are max 3 lines you need to change - add the path into your template of page using the banner - change IN the script the server-path to your banner-folder - add / change file extensions of files being rotated if you interested and can't find a suitable copy / version online - then EMAIL me directly and I send you the version I use - the site once creating it no longer offers that script for download