Best ad rotator script?

Discussion in 'Scripts' started by Drew007, Nov 6, 2006.

  1. #1
    I have seen many scripts that rotate a banner in one place, but I am looking for something that will rotate several banners each time the page is refreshed.

    Example: I have a column with 8 ads displaying. Each time the page loads, those 8 ads will be in a different order.

    Any help would be great. Thanks!
     
    Drew007, Nov 6, 2006 IP
  2. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you could do that with a very simple php script.

    if you want a packaged deal, phpadsnew seems to be popular.

    php code if you want:
    
    <?
    $ad[0] = "your ad code here";
    $ad[1] = "your ad code here for ad #2";
    $ad[2] = "your ad code here for ad #3";
    // continue to $ad[8]. or higher if you desire. 
    shuffle($ad);
    foreach ($ad as $adcode)
    {
    echo $adcode;
    }
    ?>
    
    Code (markup):
     
    disgust, Nov 6, 2006 IP
    davert likes this.
  3. Drew007

    Drew007 Peon

    Messages:
    310
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks for your response. I have tried the following and only text appears.

     
    Drew007, Nov 6, 2006 IP
  4. DidierE

    DidierE Well-Known Member

    Messages:
    1,815
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    145
    #4
    phpadsnew is the best free banner management script i know off

    Maybe you should take a look at that.

    Didier
     
    DidierE, Nov 6, 2006 IP
  5. davert

    davert Banned

    Messages:
    345
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    phpadsnew has a fairly hefty cost in terms of setup time and processor overhead compared with that cool script disgust posted... disgust's processor will only work in php pages, though! (as in, a page ending with .php) where phpadsnew etc. will work in ANY place.

    Lots of lousy software in this arena.
     
    davert, Nov 6, 2006 IP
  6. italks

    italks Active Member

    Messages:
    94
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    63
    #6
    phpAdsnew For me always.
     
    italks, Nov 6, 2006 IP
  7. Drew007

    Drew007 Peon

    Messages:
    310
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I really wanst looking for something that complex. Just a small script that will rotate the images upon page load.
     
    Drew007, Nov 6, 2006 IP
  8. DidierE

    DidierE Well-Known Member

    Messages:
    1,815
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    145
    #8
    Actually it comes standard with many hosting packages.
    Just 1-click and it is installed. After that you just have to paste the php code into your pages.
    So unless you have a few hundred pages where the code must be on, it is really a snap to install this.

    Didier
     
    DidierE, Nov 6, 2006 IP
  9. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #9
    you would want to have

    
    $ad[0] = '<a href="http://www.site.com/"><img src=http://www.yoursite.com/ad.jpg></a>;
    
    Code (markup):
    or something similar.

    or...
    
    <?
    $ad[0] = "../images/ads/sponsor.jpg";
    $ad[1] = "../images/ads/myspace.jpg";
    $ad[2] = "../images/ads/bom.jpg";
    // continue to $ad[8]. or higher if you desire.
    shuffle($ad);
    foreach ($ad as $adcode)
    {
    echo '<img src="';
    echo $adcode;
    echo '">';
    }
    ?>
    
    Code (markup):
     
    disgust, Nov 6, 2006 IP
  10. Drew007

    Drew007 Peon

    Messages:
    310
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Great thanks. It is now working perfect. How do I add a line break between the ads? Thanks!
     
    Drew007, Nov 6, 2006 IP
  11. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #11
    is it really that hard to figure out? ;-)

    <?
    $ad[0] = "../images/ads/sponsor.jpg";
    $ad[1] = "../images/ads/myspace.jpg";
    $ad[2] = "../images/ads/bom.jpg";
    // continue to $ad[8]. or higher if you desire.
    shuffle($ad);
    foreach ($ad as $adcode)
    {
    echo '<img src="';
    echo $adcode;
    echo '"><br>';
    }
    ?>
     
    disgust, Nov 6, 2006 IP
  12. lkj

    lkj Peon

    Messages:
    729
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #12
    disgust, nice script.... :)
     
    lkj, Nov 8, 2006 IP
  13. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #13
    that's why everyone should learn php. that seriously took about 8 seconds ;)
     
    disgust, Nov 8, 2006 IP
  14. Drew007

    Drew007 Peon

    Messages:
    310
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #14
    OK, LOL. I have everything done now except the linking. Can someone make this so id opens a link (when clicked) in a new window? I tried adding the above code with no luck......Thanks in advance!

     
    Drew007, Nov 15, 2006 IP
  15. disgust

    disgust Guest

    Messages:
    2,417
    Likes Received:
    133
    Best Answers:
    0
    Trophy Points:
    0
    #15
    this really shouldn't be that hard ;)

    <?
    $ad[0] = "../images/ads/bom.jpg";
    $ad[1] = "../images/ads/myspace.jpg";
    // continue to $ad[8]. or higher if you desire.
    shuffle($ad);
    foreach ($ad as $adcode)
    {
    echo '<a target="_blank" href="http://www.site.com"><img src="';
    echo $adcode;
    echo '"></a><br>';
    }
    ?>
    Code (markup):
     
    disgust, Nov 15, 2006 IP
  16. ldwebtech

    ldwebtech Active Member

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #16
    Thanks alot,
    i am looking for this code
     
    ldwebtech, Jul 17, 2007 IP
  17. benpolska

    benpolska Peon

    Messages:
    431
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #17
    great responces. i will also look into these.
     
    benpolska, Jul 17, 2007 IP