Text Link Rotator script?

Discussion in 'Programming' started by JonPM, Sep 5, 2007.

  1. #1
    does anyone know of a good text link rotator script?
    for instance: i have an ad bar that displays 5 text links at a time, but every time a user visits the site it randomly pulls the 5 links out of a database of say 30. So each time its random AND the same link cannot be displayed twice at the same time.

    Anyone know of a free or $ script? or maybe someone here can make it?
     
    JonPM, Sep 5, 2007 IP
  2. coldgansta

    coldgansta Guest

    Messages:
    1,614
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just google it.
    There are thousands of free link rotators out there
     
    coldgansta, Sep 5, 2007 IP
  3. ednit

    ednit Peon

    Messages:
    152
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I don't know of a free one, but I could write one if your site used MySQL & supported CGI scripts.

    However, you would have to have the ability to call the script from your pages. . . so unless you could do that (or your website was written in perl/cgi) then I don't know if it'd work.
     
    ednit, Sep 5, 2007 IP
  4. JonPM

    JonPM Active Member

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    ya i tried that already but could find anything good. most of the "link rotator" scripts would rotate the links like every 5 seconds or something, rather than every page load. other ones i found would repeat some of the ads on the same page.



    ednit - my page is in php, would it work? i have mysql and cgi-scripts support
     
    JonPM, Sep 5, 2007 IP
  5. bibel

    bibel Active Member

    Messages:
    289
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
  6. jkolarov

    jkolarov Peon

    Messages:
    109
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    jkolarov, Sep 6, 2007 IP
  7. ednit

    ednit Peon

    Messages:
    152
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You can't execute a cgi script or routine from a php script directly that I know of.

    You could probably make it work using frames or javascript (I couldn't, but maybe you could), though this is highly unsuggested.
     
    ednit, Sep 7, 2007 IP
  8. Bishop81

    Bishop81 Peon

    Messages:
    757
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #8
    PM me if you still need help with this and can't find a ready-made solution. I can code it for you.

    I can do it using AJAX and Javascript, and it shouldn't take too long to do.
     
    Bishop81, Sep 9, 2007 IP
  9. jessecooper

    jessecooper Peon

    Messages:
    793
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #9
    this will work for you. just put the exact code you want rotated in banner.txt

    read on

    
    <?
    $banners = split("<!-- SPLIT -->", preg_replace("/<\?.*?\?>/", "", file_get_contents("/complete route from root to directory/banner.txt")));
    
    echo $banners[rand(0,sizeof($banners) - 1)];
    ?>
    
    PHP:
    First you put the above in your index.php file or whatever...
    Then you create a banner.txt file and include what ever info you need to be rotated (banners, img's, html).
    Just put a hard return and <!-- SPLIT --> in between whatever you want rotated.

    Again super simple and useful. and make sure to put the filepath from your root into the rotatelist.txt.


    EDIT* on re-reading your post, maybe this wont work for you
     
    jessecooper, Sep 12, 2007 IP