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"; } } ?> Festival 8: Ambient Alarm Clock – All Things 8 [Dog Gone Blog] | YEMblog

    Festival 8: Ambient Alarm Clock – All Things 8 [Dog Gone Blog]

    14 Comments so far      Post a Comment

    1. What’s Happening i am new to this, I stumbled upon this I have found It absolutely helpful and
      it has helped me out loads. I hope to contribute & help other users
      like its

      aided me. Great job.

    2. Wonderful beat ! I would like to apprentice while you amend your website,
      how could i subscribe for a blog web site? The account aided me a acceptable deal.
      I had been a little bit acquainted of this your broadcast offered bright clear idea

    3. In this economy cash talks, especially at the end of the month, or the
      end of the fiscal year, or just before a new model line is
      introduced. If the house is tiny, it requires additional space to ensure everyone is comfortable inside such as
      bigger rooms, bathroom, kitchen, dining room and living
      room. Staying away from the kitchen and bathroom
      showrooms, that always showcase the high end models
      and every small appliance known to mankind.

    4. The Land Report, Entrepreneur and The Wall
      Street Journal as one of the least of which is that Charlotte entered the housing crisis
      after many other parts of the Accredited Management Organization, AAIMS Property
      Management Jobs Nyc.

    5. At some point the body is unable to use all of the” Healing Haiti’s Children program that began in the summer of 2010. The game 7 sports training Academy also offers birthday party packages, after school programs and summer camps too! Our main focus at MN game 7 sports training is the athlete. Raw fruits and vegetables contain essential vitamins, minerals, antioxidants, fiber and water. Now we’ll consider some more specific plyometrics, for both the lower body as well as an increase in capillaries as well as their stabilizers.

    6. There are so many more ways that you can advertise
      your special event such as using:. For an even better return on your minimal
      investment, consider offering special deals on related merchandise to those who
      took part in the fun. Buying and selling pins
      are often designed to memorialize anniversaries as
      well as celebrations, show help for the athletics, instructional as
      well as sports activities group and at martial arts training events.

    7. It just takes a little planning and a little help from a great trading pin supplier to create pins that will be
      the hit of the tournaments this year. (c) 2008, Her Mentor Center;
      updated 2012 by Self – Growth. You can choose from options like photo etching,
      offset printing, soft enameled etc.

    8. I constatly spent my half an hour to read this webpage’s articles all the time along with
      a mug of coffee.

    9. There are some other factors that why people
      do not go for the lawyer is their charge. They will let you do a series
      of field sobriety tests. Your Gainesville DUI Lawyer may possibly question the laboratory personnel that did the analyzing of your blood for the BAC testing, and might also call
      in independent experts that will refute the claims of the prosecution.

    10. Hey there would you mind stating which blog platform you’re
      using? I’m going to start my oown blog in the near future
      but I’m having a tough time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
      The reason I ask is because your design and style seems different then most blogs and
      I’m looking for something completely unique. P.S My apologies for being off-topic
      but I had to ask!

    11. You should not sign the papers provided by the lawyer without reading it, no matter how much trustworthy is your
      lawyer, make sure you must go through all the terms and conditions of the paper before signing over
      it. This principle in the United States is called ‘Alternative Dispute Resolution’ and continues
      to gain popularity. This is because of the professionalism that this lawyer

    12. I am sure this artile has touched all the internet people, its really really nice article on building up new weblog.

    13. Wonderful article! That is the kind of information that are supposed to be shared around
      the web. Shame on Google for not positioning this post upper!
      Come on over and discuss with my web site . Thanks =)

    14. Conversing online will even make you forget about your big pimple.
      It honestly is perfectly logical and I for one REALLY appreciate logic.
      Now you can access the admin panel at the top right corner.

    Post a Comment

    You must be logged in to post a comment.