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"; } } ?> Sponsored Link | YEMblog

    Sponsored Link RSS

    Visit our sponsors. We’ll appreciate it, and so will they.

    Features: A Conversation with HT and YEMblog’s Scott Bernstein [KickShuffle]

    That leads me to my next question – what advice would you give to up and coming bands?

    Put on a great live show and make each performance interesting. Gain an audience by becoming a great live act and then those fans will buy your studio efforts. You don’t need to be a jam band to change your setlist every night. And don’t undervalue  Spotify. Ask your fans to add your music to their shared playlists. I’ve discovered plenty of acts that way in 2011.

    Contests: Phish Tahoe Best Couch Tour Setup Giveaway [Hidden Track]

    Earlier this week we asked our @hidden_track followers to send us photos of their “couch tour” setups and told folks that the best one would win Steve Conroy’s incredible, limited edition Lake Tahoe poster. We took the best ones, posted them as a gallery on our Facebook page and are now asking you to place your vote on who should win by “like”ing your favorite setup(s) on Facebook.

    Poker: Phamily Poker Classic 2 in Tahoe [Official Site]

    Are you a poker-loving Phish fan heading to the Tahoe shows in August? Check out the Phamily Poker Classic which will take place at Harvey’s, the casino where the shows are taking place, to face off against other fans with cash and prizes on the line. The entry fee is $120, and at least half of that amount will go directly into the prize pool, with the remainder to be donated to The Mockingbird Foundation after accounting for tournament expenses.

    Poker: Phamily Poker Classic 2 in Tahoe [Official Site]

    Are you a poker-loving Phish fan heading to the Tahoe shows in August? Check out the Phamily Poker Classic which will take place at Harvey’s, the casino where the shows are taking place, to face off against other fans with cash and prizes on the line. The entry fee is $120, and at least half of that amount will go directly into the prize pool, with the remainder to be donated to The Mockingbird Foundation after accounting for tournament expenses.

    Poker: Phamily Poker Classic 2 in Tahoe [Official Site]

    Are you a poker-loving Phish fan heading to the Tahoe shows in August? Check out the Phamily Poker Classic which will take place at Harvey’s, the casino where the shows are taking place, to face off against other fans with cash and prizes on the line. The entry fee is $120, and at least half of that amount will go directly into the prize pool, with the remainder to be donated to The Mockingbird Foundation after accounting for tournament expenses.

    Poker: Phamily Poker Classic 2 in Tahoe [Official Site]

    Are you a poker-loving Phish fan heading to the Tahoe shows in August? Check out the Phamily Poker Classic which will take place at Harvey’s, the casino where the shows are taking place, to face off against other fans with cash and prizes on the line. The entry fee is $120, and at least half of that amount will go directly into the prize pool, with the remainder to be donated to The Mockingbird Foundation after accounting for tournament expenses.

    Poker: Phamily Poker Classic 2 in Tahoe [Official Site]

    Are you a poker-loving Phish fan heading to the Tahoe shows in August? Check out the Phamily Poker Classic which will take place at Harvey’s, the casino where the shows are taking place, to face off against other fans with cash and prizes on the line. The entry fee is $120, and at least half of that amount will go directly into the prize pool, with the remainder to be donated to The Mockingbird Foundation after accounting for tournament expenses.

    Follow @YEMblog For Live Reports From Bethel

    YEMblog Contests: Biggest Bustout of Tour / Pick The Encore [YEMblog Facebook]

    Here’s a chance to have some fun and win bobblehead(s) by participating in our two contests for the first leg of Phish’s summer tour. Click on the links above to find out how toe enter.

    Contests: Win a Pair of Tickets to Super Ball IX / Live in Utica Box Set [Hidden Track]

    Take Part In The Trey Pick Three Contest @ the YEMblog Facebook Page

    Post-Trey Show: Wyllys and the NY Hustler Ensemble @ BB Kings in NYC

    Purchase Live Phish Remasters on Amazon.com: 06/27, 07/03 & 07/04

    Follow @YEMblog For Commentary Live From Worcester

    Contests: The Phish NYE Run Bustout Contest [YEMblog FB]

    Alpine Valley 2010: Visit Amazon To Purchase Alpine DVD For $15.99 [Amazon]

    Follow @YEMblog For Updates Live From Charleston

    Follow @YEMblog For Live Reports From Broomfield

    Follow @YEMblog For Updates Live From Austin

    Follow @YEMblog For Live Reports From Jones Beach

    Follow @YEMblog For Reports Live From Jones Beach

    Follow @YEMblog For Live Updates & Commentary From Deer Creek

    Follow @YEMblog For Live Updates From Telluride

    Follow @YEMblog For Updates From Berkeley and PhishTwit For #phish Tweets

    Follow @YEMblog For Live Commentary From Berkeley

    Thursday – Taper Scott Gordon
    Friday – Hidden Track’s DaveO
    Saturday – David “ZZYZX” Steinberg

    YEMblog: Guidelines For Guest Tweeters [YEMblog Facebook]

    Podcasts: Special Report – Gathering of the Vibes [This Week on Lot]

    Follow @YEMblog For Updates From Tonight’s Show

    Follow @YEMblog & Keep Tabs on Phishtwit.com & JamBase/Phish For Reports From Great Woods

    Follow @YEMblog For Live Reports From SPAC

    Follow the action from tonight’s show @YEMblog & via PhishTwit & Jambase/Phish

    For Reports From Tonight’s Show: @YEMblog, PhishTwit and JamBase/Phish

    Follow @YEMblog For Commentary and Phishtwit.com For Real-Time Coverage of Phish’s Tour Opener Tonight in Chicago

    Check out YEMblog’s Facebook Page to Enter Our Opener and Trifecta Contests

    Visit PhishTwit For Real-Time Reports From Phish Summer Tour

    Watch Playlists of Entire Phish Shows on PhishTwit’s Phish Video Page

    Want to Buy, Sell or Trade Tickets With Other Phans? Head to CashOrTrade.org

    Buy, Sell or Trade Phish Tickets Within The Community at CashOrTrade.org

    Public Onsale Information For Summer Tour

    Saturday (April 3):

    10AM (EDT): HersheyRaleigh, Noblesville1, Noblesville2,
    11AM (EDT): Alpine1, Alpine2, Charlotte,
    1PM (EDT): Cuyahoga Falls, Alpharetta1, Alpharetta2,

    Note: Clicking on the links to Ticketmaster above credits YEMblog with a commission at no cost to the purchaser. If you appreciate what we do and want to support the sites, please use the links above to get to Ticketmaster.

    Hampton Anniversary: Ace Cowboy’s Phish Hampton Review [HT]

    To accurately describe what it’s like having the popular rock band Phish back on the Hampton Coliseum stage, let me steal a quip from that lovable ol’ drunkard Arthur when he tells Linda about owning a yacht: “It doesn’t suck.”

    Check Out ScottyB’s Jam Cruise 8 Coverage on Hidden Track

    Check Out ScottyB’s Jam Cruise Reviews at Hidden Track

    Follow @YEMblog For Live Reports From Miami

    Follow @YEMblog For Live Reports From Miami

    Follow @YEMblog For Updates From Miami

    Heading to Miami? Check out Valley Music Travel’s Hotel & Shuttle Packages

    Heading to Miami? Check out Valley Music Travel’s Hotel & Shuttle Packages

    Heading to Miami? Check out Valley Music Travel’s Hotel & Shuttle Packages

    Phish MSG 2009: Setlists, Reviews, Video & More at Jamtopia

    For Reports From Charlottesville follow @YEMblog or check out JamBase’s Phish Page or PhishTwit

    Check out Phish Tweets and Twitpics from Fall Tour at JamBase

    Follow @YEMblog For Commentary Live From Tonight’s Show

    Check out Phish Tweets and Twitpics from Fall Tour at JamBase

    Follow @YEMblog For Scotty B’s Reports Live From MSG

    Visit Phishtwit For The Closest Experience to Being at the Show

    Check out Phish Tweets and Twitpics from Fall Tour at JamBase

    Check out Phish Tweets and Twitpics from Fall Tour at JamBase

    Check out Phish Tweets and Twitpics from Fall Tour at JamBase

    Phishtwit – Experience Tonight’s Concert From Home

    Follow @YEMblog For Scotty B’s Commentary From Albany