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 2013-05-10 | YEMblog

    44 Comments so far      Post a Comment

    1. It’s remarkable to go to see this website and reading the views of all friends about this article, while I am also zealous of getting knowledge.

    2. Hey there, You have done a great job. I will definitely
      digg it and personally recommend to my friends. I am sure they’ll be benefited from this website.

    3. It’s actually a great and helpful piece of info.
      I am satisfied that you simply shared this useful information with us.
      Please keep us informed like this. Thank you for sharing.

    4. If you are going for finest contents like myself, just
      pay a quick visit this website every day for the
      reason that it presents quality contents, thanks

    5. Awesome! Its in fact awesome piece of writing, I have
      got much clear idea about from this post.

    6. It’s a shame you don’t have a donate button!
      I’d certainly donate to this excellent blog!
      I guess for now i’ll settle for book-marking and
      adding your RSS feed to my Google account. I look forward to
      new updates and will talk about this blog with my Facebook
      group. Talk soon!

    7. Hi there, You have done a great job. I’ll certainly digg it
      and personally recommend to my friends. I am confident they will
      be benefited from this web site.

    8. Hello, constantly i used to check web site posts here early
      in the daylight, because i love to find out more and more.

    9. Link exchange is nothing else however it iss just placing
      the other person’s blog link on youyr page at
      suitable place and other person will also do same in favor of you.

    10. was wondering if we can ddo a guest post?

    11. Howdy! This is kind of off topic but I need some help from an established blog.
      Is it very hard to set up your own blog? I’m not very techincal but I can figure things out
      pretty fast. I’m thinking about creating my own but
      I’m not sure where to begin. Do you have any points or suggestions?
      With thanks

    12. In the signature line provide a link back to your
      blog. Then it must be the attack of Google redirect virus.

      Perhaps it’s better not be using these social networks, they say
      they keep people connected, but only in a virtual world, it probably prevents a lot of people from going outside and really connecting.

    13. Greetings! This is mmy first comment here so I just wanted tto give a quick shout out and tell
      you I truly enjoy reading your articles. Can you suggest any other
      blogs/websites/forums that deal with the same topics? Appreciate it!

    14. Ideal work you have done, this site is actually cool with good information.

    15. So why is being overweight such a direct link to diabetes.
      The huge distinction between Adiphene and Adipex is
      that Adiphene is a product that uses a sequence of natural
      and secure to use ingredients. Indeed Adiphene
      weight reduction pill is the answer for those who always goes on food
      regimen however can’t endure the meals carving hunger and the irritability gave rise by dieting.

    16. An outstanding share! I have just forwarded this onto a
      coworker who had been conducting a little homework on this.
      And he in fact ordered me breakfast simply because I found it for
      him… lol. So allow me to reword this…. Thank YOU for the meal!!
      But yeah, thanks for spending some time to discuss this
      subject here on your internet site.

    17. Hi! Quick question that’s entirely off topic. Do you know how to make your site mobile friendly?
      My site looks weird when viewing from my iphone 4.

      I’m trying to find a template or plugin that might be able
      to resolve this problem. If you have any recommendations, please share.
      Many thanks!

    18. It’s a pity you don’t have a donate button! I’d without a doubt donate to
      this outstanding blog! I guess for now i’ll settle for book-marking and
      adding your RSS feed to my Google account.

      I look forward to brand new updates and will talk
      about this website with my Facebook group.
      Talk soon!

    19. My partner and I stumbled over here by a difverent web page and thought I may as well check things out.
      I liike whawt I see sso now i’m following you.

      Look forward to looking at your weeb page yet again.

    20. I quite like reading through an article that ccan make pople think.
      Also, thanks for pefmitting me to comment!

    21. Hi, I think your blog might be having browser
      compatibility issues. When I look aat your blog in Safari, it looks fine but when opening
      in Internet Explorer, iit has some overlapping.

      I juet wantted to ggive you a quck heads up! Other then that,
      great blog!

    22. Excellent post. I was checking continuously this blog and I’m impressed!

      Extremely useful information specially the last part :) I care for such information a lot.

      I was looking for this particular information for a very
      long time. Thank you and best of luck.

    23. I always used to study paragraph iin news papers but
      now as I am a user of internet thus from now I am using net
      for articles, thanks to web.

    24. Hey there! This is my first visit to your blog!
      We are a group of volunteers and starting a new initiative in a community
      in the same niche. Your blog provided us useful information to work on. You have
      done a wonderful job!

    25. It’s awesome for me to have a web page, which is
      beneficial in support of my know-how. thanks admin

    26. Hi, yeah this article is truly good and I have learned lot of
      things from it concerning blogging. thanks.

    27. I feel that is one of the most significant info for me.
      And i am happy studying your article. However wanna observation on some basic
      issues, The website style is perfect, the articles is actually great :
      D. Just right task, cheers

    28. What’s up everyone, it’s my first pay a quick visit
      at this web site, and paragraph is really fruitful designed for me, keep up posting these types of posts.

    29. Great site you have here.. It’s hard to find good quality writing like yours nowadays.
      I seriously appreciate people like you! Take care!!

    30. What’s up Dear, are you actually visiting this wweb pae regularly,
      if so afterward you will definitely take good experience.

    31. Magnificent web site. Plenty of useful info here. I am sending it to a few pals ans also sharing in delicious.
      And naturally, thanks to your sweat!

    32. Just – Host is a internet hosting company that has been established in 2008
      in California. With the bronze plan, you will get
      75 GB of disk space, hosting of unlimited nuimber of web sites with c – Panel
      accounts for each and every website, and 600 GB of bandwidth.
      If you go for additional reliable resellers you will be able
      to relish a seamless hosting service which you may
      use as your small business begins to grow inside internet.
      Its multi store retailing functionality may help your on-line business
      to grow. Linux resellers are rapidly losing popularity which is the most effective time to
      turn into a reseller of Windows. Software houses has launched this method and earning by both hands.
      ll be totally pleasantly surprised about how many internet site hosting companies with toll free
      numbers for auction on their internet site never answer their phones, or put you on hold and make you
      wait for what seems like an eternity. And
      always try and avoid those companies which offer free hosting service for the customers.

      Users will definitely ask for something which is lucrative, accompanied which has a decent reputation and is built after
      vast experience. 7) Self Service: It may be the process off buying a complete server and configuring,
      installing the software.

    33. Por estos días, merece la pena seguir en Twitter a
      las grandes cadenas de tiendas para percibir las ofertas y descuentos en miles de productos electrónicos, videojuegos, ropa, calzado, juguetes para este
      viernes negro y ciberlunes: @AmazonDeals, @Walmart, @HomeDepot @tgmaxx, @BestBuy @objetivo prometen publicar ofertas con hasta
      el setenta u 80 por cien de descuento.

    34. Useful information. Lucky me I discovered your web site accidentally,
      and I am shocked why this twist of fate didn’t took place
      earlier! I bookmarked it.

    35. Becoming a website hosting reseller is pretty a profitable venture because
      the host provides a bunch of interesting features, quality, personalized attention and
      fulfills every one of the requirements that an online site owner
      may have. To top it all, Just – Host’s web host reseller plan carries
      with it an unlimited quantity of free c – Panel licenses, automated billing software, and thus
      much more. The discount will probably be applied immediately and you
      will probably enjjoy a substantial discount off your total bill.
      It is extremely crucial to search a reseller which is reliable enough.
      They offer functions to make a stronger site like: database support, preinstalled
      CGI scripts, security, anonymous FTP, e-commerce solution and much more.
      In order to become hosting reseller, isn’t as tough as you may be thinking
      about the other hand, it really is very easy.
      The reseller doesn’t nee to keep up the main website
      because he is merely reselling the help for website hosting.
      This service is very easy to create and use from the central dashboard that can help with service and package creation.
      There are several types of hosting, let’s find some of these.

      Keep your order form as common, uncluttered and easy to complete as
      you aree able to.

    36. Nice post. I was checking constantly this weblog
      and I’m impressed! Very helpful info particularly the last phase :
      ) I deal with such info much. I was seeking this certain information for
      a very long time. Thanks and best of luck.

    37. This site certainly has all of the information and facts I wanted about this subject and
      didn’t know who to ask.

    38. It’s good to meet individuals whho prefer to shhare their understanding and wissom with others!

    39. Great site you have got here.. It’s difficult to find high quality writing like yours these days.
      I honestly appreciate people like you! Take care!!

    40. The highest deer velvet extract has been sourced by your laboratory
      and imported it from New Zealand.

    41. Good web site you’ve got here.. It’s hard to find high-quality writing like yours
      nowadays. I really appreciate individuals like you! Take care!!

    42. Thank you a lot for sharing this with all of us you really recognise what you’re talking approximately!
      Bookmarked. Please also talk over with my site =). We could have
      a link exchange contract between us

    43. Does your blog have a contact page? I’m havin problems locating it but, I’d like to send you
      an e-mail. I’ve got some suggestions for your blog you might be interested in hearing.
      Eitfher way, great blog and I look forward to seeing
      it expand over time.

    44. You should stand eligible for your scheme by fulfilling some conditions while applying so that you just is not going to
      face any problem to get approved Sac cabas
      chanel funding has closed $150 million in transactions
      inside last 99 days.

    Post a Comment

    You must be logged in to post a comment.