Michael Heilemann.
If you have Dunstan's Time Since installed, this plugin uses it for the title="" attributes on the comments and posts. (For WordPress 1.5) Author: Brian Meidell Author URI: http://meidell.dk/ Version 1.5: Now works without LOCK TABLE and CREATE TEMPORARY TABLE priviledges. Version 1.5.1: Can't remember what I did here Version 1.5.2: Fixed count select statement to not include spammy comments Version 1.5.3: Properly excludes track- and pingbacks Version 1.5.4: Excludes posts that are not published, even if they have comments Version 1.5.5: Fade old comments, fixed bug that wreaked havoc with Time Since Version 1.5.6: Bugfix from Jonas Rabbe (http://www.jonas.rabbe.com/) pertaining to timesince Version 1.5.7: Bugfix so old colors can be darker than new colors (stupid oversight), thanks to http://spiri.dk for spotting it. Bugfix where single digit hex would cause invalid colors, thanks to http://www.wereldkeuken.be/ for the fix. Version 1.5.8: Updated to work with WordPress 2.1 alpha by M. Heilemann. */ function blc_latest_comments($num_posts = 5, $num_comments = 6, $hide_pingbacks_and_trackbacks = true, $prefix = "
  • ", $postfix = "
  • ", $fade_old = true, $range_in_days = 10, $new_col = "#444444", $old_col = "#cccccc") { global $wpdb; function clamp($min, $max, $val) { return max($min,min($max,$val)); } $usetimesince = function_exists('time_since'); // Work nicely with Dunstan's Time Since plugin (adapted by Michael Heilemann) // This is compensating for the lack of subqueries in mysql 3.x // The approach used in previous versions needed the user to // have database lock and create tmp table priviledges. // This uses more queries and manual DISTINCT code, but it works with just select privs. if(!$hide_pingbacks_and_trackbacks) $ping = ""; else $ping = "AND comment_type<>'pingback' AND comment_type<>'trackback'"; $posts = $wpdb->get_results("SELECT comment_post_ID, post_title FROM ($wpdb->comments LEFT JOIN $wpdb->posts ON (comment_post_ID = ID)) WHERE comment_approved = '1' AND $wpdb->posts.post_status='publish' $ping ORDER BY comment_date DESC;"); $seen = array(); $num = 0; if($fade_old) { $max_time = $range_in_days * 24 * 60 * 60 ; $r_new = hexdec(substr($new_col, 1, 2)); $r_old = hexdec(substr($old_col, 1, 2)); //$r_min = min($min, $max); //$r_max = max($min, $max); $r_range = ($r_old-$r_new); $g_new = hexdec(substr($new_col, 3, 2)); $g_old = hexdec(substr($old_col, 3, 2)); //$g_min = min($min, $max); //$g_max = max($min, $max); $g_range = ($g_old-$g_new); $b_new = hexdec(substr($new_col, 5, 2)); $b_old = hexdec(substr($old_col, 5, 2)); //$b_min = min($min, $max); //$b_max = max($min, $max); $b_range = ($b_old-$b_new); } // print "ranges: $r_range, $g_range, $b_range
    "; // print "r: ".(0.5*$r_range+$r_new)."
    "; foreach($posts as $post) { // The following 5 lines is a manual DISTINCT and LIMIT, // since mysql 3.x doesn't allow you to control which way a DISTINCT // select merges multiple entries. if(array_key_exists($post->comment_post_ID, $seen)) continue; $seen[$post->comment_post_ID] = true; if($num++ > $num_posts) break; $commenters = $wpdb->get_results("SELECT *, UNIX_TIMESTAMP(comment_date) AS unixdate FROM $wpdb->comments WHERE comment_approved = '1' AND comment_post_ID = '".$post->comment_post_ID."' $ping ORDER BY comment_date DESC LIMIT $num_comments;"); $count = $wpdb->get_var("SELECT COUNT(comment_ID) AS c FROM $wpdb->comments WHERE comment_post_ID = $post->comment_post_ID AND comment_approved = '1' ".$ping); $i = 0; $link = get_permalink($post->comment_post_ID); if($usetimesince) $title = " title=\"Last comment was ".time_since($comment->unixdate)." ago\""; else $title = ""; echo $prefix."".stripslashes($post->post_title). "  ".$count."
    \n"; foreach($commenters as $commenter) { if($usetimesince) $title = " title=\"Posted ".time_since($commenter->unixdate)." ago\""; if($fade_old) { $diff = time() - $commenter->unixdate; $r = round($diff/$max_time*($r_range))+$r_new; $r = clamp(min($r_new, $r_old), max($r_new, $r_old), $r); $g = round($diff/$max_time*($g_range))+$g_new; $g = clamp(min($g_new, $g_old), max($g_new, $g_old), $g); $b = round($diff/$max_time*($b_range))+$b_new; $b = clamp(min($b_new, $b_old), max($b_new, $b_old), $b); $r_hex = str_pad(dechex($r), 2, '0', STR_PAD_LEFT); $g_hex = str_pad(dechex($g), 2, '0', STR_PAD_LEFT); $b_hex = str_pad(dechex($r), 2, '0', STR_PAD_LEFT); $colstr = " style=\"color: #".$r_hex.$g_hex.$b_hex.";\""; } if($i++ > 0) echo ", "; echo "comment_ID."\"$title>".stripslashes($commenter->comment_author).""; } if($count > $num_comments) echo " [...]"; echo "".$postfix."\n"; } } ?> Hidden Track | YEMblog

    Hidden Track RSS

    August 31, 2012

    Interviews: Audio – Trey Anastasio Talks Setlists, Phish Love and More w/ KBCO [Hidden Track]

    August 29, 2012

    Summer Tour: Phish Oklahoma City Zoo Amphitheatre Setlist and The Skinny

    August 28, 2012

    Summer Tour: Phish St. Louis Chaifetz Arena Setlist and The Skinny

    Big Red: Trey Anastasio Traveler Tracklist Breakdown, Cover Art and Pre-Order

    August 27, 2012

    Couch Tour: Phish Announces Webcast For All Three Denver Shows

    August 22, 2012

    Big Red: Review – Trey Anastasio Hits A Home Run With Scabbard [Hidden Track]

    Couch Tour: Phish to Webcast Oak Mountain Show on Friday [Hidden Track]

    August 19, 2012

    Summer Tour: Phish San Francisco Setlist and The Skinny – Night Three

    Summer Tour: Phish San Francisco Setlist and The Skinny – Night Two

    August 18, 2012

    Summer Tour: Phish San Francisco Setlist and The Skinny – Night One

    August 16, 2012

    Lists: 10 Celebrity Phish Fans – Betty Draper, Kevin Arnold, Pete and More

    August 14, 2012

    Leg Two: Postcards From Page Side – Statement Time For Phish

    August 7, 2012

    Big Red: Sample New Trey Anastasio Single Scabbard Due August 21

    July 10, 2012

    Webcasts: Mike Gordon To Play As Part Of Tribute To Jerry Garcia [HT]

    Contests: HT Giveaway – Phish Chicago ’94 Box Set / T-Shirt Bundle [HT]

    July 4, 2012

    Summer Tour 2012: Phish Jones Beach Setlist and The Skinny – Night Two

    Summer Tour 2012: Phish Jones Beach Recap, Setlist and The Skinny – Night One [HT]

    June 27, 2012

    Compilations: Announcing Phish – Faux The Archives Volume 1 [Hidden Track]

    June 23, 2012

    Summer Tour 2012: Phish Burgettstown First Niagara Pavilion Setlist and The Skinny [Hidden Track]

    June 20, 2012

    Photos: Picture Show – A Fun Tucking Night in Portsmouth [Hidden Track]

    June 19, 2012

    Summer Tour 2012: Phish Portsmouth nTelos Pavilion Setlist and The Skinny [Hidden Track]

    June 17, 2012

    Bader Field: Phish Atlantic City Setlist and The Skinny – Night Three [Hidden Track]

    June 14, 2012

    Webcasts: Phish to Offer Pay-Per-View Webcasts of Next Week’s Portsmouth Shows

    June 8, 2012

    Summer Tour 2012: Phish Worcester Setlist and The Skinny – Night Two [Hidden Track]

    Photos and Videos: Phish Worcester – DCU Center – Night One [Hidden Track]

    May 29, 2012

    Big Red: Trey Anastasio’s Big Fall – Musical to Broadway / New Album [Hidden Track]

    May 20, 2012

    Jon Fishman: Videos, Setlist, Recap – Hug Your Farmer – A Tribute to Levon Helm [Hidden Track]

    May 16, 2012

    One Week Only: Watch 85 Minutes Worth of Pro-Shot Footage From Bonnaroo ’09 [Hidden Track]

    May 8, 2012

    Big Red: Trey Throws First Pitch in San Diego and ESPN Has Fun With It [Hidden Track]

    April 30, 2012

    Phish w/ Giant Country Horns: New to YouTube Video of Classic Phish Set Surfaces [Hidden Track]

    April 16, 2012

    Vinyl: JEMP Records Staff Details Phish Junta Record Store Day Release [HT]

    April 15, 2012

    Remembrances: Eighteen Years Ago Today – Phish at the Beacon [Hidden Track]

    April 11, 2012

    Bonnaroo: Phish to Play Two Sets at Bonnaroo 2012 [Hidden Track]

    April 10, 2012

    Venues: Phish Summer Tour 2012 – Leg Two – A Look at the Venues [Hidden Track]

    March 16, 2012

    Cactus: Jam In The Dam 2012 – Day Two Diary, Setlists and Photos [Hidden Track]

    March 15, 2012

    Cactus: Watch Mike Gordon Debut New Cover at Jam In The Dam [Hidden Track]

    March 13, 2012

    Stats: Phish Video Portal PhishVids.com By The Numbers [Hidden Track]

    March 8, 2012

    Haters: Indie front man disgusted to be mentioned in same article as Phish [Hidden Track]

    March 5, 2012

    Venues: Mr. Miner’s Venue Thoughts – Phish Summer Tour 2012 [Hidden Track]

    With this summer’s Phish dates just announced, the excitement in the fan community has skyrocketed, as everyone has begun to plot and scheme their own summer plans. On the heels of a triumphant year of game-changing music for this era, 2012 is filled with anticipation to see what is next for the band. Will they delve deeper into abstract jamming—a hallmark of 2011—or will they veer off that road? All that remains to be seen, but the one thing we know for sure is where the shows of the first leg will take place. Aside from Bader Field, this tour is comprised of venues that hold a significant amount of Phish lore. But let’s forget about the band for a moment, and take a look at the places where the magic will happen. Below are some tips from personal experience that might enhance your enjoyment at each stop along the way.

    February 29, 2012

    Tour Dates: Phish Summer Tour 2012 – A Detailed Look at the Venues Phish Will Play [HT]

    February 28, 2012

    Downloads: Trey + Fish + Jazz Mandolin Project = Bad Hat [Hidden Track]

    February 25, 2012

    Potential Guest Spots: Santana Wants People From Phish to Join Him at Vegas Residency [HT]

    February 19, 2012

    Rare Video: 22 Year Old Phish Video Footage Surfaces on YouTube – UMASS ’90 [HT]

    YouTube Preview Image

    February 16, 2012

    Lists: Stage Setlist Porn (inc. Phish Song List) [Hidden Track]

    February 14, 2012

    Tour Dates: Phish Confirmed to Headline Bonnaroo 2012 [Hidden Track]

    Humor: Rules For Tonight’s Trey Orchestral Show Interpreted [Hidden Track]

    Tonight, Phish front man Trey Anastasio continues his first-ever symphonic tour at Heinz Hall in Pittsburgh, where he’ll be backed by the Pittsburgh Symphony Orchestra. PSO staff has been trying to prepare Phish fans by providing an email filled with information about what they can expect at the venue in hopes the crowd won’t be as raucous as those who hooted and hollered at last Thursday’s tour opener. The DJs for Pittsburgh radio station WDVE’s morning show had fun with the email and interpreted it for “hippies.”

    February 13, 2012

    Merch: Buy Fishman’s “X” Dress / Phish 3-LP Junta Vinyl [Hidden Track]

    February 10, 2012

    Trey Anastasio: Trey Kicks Off Symphonic Tour in Atlanta [Hidden Track]

    February 9, 2012

    Lists: 10 Songs Trey & Symphony Should Play [Hidden Track]

    February 8, 2012

    Editorial: There’s a LOT Missing From Phish Tour [Hidden Track]

    February 3, 2012

    Trey Anastasio: Chamber Sextet yMusic Recorded With Trey [Hidden Track]

    January 26, 2012

    Wishlists: Three Musical Wishes for 2012 [Hidden Track]

    January 19, 2012

    Atlantic City: Four Music Festivals Approved For Bader Field – AC Legend Claims Phish, Chesney and Metallica Among Headliners [Hidden Track]

    Protests: Why Phish.net Went Dark Yesterday [Phish.net]

    January 5, 2012

    Editorial: How Phish Nurtures A Connection with Their Fans [Hidden Track]

    January 4, 2012

    NYE Run Recaps: Phish NYE Run – Feast or Famine? [Hidden Track]

    December 31, 2011

    MSG3: Phish MSG Night Three – Setlist, The Skinny & Live Blog [Hidden Track]

    December 29, 2011

    Photos & Reviews: Picture Show – Phish MSG Night One [Hidden Track]

    [Photo by Michael Stein]

    MSG: Phish Madison Square Garden Night Two – Setlist, Live Blog & The Skinny [HT]

    MSG: Phish MSG Live Blog, Setlist, The Skinny & More [Hidden Track]