Plugin Name: Brian's Latest Comments
Plugin URI: http://meidell.dk/archives/category/wordpress/latest-comments/
Description: This shows an overview of the recently active articles and the last people to comment on them. Original idea and code fixes contributed by 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")
function clamp($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.
$ping = "";
$ping = "AND comment_type<>'pingback' AND comment_type<>'trackback'";
$posts = $wpdb->get_results("SELECT
FROM ($wpdb->comments LEFT JOIN $wpdb->posts ON (comment_post_ID = ID))
WHERE comment_approved = '1'
ORDER BY comment_date DESC;");
$seen = array();
$num = 0;
$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.
$seen[$post->comment_post_ID] = true;
if($num++ > $num_posts)
$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."'
ORDER BY comment_date DESC
$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);
$title = " title=\"Last comment was ".time_since($comment->unixdate)." ago\"";
$title = "";
echo $prefix."".stripslashes($post->post_title). "".$count." \n";
foreach($commenters as $commenter)
$title = " title=\"Posted ".time_since($commenter->unixdate)." ago\"";
$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 ", ";
if($count > $num_comments)
echo " [...]";
Podcasts | YEMblog
Hello and Happy New Year! Type II is back this week with a fresh episode and it should be no surprise that we are reviewing the MSG New Year’s Eve run. After just a few days to gather our thoughts, Scotty and I sat down with guests Charlie Dirksen and Dave Calarco for almost two hours last night. With lots to talk about, we debate the best and the worst of what has become some of the most anticipated shows each year. Of course, we offer up some of the tastiest clips to supplement our discussion. And whether you are a “jaded vet” or just saw your first shows, we are sure you will enjoy this blast from the hose.
This week on the podcast join Scott, Eric and myself as we review the highly anticipated release of Phish’s Hampton Winston/Salem ’97 7-CD Box Set. Everyone and their brother has probably already listened to this. A few times. Every blogger has already written a review. Polls are up. Debates are occurring. But as any seasoned listener of the program should expect, we bring you a little bit of “all of the above”, with some choice clips thrown into the mix. What were the cast’s favorite moments? Never any spoilers here, hit play or go download in
Two episodes in and Scott Aukerman still doesn’t like Phish. What are we going to do about it? We’re going to bring in Adam Scott, we’re going to stick to the jams, and we’re going to see what happens! Join us on this tour through the cosmos (sorry) and continue to leave your drug advice in the forums.
Ben, Padraic and Adam sit down to discuss the OPT article Phish’s Favorite Song Pairings for the first episode of OnAir Phish Tour. On top of discussing some or our favorite pairs, we discuss comments posted by a couple of readers as well. Listen below or subscribe to OnAir Phish Tour in iTunes.
This week on the podcast, we are talking about Phish shows that were undersold /skipped / or something similar that ended up being above average. The panel of Scott, Drew and Adam (OPT) bring several examples of these shows throughout the years. After some choice clips that should leave you wanting more, everyone discusses if “You Snooze, You Loose” is even possible in 3.0. Be sure to let us know your thoughts on the future of this phishy phenomenon below.
If you missed the debut episode of Analyze Phish, let me get you up to speed: Harris Wittels and Scott Aukerman are friends, Harris likes Phish, and Scott does not. This show is a chance for Harris to defend his musical taste and maybe even gain a new concert buddy. In episode two, Harris addresses some of the criticisms he received for the first episode and tries a new approach to introducing Scott to Phish. Will it work? You’ll have to listen to find out!
This week, we finish off the final review of the summer, Dick’s Sporting Goods in Colorado. Tanya Sperry, a Type II Cast regular, joins me along with our special guest Tao Pauly from Coventry Music Blog. Both attended the Dick’s shows, while I did the official Couch Tour for all 3 nights. After digesting this three night run for two weeks, we came up with “Uber Clips”. Like . . . seriously, there are a lot of clips. And this episode clocks in at an hour and twenty minutes, possibly the longest one to date. So grab your headphones, a snack, and get ready to experience Dick’s the Type II way.
This episode finds [host Steve Olker] joined by type II cast regular, Eric Wyman, and guest host, Adam Brotherhood from Online Phish Tour. Both were in attendance and assert that a good time was had by all at the last 3 shows of Leg 2. With plenty of clips to choose from this week, a few were left on the studio floor. It should be no surprise to anyone listening that this run is a contender for one of the best in 2011, and perhaps 3.0. As usual, we are here to give our analysis and insight, wrapped in colorful commentary, baked in a pastry. Grab a glass Merlot, block off the next hour, and enjoy.
By the time you are reading this, Phish will have completed Leg 2 of their 2011 Summer Tour, but here at type II cast, we are just starting the reviews. This week, Scotty, Drew, and Eric tackle the first 3 shows, both Gorge and the Hollywood Bowl. As usual, we selected a few clips to highlight what makes these shows stand out. And we tried not to let future events effect our opinions, though Drew does step into the future machine once.
While everyone was waiting for the first night of Phish’s 2-night webcast from Lake Tahoe, the Type II crew got together to recover some missing territory. It’s been a busy summer and somehow we never got the chance to discuss the last five shows of Leg 1. The sticklers for detail that we are we thought it would be unjust to not at least cover our thoughts and favorite clips from Alpharetta, Charlotte, Raleigh and Portsmouth. Over the hour leading up to Tahoe we discussed our thoughts on webcasts, fan expectations and most of all some amazing musical moments. Here’s to a great tour and we’ll be back to cover the newest shows real soon.
Harris Wittels and Scott Aukerman are comedians, music lovers, and most importantly friends. Where do they differ? Harris loves Phish, and Scott couldn’t care less. On Analyze Phish, Harris carefully navigates the vast landscape of Phish’s catalogue to find possible entry points for Scott while trying to explain the live Phish experience without the use of illegal substances. Will he succeed? You’ll have to listen to find out!
Stephen T, Noob Laura and myself hit up all 3 nights of Phish at Bethel Woods. We had hoped to set up on lot, but unfortunately couldn’t pull it off this time. So we did the next best thing, and sat down at the hotel on Sunday to discuss our thoughts up through the first 2 nights. We are happy to report that the whole experience was an overall success. Not much drama was seen, locals were welcoming, and the weather was on our side. Without a doubt, we hope to see Phish return here, and that it stays a 3 night run stop.
This week our topic is the first in a series of festival reviews. We gave everyone the choice of which festival to cover first, and The Clifford Ball came in at number 1, proving that chronological order is the way to go. Fortunately, Scotty, Drew and Tanya were all at the Ball, and can offer first hand reviews and insight. Like always, we assembled some choice clips and even opted to sneak an extra one in during the intro.
YEMblog.com’s Scott Bernstein joins Justin Wendt of the Oh Kee Pah Blog, Steve Olker of This Week on Lot and Dog Gone Blog’s Sam Davis to discuss the Island Tour for the latest episode of Type II Cast, which is available through the link above and iTunes.
Continuing where we left off from last week, the crew counts down to the #1 best jam of the year. This week we have a full house with Eric, Scotty, Drew and Tanya joining me and a full episode clocking in at just over 1 hour. Despite being possibly our biggest episode to date, we only saw one “technical difficulty”, which I chose to leave in as it resulted in some comical banter. Without a doubt, the crew did a fantastic job defending their top picks, or arguing against some. Listen now for no spoilers, or get a peak at the top five after the jump.
Most every blog has been releasing their “best of” opinions over the last month and we just couldn’t resist joining in on the fun. To mix ours up we had all 7 panelists submit their individual Top 10 list, then we ranked and aggregated the scores for a “definitive” TypeIICast Top 10 list. Now there’s some interesting results and some interesting opinions on what makes something most worthy of being included in the list. Join us for Part 1 as Steve, Justin, Sam and Eric defend and discuss their choices and the bonehead exclusions made by their peers.
Type II Cast host Steve Olker and panelists Scott Bernstein, Tanya Sperry and Justin Wendt each had a tough time waiting for two weeks to discuss Phish’s three-night stand at Madison Square Garden, so much so that you can hear the energy in each participant’s voice as they detail the run’s highlights.
This week we have a very special guest, Adam from Phish.net. For anyone has been living on the moon Phish.net is basically the one stop for all things Phish related. They’ve been collaborating data, setlists, and all around Phish related things since before the internet was the cool.
Well, it’s that time of year! When we struggle to get through the holidays and get back to another Holiday Tour with Phish. This week Steve, Eric and Justin run through New Years shows from the past and discuss what makes a good show, what exactly was the best New Years show and some of their favorite moments from all the other days not marked 12/31 on the calendar.
This week the crew moves into a new direction. Scott, Tanya and Drew discuss the history of Mike’s Song. They start in the early days and discuss how the song has evolved, and eventually, devolved, into 2010. The framework used in this episode will be repeated in the next 2, at least, as a complete overview of Phish in the 1.0, 2.0 and 3.0 eras.
This week we begin to branch away from Phish’s 2010 Fall Tour as Steve, Drew, Sam, and Justin take a look at two Phish “classics” and how they’ve been effected by the Phish 3.0 mindset. Justin gets us started with two classic Halley’s clips, featuring the tremendous Binghamton ’95 Halley’s and the silky-funk driven verrsion from the ’97 Hampton run. As the discussion turns to Tweezer we share a few clips from some of the favorable versions of 3.0. Featuring the massive Camden and Red Rocks Tweezers from 2009. We also feature a clip from the July 3rd, 2010 Tweezer that segues majestically into Slave. We wrap things up with a listener email sparking conversation on what kind of effect the availability of instant SBD’s might have on the perceived quality of Phish shows.
Hey everyone, YEMblog editor/curator ScottyB here, and I want to tell you about the latest project I’m involved with – Type II Cast. Each week a rotating cast of “Phish Experts” dissect the band’s music with a fine tooth comb over the course of a 45-minute podcast. This week, we discussed the last week of Fall Tour 2010 including Halloween, Guyutica, Manchester and what the future holds. Check it out…