Looking for Content Rotation Script

Discussion in 'PHP' started by SFOD_D223, Oct 11, 2006.

  1. #1
    All of you PHP'er's out there. Please advise me where I can put on my site a tool that rotates the content by paragraph header. Or is there an easier way to rotate a site with over 5,000 articles?

    What I'm trying to do is rmove different articles to front of page whenever the site is visited.
     
    SFOD_D223, Oct 11, 2006 IP
  2. faraday911

    faraday911 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    well, if you have articles named 1.html, 2.html and so on you could use random number generation, and include a random article every time the site is visited. If they have some more meaningful names, you could make a table like:

    id|name
    1|pigs.html
    2|mice.html

    etc. and apply the same random number generation

    and your page would look something like this:

    include("head.inc"); // things that precede the article
    include("$a.html"); // the article itself, where $a is the random number
    include("footer.inc"); // things below the article
     
    faraday911, Oct 12, 2006 IP
  3. SFOD_D223

    SFOD_D223 Peon

    Messages:
    4,512
    Likes Received:
    174
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Alright faraday, I'm gonna give it a go..when i get some time.
     
    SFOD_D223, Oct 12, 2006 IP
  4. dp-user-1

    dp-user-1 Well-Known Member

    Messages:
    794
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    110
    #4
    That's a great idea, faraday911.
     
    dp-user-1, Oct 12, 2006 IP