I need an ad rotator that supports Adsense and i don't want phpadnews as it is to bulky i just want to alternate between two or three different ad blocks like adsense YPN etc... any help is appreciate. PHP is ok. it is for WP but the one out ther for WP gives me errors when i try to use it.
Use this code PHP Code place this code where you want the ad to show at. <?php $fcontents = join ('', file ('/adrotator.txt')); $s_con = split("~",$fcontents); $banner_no = rand(0,(count($s_con)-1)); echo $s_con[$banner_no]; ?> Code (markup): Then make a .txt file called adrotator.txt adrotator.txt Ad code here ~ <---- use this to seperate every add Another Ad code Code (markup):
this works for only if the page has one post if it has multiple posts it alternates between so i could end up with adsense and another ad on same page any way to prevent that using current script? or modification of? as i show 3 or 4 posts on 1 page so i would need all 3 or 4 ad blocks to show adsense or the other advert but not both.
I think a rotator is when an ads from different companies will show up everytime a page is loaded. For example, here on DP, different colours show up everytime a page is loaded.
I've just implemented something very similar to what MediaHustler posted (thanks). I how have code that will display a random referral button for Firefox or Picasa with different colours and messages. Cheers, Cryo.