{"id":143,"date":"2005-11-11T17:54:25","date_gmt":"2005-11-11T22:54:25","guid":{"rendered":"http:\/\/ronrothman.com\/public\/leftbraned\/?p=143"},"modified":"2019-02-15T20:56:02","modified_gmt":"2019-02-16T01:56:02","slug":"wordpress-plugin-recent-love-a-list-of-recent-comments","status":"publish","type":"post","link":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/","title":{"rendered":"WordPress Plugin: Recent Love (A List of Recent Comments)"},"content":{"rendered":"<div class=\"fieldTable\">\n<div class=\"fieldRow\">\n<span class=\"fieldLabel\">Plugin Name:<\/span><span class=\"fieldVal\">Recent Love<\/span><\/div>\n<div class=\"fieldRow\">\n<span class=\"fieldLabel\">Plugin Author:<\/span><span class=\"fieldVal\">Ron Rothman<\/span><\/div>\n<div class=\"fieldRow\">\n<span class=\"fieldLabel\">Description:<\/span><span class=\"fieldVal\">Presents a list of recent comments, one comment per post.<\/span><\/div>\n<div class=\"fieldRow\">\n<span class=\"fieldLabel\">Latest Version:<\/span><span class=\"fieldVal\">0.5 (Updated April 4, 2007)<\/span><\/div>\n<div class=\"fieldRow\">\n<span class=\"fieldLabel\">Download:<\/span><span class=\"fieldVal\"><a href=\"https:\/\/www.ronrothman.com\/public\/lb\/code\/rr_recent_love.txt\">txt<\/a> <a href=\"https:\/\/www.ronrothman.com\/public\/lb\/code\/rr_recent_love.phps\">phps<\/a> <a href=\"https:\/\/www.ronrothman.com\/public\/lb\/code\/rr_recent_love.zip\">zip<\/a><\/span>&nbsp;<\/div>\n<\/div>\n<div style=\"clear: both; height: 1px;\"><\/div>\n<p>A few months ago, I wanted to display a list of recent comments in my blog&#8217;s sidebar.  After searching through the countless plugins which return lists of comments, I finally decided on Scott Reilly&#8217;s <a href=\"https:\/\/www.coffee2code.com\/archives\/2004\/07\/08\/plugin-toprecent-commenters\/\">Top\/Recent Commenters<\/a> plug-in.<\/p>\n<p>Unfortunately, I had to tweak Scott&#8217;s code to get it to work the way I wanted.  One tweak led to another (you know how it is) until I finally just scrapped the original code and rolled my own.  (You can see it in action on my blog&#8217;s <a href=\"https:\/\/www.ronrothman.com\/public\/leftbraned\/\">front page<\/a>.)<br \/>\n<!--more--><\/p>\n<h3>What It Does<\/h3>\n<p>Adds template function:<\/p>\n<pre class=\"code\">rr_recent_comments ($num_recent_posts = 5, $before = '&lt;li&gt;', $after = '&lt;\/li&gt;')\n<\/pre>\n<p><code>rr_recent_comments()<\/code> returns a list of recent comments.<\/p>\n<p>When invoked with no parameters, it returns a list of the latest comment from each of the most recent 5 posts.  Only one comment (the most recent one) per post is listed.<\/p>\n<p>By default, any comments made by the author of the post are <em>not<\/em> included in the list.  (This behaviour can be configurably modified.)  Long post titles are truncated to a length which you can configure.  Trackbacks and pingbacks are not included in the list by default.<\/p>\n<p>You can exlcude certain posters, based on various criteria (author email, author name, etc.).  This is helpful, for example, to exclude yourself from the list.<\/p>\n<h3>How to Install It<\/h3>\n<ol>\n<li>Requirements: WordPress 1.5 or greater (verified to work on 1.5.2, 2.0, 2.0.1, 2.2, 2.2.2, 2.2.3, 2.3.2, 2.3.3, 2.5.1, 2.6.0, 2.6.1, 2.7, 2.8.x, 2.9.1, 2.9.2)<\/li>\n<li>Download <a href=\"https:\/\/www.ronrothman.com\/public\/lb\/code\/rr_recent_love.txt\">the plugin file<\/a>, and put it file in your WordPress plugin directory, <code>wp-content\/plugins<\/code>.  (Make sure to name it <code>rr_recent_love<\/code><strong><code>.php<\/code><\/strong>.<\/li>\n<li>Enable the plugin in the WordPress Plugin Admin panel.<\/li>\n<\/ol>\n<h3>How to Use It<\/h3>\n<p>Just insert the following call into your theme files, wherever you want the comment list to appear (e.g., <code>sidebar.php<\/code>):<\/p>\n<pre class=\"code\">&lt;ul class='recent_comments'&gt;\n    &lt;?php echo rr_recent_comments(); ?&gt;\n&lt;\/ul&gt;\n<\/pre>\n<p>You can customize your list two ways: tag parameters and global config options.<\/p>\n<h4>Parameters<\/h4>\n<p><code>rr_recent_comments()<\/code> takes three parameters, all of which are optional.<\/p>\n<ol>\n<li><code>$num_recent_posts<\/code>\n<p class=\"indentlr\">The [maximum] number of comments to display.<br \/>\n<i>Default<\/i>: 5<\/li>\n<li><code>$before<\/code>\n<p class=\"indentlr\">The text to display before each comment.<br \/>\n<i>Default<\/i>: &#8216;&lt;li&gt;&#8217;<\/li>\n<li><code>$after<\/code>\n<p class=\"indentlr\">The text to display after each comment.<br \/>\n<i>Default<\/i>: &#8216;&lt;\/li&gt;&#8217;<\/li>\n<\/ol>\n<h4>Configuration Options<\/h4>\n<p>The behaviour of <code>rr_recent_comments()<\/code> can be customized on a global basis by editing some values in the plugin file, <code>rr_recent_comments.php<\/code>.  With the possible exception of <code>$max_title_length<\/code>, most installations will probably not need to futz with these, but they&#8217;re there if you want &#8217;em.<\/p>\n<ul>\n<li><code>$max_title_length<\/code> (<i>Default<\/i>: 38)\n<p class=\"indentlr\">This value represents the longest length that a post title may be without it being truncated for display.  Titles longer than this will be indiscriminately chopped, and an ellipses will be appended to them.  Set to 0 to disable truncation altogether (not recommended).<\/p>\n<\/li>\n<li><code>$exclude_authors_comments<\/code> (<i>Default<\/i>: true)\n<p class=\"indentlr\">Set to true to exclude an author&#8217;s comments from his\/her own posts.  Set to false to include them.<\/p>\n<\/li>\n<li><code>$link_to_commenters_websites<\/code> (<i>Default<\/i>: true)\n<p class=\"indentlr\">Set to true to hyperlink the comment author&#8217;s name to the website they enter on your comment form.  Set to false to suppress hyperlinking.<\/p>\n<\/li>\n<li><code>$suppress_trackbacks<\/code> (<i>Default<\/i>: true)\n<p class=\"indentlr\">If true, trackbacks and pingbacks are excluded from the comment list.  Set to false to include them.<\/p>\n<\/li>\n<li><code>$identify_authors_by<\/code> and <code>$excludes_sql_list<\/code> (<i>Default<\/i>: no exclusions)\n<p class=\"indentlr\">These two fields work in conjunction to allow you to specify a list of comments whose comments should <i>never<\/i> be included in the list.  (Note that most blog installation will not need to use this functionality.)  First, choose the criterion by which you want to identify the excluded comments and set <code>$identify_authors_by<\/code> to one of:<\/p>\n<ul class=\"indentlr\">\n<li><code>'comment_author'<\/code>,<\/li>\n<li><code>'comment_author_url'<\/code> or<\/li>\n<li><code>'comment_author_email'<\/code>.<\/li>\n<\/ul>\n<p class=\"indentlr\">Then add the excluded commenters to the list <code>$excludes_sql_list<\/code>; be careful to follow the correct format, which is:<br \/>\n<code>('COMMENTER_1', 'COMMENTER_2', ..., 'COMMENTER_N')<\/code>.<\/p>\n<p>You must specify the COMMENTERs in a way that matches the value of <code>$identify_authors_by<\/code>.  I.e., if <code>$identify_authors_by<\/code> is <code>'comment_author_email'<\/code>, then the COMMENTERs in <code>$excludes_sql_list<\/code> must all be email addresses.<\/li>\n<\/ul>\n<h3>Revision History<\/h3>\n<p>0.1 (May 1, 2005): Initial revision.<\/p>\n<p>0.2 (October 30, 2005): Rewrite and add new features.<\/p>\n<p>0.3 (November 11, 2005): Clean up for publication.<\/p>\n<p>0.4 (?)<\/p>\n<p>0.5 (April 4, 2007): Added $link_to_commenters_websites option.<\/p>\n<h3>See It Live<\/h3>\n<p>Here are some of the sites which are using Recent Love (as of the time of this writing):<\/p>\n<ul>\n<li><a href=\"https:\/\/www.ivovic.net\/\">Milorad Ivovi\u00c4\u2021<\/a><\/li>\n<li><a href=\"https:\/\/www.grumpyoldwoman.net\/\">Grumpy Old Woman<\/a><\/li>\n<li><a href=\"https:\/\/www.kimrom.info\/\">Kim Rom dot info<\/a><\/li>\n<li><a href=\"https:\/\/rizzofamilia.com\/\">Rizzo Familia<\/a><\/li>\n<li><a href=\"https:\/\/www.tehblitz.org\/\">Teh Blitz<\/a><\/li>\n<li><a href=\"https:\/\/diaryofarockstar.com\/\">Diary of a Rockstar<\/a><\/li>\n<\/ul>\n<h3>Important Disclaimers and Such<\/h3>\n<h4>Summary<\/h4>\n<ol>\n<li>You may freely use and distribute this code as long as you include the appropriate copyright notice.<\/li>\n<li>If anything bad happens as a result of your using this code, don&#8217;t come crying to me.  If anything good happens as a result of your using this code, send me some chocolate.<\/li>\n<\/ol>\n<h4>Details<\/h4>\n<p><small>Copyright \u00c2\u00a9 2005-2007 by Ron Rothman and \u00c2\u00ableftbraned.  Some rights reserved.<\/small><\/p>\n<p><small>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the &#8220;Software&#8221;), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:<\/small><\/p>\n<p><small>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<\/small><\/p>\n<p><small>THE SOFTWARE IS PROVIDED &#8220;AS IS&#8221;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Plugin Name:Recent Love Plugin Author:Ron Rothman Description:Presents a list of recent comments, one comment per post. Latest Version:0.5 (Updated April 4, 2007) Download:txt phps zip&nbsp; A few months ago, I wanted to display a list of recent comments in my blog&#8217;s sidebar. After searching through the countless plugins which return lists of comments, I finally [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[11,5],"tags":[61,50,54,53],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WordPress Plugin: Recent Love (A List of Recent Comments) - \u00ableftbraned<\/title>\n<meta name=\"description\" content=\"WordPress Plugin: Recent Love (A List of Recent Comments)\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WordPress Plugin: Recent Love (A List of Recent Comments) - \u00ableftbraned\" \/>\n<meta property=\"og:description\" content=\"WordPress Plugin: Recent Love (A List of Recent Comments)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/\" \/>\n<meta property=\"og:site_name\" content=\"\u00ableftbraned\" \/>\n<meta property=\"article:published_time\" content=\"2005-11-11T22:54:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-16T01:56:02+00:00\" \/>\n<meta name=\"author\" content=\"Ron\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ron\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/\",\"url\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/\",\"name\":\"WordPress Plugin: Recent Love (A List of Recent Comments) - \u00ableftbraned\",\"isPartOf\":{\"@id\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/#website\"},\"datePublished\":\"2005-11-11T22:54:25+00:00\",\"dateModified\":\"2019-02-16T01:56:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/#\/schema\/person\/86056901135a054d2fa85dcd1f43555a\"},\"description\":\"WordPress Plugin: Recent Love (A List of Recent Comments)\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress Plugin: Recent Love (A List of Recent Comments)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/#website\",\"url\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/\",\"name\":\"\u00ableftbraned\",\"description\":\"go. figure. \u00ab\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/#\/schema\/person\/86056901135a054d2fa85dcd1f43555a\",\"name\":\"Ron\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a060c4a10d3c4fecd6555ad6b7e9c08d?s=96&d=identicon&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a060c4a10d3c4fecd6555ad6b7e9c08d?s=96&d=identicon&r=pg\",\"caption\":\"Ron\"},\"description\":\"https:\/\/www.ronrothman.com\/public\/about+me.shtml\",\"sameAs\":[\"https:\/\/www.ronrothman.com\/\"],\"url\":\"https:\/\/www.ronrothman.com\/public\/leftbraned\/author\/ron\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WordPress Plugin: Recent Love (A List of Recent Comments) - \u00ableftbraned","description":"WordPress Plugin: Recent Love (A List of Recent Comments)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/","og_locale":"en_US","og_type":"article","og_title":"WordPress Plugin: Recent Love (A List of Recent Comments) - \u00ableftbraned","og_description":"WordPress Plugin: Recent Love (A List of Recent Comments)","og_url":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/","og_site_name":"\u00ableftbraned","article_published_time":"2005-11-11T22:54:25+00:00","article_modified_time":"2019-02-16T01:56:02+00:00","author":"Ron","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Ron","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/","url":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/","name":"WordPress Plugin: Recent Love (A List of Recent Comments) - \u00ableftbraned","isPartOf":{"@id":"https:\/\/www.ronrothman.com\/public\/leftbraned\/#website"},"datePublished":"2005-11-11T22:54:25+00:00","dateModified":"2019-02-16T01:56:02+00:00","author":{"@id":"https:\/\/www.ronrothman.com\/public\/leftbraned\/#\/schema\/person\/86056901135a054d2fa85dcd1f43555a"},"description":"WordPress Plugin: Recent Love (A List of Recent Comments)","breadcrumb":{"@id":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wordpress-plugin-recent-love-a-list-of-recent-comments\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ronrothman.com\/public\/leftbraned\/"},{"@type":"ListItem","position":2,"name":"WordPress Plugin: Recent Love (A List of Recent Comments)"}]},{"@type":"WebSite","@id":"https:\/\/www.ronrothman.com\/public\/leftbraned\/#website","url":"https:\/\/www.ronrothman.com\/public\/leftbraned\/","name":"\u00ableftbraned","description":"go. figure. \u00ab","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ronrothman.com\/public\/leftbraned\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.ronrothman.com\/public\/leftbraned\/#\/schema\/person\/86056901135a054d2fa85dcd1f43555a","name":"Ron","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ronrothman.com\/public\/leftbraned\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a060c4a10d3c4fecd6555ad6b7e9c08d?s=96&d=identicon&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a060c4a10d3c4fecd6555ad6b7e9c08d?s=96&d=identicon&r=pg","caption":"Ron"},"description":"https:\/\/www.ronrothman.com\/public\/about+me.shtml","sameAs":["https:\/\/www.ronrothman.com\/"],"url":"https:\/\/www.ronrothman.com\/public\/leftbraned\/author\/ron\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/posts\/143"}],"collection":[{"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/comments?post=143"}],"version-history":[{"count":18,"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":528,"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/posts\/143\/revisions\/528"}],"wp:attachment":[{"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/media?parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/categories?post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronrothman.com\/public\/leftbraned\/wp-json\/wp\/v2\/tags?post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}