I need an ad rotater script in php with includes

Discussion in 'Scripts' started by sundaybrew, Jun 18, 2006.

  1. #1
    I am looking for an ad roater script that will serve ads,

    off of a text file

    then I can just place the include where I want the ads to rotate

    thanx
     
    sundaybrew, Jun 18, 2006 IP
  2. K4sh

    K4sh Peon

    Messages:
    112
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try PHPads it is free and can be installed from your Cpanel.
     
    K4sh, Jun 26, 2006 IP
  3. Borghunter

    Borghunter Well-Known Member

    Messages:
    212
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    110
    #3
    You can use this code in the area you want the ad:
      <?php
    $fcontents = join ("", file ("banner_ads.txt"));
    $s_con = split("~",$fcontents);
    $banner_no = rand(0,(count($s_con)-1));
    echo $s_con[$banner_no];
    ?> 
    PHP:
    and create a text document named "banner_ads.txt" in the same directory.
    In that text document include the following text.
    YOUR FIRST AD CODE
    ~
    YOUR SECOND AD CODE
    ~
    YOUR THIRD AD CODE
    ~
    
    etc.....
    Code (markup):
     
    Borghunter, Jun 26, 2006 IP
    maney likes this.
  4. WebDivx

    WebDivx Peon

    Messages:
    212
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hey cool script!! i tried and its really cool!

    i was wondering though how do you make it so it favors one ad over the other. so say I have two banners i want to show, banner 1 and banner 2. how do i have banner 1 show maybe like 60% of teh time and banner 2 like 40% of the time?

    thanks for the help!
     
    WebDivx, Oct 14, 2006 IP
  5. IndianMonk

    IndianMonk Notable Member

    Messages:
    2,666
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    225
    #5
    Will it work on Invision Power Board?
     
    IndianMonk, Oct 29, 2006 IP
  6. Smyrl

    Smyrl Tomato Republic Staff

    Messages:
    13,740
    Likes Received:
    1,702
    Best Answers:
    78
    Trophy Points:
    510
    #6

    What about just making three ads with two the same? Won't hit your percentages exactly but ...

    If you want it exact make ten ads, six of one, four of the other.
     
    Smyrl, Oct 29, 2006 IP