SitePoint Sponsor

User Tag List

Results 1 to 22 of 22
  1. #1
    ********* Articles ArticleBot's Avatar
    Join Date
    Apr 2001
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Discussion thread for Random Content Rotation Made Easy

    This is a dedicated thread for discussing the SitePoint article 'Random Content Rotation Made Easy'

  2. #2
    Anonymous
    SitePoint Community Guest
    Why not just use Perl to only serve up html for the ONE random thing to view? Instead of sending a bunch of stuff back to someone's browser, only to display a portion of it.

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    It's a good way to keep your content fresh to visitors, but I get the feeling that it can really be abused by those stuffing keywords into hidden <div>s just for increased search engine rankings.

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    It's a good way to keep your content fresh to visitors, but I get the feeling that it can really be abused by those stuffing keywords into hidden <div>s just for increased search engine rankings.
    Those were my first thought as well

  5. #5
    SitePoint Enthusiast tapdig's Avatar
    Join Date
    Sep 2003
    Location
    Norman, OK
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I made a perl random image script recently. It basically Find::File; my Gallery albums and logs all the .thumb.jpg files to a txt file. Then one is selected at random for display. The path has a few regex to make links and such. It was a good perl learning experience for me. No CSS involved. If you'd like to read more, go here: http://blog.tapdig.com/cgi-bin/blosx...osxom/1029.tom

  6. #6
    SitePoint Member
    Join Date
    Nov 2002
    Location
    Sheffield, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Anonymous
    Why not just use Perl to only serve up html for the ONE random thing to view? Instead of sending a bunch of stuff back to someone's browser, only to display a portion of it.
    I believe that is explained in the article:
    Visitors that don't make use of the CSS, such as search engine crawlers and screen readers that ignore CSS, will get all the content every time.

    (It's in the article)

  7. #7
    SitePoint Member
    Join Date
    Nov 2002
    Location
    Sheffield, UK
    Posts
    16
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    It's a good way to keep your content fresh to visitors, but I get the feeling that it can really be abused by those stuffing keywords into hidden <div>s just for increased search engine rankings.
    You don't need this perl script to do that! You could easily have a hidden <div> stuffed with keywords, many spammers already do (and then get banned when they are discovered).

    I don't think it's a valid argument against this article/method.

    Cheers,
    Nigel

  8. #8
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by MadeInSheffield
    You don't need this perl script to do that! You could easily have a hidden <div> stuffed with keywords, many spammers already do (and then get banned when they are discovered).
    True.

  9. #9
    SitePoint Enthusiast blakems's Avatar
    Join Date
    Oct 2002
    Location
    Utah
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is would be a good technique used on websites that can't be maintained everyday, or sites that are not visited often enough for a visitor to notice.

    Good Creative thinking.
    blakems.com
    "reaching more of your brain cells"


  10. #10
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    IN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, trying to get this to work but it's not happening. I did it just the way the article stated but I see all three options.

  11. #11
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    I did it just the way the article stated but I see all three options.
    Can we have a link to the page to take a look please

    Paul

  12. #12
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    IN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B
    Can we have a link to the page to take a look please

    Paul
    I just set it up the way the article stated. Didn't change anything... I think.
    Last edited by Irata0062; May 10, 2004 at 09:04.

  13. #13
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    The link to the cgi file is probably not correct. I get a page not found.

    /cgi-bin/random_content.pl?t=3&p=success

    Check you have the correct address.

    Paul

  14. #14
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Also check your path to perl. It may not be the same as in the script.

    Paul

  15. #15
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    IN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The perl path is /usr/bin/perl which is what I changed it too. The article's perl script had a perl.exe at the end, is that needed.

    Also, I do not know why the path doesn't work. My manual says to add home/username/public_html but that didn't change the outcome either. I even tried just adding the domain before the cgi-bin/... like I did with the formmail but it still didn't work.

    Any suggestions?

  16. #16
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Since you posted I've been trying to get it to work for me and am running into the same problems as you

    My first thoughts were path to pearl and chmod etc

    This seems like a cgi problem so perhaps someone with more knowledge in this area can jump in.

    Meanwhile I'll keep trying (surely can't be that hard).

    Paul

  17. #17
    Back in Action Winged Spider's Avatar
    Join Date
    Jun 2001
    Location
    outside my mind
    Posts
    900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This would be considered SPAM by the search engines. You've just attatched a fancy script to a well known spam technique.

    I don't think that this article should have the words "Search Engine Friendly" in it at all.


  18. #18
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    IN
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help. I'll keep checking back to see if someone has a solution.

  19. #19
    Anonymous
    SitePoint Community Guest
    Seems you have a leaky tag.

  20. #20
    Ness du Frat
    SitePoint Community Guest
    Seems cool if your server supports cgi files... mine doesn't... Can it be done in php ?

  21. #21
    Greta
    SitePoint Community Guest
    This was really helpful in coming up with my own way to do this. And for you who work mostly with php, here's a really simple solution.

    First, generate a random number based on how many variations of content you have. For me it was two, so I put this code at the top of the page:

    <?

    $num = rand(1, 2);

    ?>

    1 being the minimum number and 2 being the maximum.

    Then I used an include clause to add content pages that hold the code I wished to randomize.

    <? include ('includes/random'.$num.'.php'); ?>

    So wherever this include is inside of my php document, the code inside "includes/random1.php" or "includes/random2.php" will show up.

  22. #22
    SitePoint Addict Owz2004's Avatar
    Join Date
    Mar 2004
    Location
    U.K (Wales)
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I really like this article its helped me with a particular project I was working on.. Thank you,

    I have a new project in which something like this would help except I want it to replace the back ground image of my main container every time the page refreshes..

    The background image is specified within my style sheet. But I can not seem to adapt the image rotater script or this one to accommodate my problem.

    Is there a way of changing the style sheet so the background image is changed when the page refreshes?

    The only other way I can think of doing it would be to load a new style sheet for every page with the background image changed. but this would obviously defeated the object of the style sheet,

    any ideas?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •