Not signed in (Sign In)

Vanilla 1.1.2 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorcmseagle
    • CommentTimeFeb 3rd 2008
     

    I've received these factoids many, many times over the past few days, and not so many of the others. What gives?

    -Cubicles gained office-popularity in the early 1920s as a way of cutting costs during the Great Depression.

    -Three out of 10 Americans will eat dog at some point in their life, knowingly, or unknowingly.

    -The first commercially available television sets weighed over 700 pounds.

    -The original Pac-Man was almost blue, but a bug in the demo version set up for the head of hardware development at Atari led to its present-day color.

    -In Haiti, having a mirror in your house is considered bad luck.

  1.  

    I rewrote the module... I'll take a look at it and see if I can't fix the problem.

    •  
      CommentAuthorlegatissimo
    • CommentTimeFeb 4th 2008 edited
     

    There, that should fix it. In case anyone is interested... the problem was

    $results = mysql_query("SELECT max(id) count from entries"); $count_array = mysql_fetch_array($results); $count = $count_array[count]; $id = rand(1,$count); $entry = db_fold("SELECT entry FROM entries WHERE date<=NOW() AND display AND id <= $id ORDER BY id DESC LIMIT 1", 'return $entry;');

    Anyway, I the query was: SELECT entry FROM entries WHERE date<=NOW() AND display AND id <= $id LIMIT 1

    So it was tending to pull posts from the beginning instead of closest to the ID it actually picked through the random selection.

    •  
      CommentAuthorFact totum
    • CommentTimeFeb 4th 2008
     

    here's a factoid I just got with an ugly typo:
    "The average Canadian weighs more than the average America."

    Your script reminds me of the old programming truism: Generating random numbers is too important to be left to chance.