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"; } } ?> @YEMblog Twitter Updates for 2010-08-13 | YEMblog
    • this is scott marks – i'll be providing updates from the show tonight. #
    • was real worried after that first set but they turned it around #
    • @cdirksen they locked in on a riff and stuck to it rather than just a trey shred fest. i wish it went longer but better than most 3.0 melts #
    • fee n20 kung fire? for real? siick #
    • Deer Creek – …Buffalo Bill, Twist, Horse>Silent, Melt, Dog Faced Boy, Hood, Golgi E: Fee>NO2>Kung>Fire http://bit.ly/9wHSvS #phish #
    • end show #
    • to clarify gw had n20 waiting room music jam miami and tonight did not #
    • let cactus take over mike takes short solo! #
    • Deer Creek – …Buffalo Bill, Twist, Horse>Silent, Melt, Dog Faced Boy, Hood, Golgi E: Fee>N2O>Kung>Fire http://bit.ly/9wHSvS #phish #
    • no n20 end jam like great woods #
    • into fire #
    • Deer Creek – …My Friend, Buffalo Bill, Twist, Horse>Silent, Melt, Dog Faced Boy, Hood, Golgi E: Fee>N2O>Kung http://bit.ly/9wHSvS #phish #
    • trey still waving megaphone #
    • trey and fish on kung vocals #
    • trey waving megaphone. mike says put those haedphones on if u want to listen to music into kung! #
    • Deer Creek – …My Friend, Buffalo Bill, Twist, Horse>Silent, Melt, Dog Faced Boy, Hood, Golgi E: Fee -> N2O http://bit.ly/9wHSvS #phish #
    • into n20! #
    • fades to nothing mike hits bell #
    • transition jam starts #
    • welcome back megaphone #
    • Deer Creek – …My Friend, Buffalo Bill, Twist, Horse>Silent, Melt, Dog Faced Boy, Hood, Golgi E: Fee http://bit.ly/9wHSvS #phish #
    • fee. crowd goes nuts #
    • trey has megaphone #phish #
    • end set #phish #
    • golgi #phish #
    • another good hood. not peaked hard but slow and steady rippage #
    • jam starts so do glow stick #
    • Deer Creek: Drowned>Jam, Jiboo>Gin, My Friend, Buffalo Bill, Twist, Horse>Silent, Melt, Dog Faced Boy, Hood http://bit.ly/9wHSvS #phish #
    • split remains unfinished #
    • harry hood #phish #
    • into dog faced boy #
    • boys settle on a dark groove go off typical melt path #
    • they all catch on one note and drone it for a bit #
    • patiently laying a base #
    • no one's standing still. everyone getting the f down as jam starts #
    • split #phish #
    • Deer Creek – Drowned > Noblesville Jam, Jiboo > Bathtub Gin, My Friend, Buffalo Bill, Twist, Horse > Silent http://bit.ly/9wHSvS #phish #
    • twist was fairly straight forward and had a few nice peaks #
    • silent #phish #
    • horse #phish #
    • alpine 04 doh #
    • twist #phish #
    • welcome to 3.0 buffalo bill. hope you enjoy your stay. last one at it #
    • Deer Creek Set 2 – Drowned -> Noblesville Jam, Jiboo -> Bathtub Gin, My Friend, Buffalo Bill http://bit.ly/9wHSvS #phish #
    • big looking for owls sign down front. nice work fans #
    • buffalo bill #phish #
    • trey goes to feedback mode early. real evil #
    • solid work on composed section #
    • my friend #phish #
    • fades back into gin theme #
    • bass players seek out this track to hear the clinic mike puts on #
    • crowd eats it up. nice moment here in noblesville #
    • trey reasserts authority and mike answers back. impressive gin jam. anthemic peak now #
    • mike leading this jam as much as trey #
    • kuroda flashes white light on crowd for we love to take a bath #
    • felt nice to type that #
    • into bathtub. dope segue #
    • trey and page are gettin down. alittle call and response action #
    • Deer Creek Set 2 – Drowned -> Noblesville Jam, Jiboo http://bit.ly/9wHSvS #phish #
    • jibboo #phish #
    • really enjoying. glad they are being patient #
    • page on synth very pink floyd'y #
    • ambient as fuck #
    • cool roygbiv light scheme #
    • mike trying to change direction and tone of improv trey responds in kind #
    • page on organ trey playing rhythm #
    • noblesville jam #
    • straight forward arena rock jam thus far #
    • drowned #phish #
    • lights #
    • hoping for more cohesion from set two #
    • Deer Creek – Runaway Jim, PYITE, Roggae, CTB, Sample, NICU, Horn, Sugar Shack, Wolfman's Brother, TTE – END SET http://bit.ly/9wHSvS #phish #
    • end set #phish #
    • ctb and wolfmans only fairly tight tunes so far. well see how tte turns out #
    • tte #phish #
    • real trey driven solo. starting to pour it on #
    • crowd goes nuts at first peak of wolfmans #
    • sugar shack was a bit of a mess on the trey end of things #
    • Deer Creek – Runaway Jim, PYITE, Roggae, CTB, Sample, NICU, Horn, Sugar Shack, Wolfman's Brother http://bit.ly/9wHSvS #phish #
    • wolfmans #phish #
    • sugar shack #phish #
    • song written most recently performed thus far = roggae = old school start #
    • horn #phish #
    • cactus gets big cheer #
    • nope #
    • lets see if the fans got the dont cheer during life is a haze line memo #
    • Deer Creek – Runaway Jim, PYITE, Roggae, CTB, Sample, NICU http://bit.ly/9wHSvS #phish #
    • nicu #phish #
    • little feat did sample for mockingbird cd. rip richie #
    • page all smiles lip syncing along with trey singing the verse #phish #
    • sample #phish #
    • trey starts solo crowd reacts enthusasticly #phish #
    • four tour debuts. good start. ctb tightest thing yet #phish #
    • cars trucks buses0 #phish #
    • Deer Creek – Runaway Jim, PYITE, Roggae http://bit.ly/9wHSvS #phish #
    • roggae #phish #
    • trey thought it was over but there was another little segment. not smooth #phish #
    • lyric flub but nice recovery #
    • full light rig back after truncated rig in tride #
    • punch #phish #
    • page and trey connect on some melodic riffage #
    • runaway jim #phish #
    • lights #
    • venue filling up. lawn looks 3/4 full #phish #
    • first time seeing new guitar. its sure a beaut #
    • just heard about richie heyward. very sad to hear that. he gave little feat their distinctive sound almost as much as lowell. rip richie #
    • muggy as fuck but the sun is already starting its descent #
    • not worth it. hot as a mofo in the rockstar area #custied #
    • got the ten dollar rock star wristband. air conditioned lounge w/ bar restaurant etc. well see if its worth it #
    • more strip malls than i remember in noblesville #phish #
    • there's a "furries" convention at my hotel. hard to tell who's the Phish fans and who's w the furries unless they are in costume or phish t #
    • lots of traffic on I-65 south about 9 miles from 865 merge #
    • Runaway Jim, Access Me, Halfway to the Moon #phpredictions #
    • drive music: The Wipeout Show – 11/27/1998 #
    • New Live Release from Trey Anastasio titled TAB at The Tab due September 14th http://bit.ly/c9MpXf #

    Post a Comment

    You must be logged in to post a comment.