Ad Rotator

Discussion in 'AdSense' started by xboxundone, Jun 21, 2006.

  1. #1
    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.
     
    xboxundone, Jun 21, 2006 IP
  2. MediaHustler

    MediaHustler Well-Known Member

    Messages:
    1,857
    Likes Received:
    46
    Best Answers:
    0
    Trophy Points:
    120
    #2
    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):
     
    MediaHustler, Jun 21, 2006 IP
  3. xboxundone

    xboxundone Well-Known Member

    Messages:
    1,903
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    103
    #3
    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.
     
    xboxundone, Jun 21, 2006 IP
  4. xfilipino

    xfilipino Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Wouldn't that be against Google Violation? To post the google ad in a no-content page?
     
    xfilipino, Jul 25, 2006 IP
  5. manan121

    manan121 Banned

    Messages:
    72
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    is there any benefit with this rotator
     
    manan121, Jul 26, 2006 IP
  6. qwestcommunications

    qwestcommunications Notable Member

    Messages:
    8,868
    Likes Received:
    172
    Best Answers:
    0
    Trophy Points:
    233
    #6
    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.
     
    qwestcommunications, Jul 26, 2006 IP
  7. Cryogenius

    Cryogenius Peon

    Messages:
    1,280
    Likes Received:
    118
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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.
     
    Cryogenius, Jul 26, 2006 IP
  8. xboxundone

    xboxundone Well-Known Member

    Messages:
    1,903
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    103
    #8
    Yes this would be.
     
    xboxundone, Jul 26, 2006 IP