Customizable Comment Listings

Author:Scott Reilly
Version:2.0
Last update:07 April 2008
Compatibility:WP 2.3+ and 2.5+
Comments:go here
Download:[ zip ]
Description:

Display Recent Comments, Pingbacks, and/or Trackbacks, Top Commenters, or Recent Commenters, and use the comment, commenter, and/or post information of your choosing to customize the how they are listed. You can narrow comment searches by specifying post IDs, comment types, and/or comment status, among other things.

Extended Description

Easily find comments (including pingbacks and/or trackbacks) or commenters and list and display anything about them or their related post in the manner you want.

Screenshots

  • A screenshot of the admin options page for the plugin showing the options input fields.
    screenshot 1
  • A screenshot of the admin options page for the plugin showing the percent-substitution tag documentation.
    screenshot 2
  • A screenshot of the admin options page for the plugin showing the template function and argument documentation.
    screenshot 3
  • A screenshot of the admin options page for the plugin in WP 2.5 showing some of the options input fields.
    screenshot 4

Installation

  1. Download the file customizable-comment-listings.zip and unzip it into your wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ admin menu in WordPress.
  3. Go to the Options -> CCL (or in WP 2.5: Settings -> CCL) admin options page. Optionally customize the settings. You can read documentation on the template tags, arguments, and percent-substitution tags there as well.
  4. In your sidebar.php (or other template file), insert calls to comment/commenter listing function(s) provided by the plugin.

Template Tags

The plugin provides three template tag for use in your theme templates.

Functions

  • Get recent comments :

    <?php function c2c_get_recent_comments( $limit = 5,
      $format = "<li>%comment_author%: %comment_excerpt_URL%?</li>",
      $types = 'comment pingback trackback',
      $status = '1',
      $ids = '',
      $order = 'DESC',
      $offset = 0,
      $date_format = 'm/d/Y' ) ?>
  • Get top commenters :

    <?php function c2c_get_top_commenters( $limit = 5,
      $format = "<li>%comment_author_URL% (%total_comments%)</li>",
      $types = 'comment pingback trackback',
      $status = '1',
      $ids = '',
      $order = 'DESC',
      $offset = 0,
      $date_format = 'm/d/Y' ) ?>
  • Get recent commenters :

    <?php function c2c_get_recent_commenters( $limit = 5,
      $format = "<li>%comment_author%: %comment_excerpt_URL%</li>",
      $types = 'comment pingback trackback',
      $status = '1',
      $ids = '',
      $order = 'DESC',
      $offset = 0,
      $date_format = 'm/d/Y' ) ?> 

Arguments

  • $limit
    The number of comments/commenters to list.
    Default: 5
  • $format
    String containing percent-substitution tags and text to be displayed for each comment/commenter retrieved.
  • $type
    *Optional.* Space-separated list of comment types to include — leave empty to search for all types of comments, otherwise specify one or more of: ‘comment’, ‘pingback’, or ‘trackback’.
    Default value: ‘comment pingback trackback’
  • $order
    (optional) Indicates whether the comments/commenters should be listed in ascending or descending order.
    Possible values: ‘ASC’ or ‘DESC’
    Default value: ‘DESC’
  • $offset
    (optional) Number of comments/commenters to skip from the beginning of the list of posts found.
    Default value: 0
  • $date_format
    (optional) Date format, PHP-style, to use to format any dates. If set to ”, then the blog default date format of
    ‘$default_date’ will be used. Keep in mind that the template functions provide their own date format.
    Possible values: see us2.php.net/date for more info on date format strings.
    Default value: ‘m/d/Y’

Tips & Examples

  • <ul>
       Recent Comments
      <?php c2c_get_recent_comments(3); ?>
    </ul>
  • <ul>Recently Commented
       <?php c2c_get_top_commenters(3); ?>
    </ul>
    
  • <ul>Recently Updated
       <?php c2c_get_recent_commenters(3); ?>
    </ul>

Release Log

Copyright & Disclaimer

Copyright © 2005-2008 by Scott Reilly (aka coffee2code)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), 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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, 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.

Acknowledgements

Thanks to all those who have contributed feedback and support!