After much delay, blaming FIFA World Cup for it, the new Comment Rating Pro version 2.12.1 is finally ready. By popular demand, two key features are implemented in this version:

  1. Voting by logged-in users only. This gives you the capability of running Comment Rating on a membership-based site.  Non-logged-in visitors always see a gray icons and a message reminding them to log in or register.
  2. Voting fraud detection by cookie. Votes are counted per cookie. This solves the problem that most of your readers are behind a NAT firewall. However, it’s much easier to create voting fraud. User can simply launch a different browser or clear the cookie to make more votes.

Here’s the screen shot of the option page.

Here’s a sample that only logged-in user can vote.

If you have donated before, you can still use the old download link to grab version 2.12.1. If you have lost the link, please email me.

There’s little configuration change, which is still backward compatible to previous versions. The new capabilities are in “Voting fraud prevention” and “Only logged-in users can vote”.

If you haven’t customized Comment Rating Pro options, it’s recommended that you click “Reset options to default” to get all the option variable defaults.

To obtain both Comment Rating Pro and Comment Rating Widget Pro plugins, please donate $20. After donation, please follow the Paypal link returning to my site for the download page.

Comment Rating Pro

Comment Rating Pro WordPress plugin is the advanced version of the popular Comment Rating plugin.  The Pro version was created to help those demanding for more features and customization flexibility.  It has all the functionality of the standard version, and the following features.

  • Styling comment image and text with a CSS class
    • Voting by logged-in users only. This gives you the capability of running Comment Rating on a membership-based site.  Non-logged-in visitors  always see a gray icons and a message reminding them to log in or register.
    • Voting fraud detection by cookie. Votes are counted per cookie. This solves the problem that most of your readers are behind a NAT firewall.
      • Disabling voting restrictions, i.e. disabling one-vote-per-IP-address and allow unrestricted voting
      • Additional functions to retrieve comments ordered by their ratings
      • Additional icons to make your blog unique

      For the same reasons, I also created Comment Rating Widget Pro with the feature:

      • Allows ordering comments by Comment Rating in the last X days on a sidebar.

      To obtain both Comment Rating Pro and Comment Rating Widget Pro plugins, please donate $20.  After donation, please follow the Paypal link returning to my site for the download page.

      The Pro version option page can be seen here.

      Comment Rating Pro Customization Guide

      This is a brief guide to customize using the Comment Rating Pro’s internal functions.  These functions are accessible globaly as soon as the plugin is enabled.

      CSS based styling

      If you want to style the comment images and text, you can define a CSS class in your theme style file (style.css) with  “CommentRating” class.  For example, the following will show the comment rating images and text on the right.

       .CommentRating {
            text-align: right;
            float: right;
       }

      To access the ratings of a comment

      To avoid duplicated database access, Comment Rating use an cache “$ck_cache” hash array, defined as,

      $ck_cache = array('ck_ips'=>"",
                        'ck_comment_id'=>0,
                        'ck_rating_up'=>0,
                        'ck_rating_down'=>0);

      You should use it as a global variable. Here’s the sample code.

      global $ck_cache;
      ckrating_get_rating($comment_ID);

      Then, all the related content will be accessible.

       $ck_cache['ck_comment_id']
       $ck_cache['ck_ips']
       $ck_cache['ck_rating_up']
       $ck_cache['ck_rating_down']

      Tight integration

      If you want to do tight integration with your theme in placement and style, you will need to insert the following  line into your theme “comments.php” file within the comment loop.

      <?php  if(function_exists(ckrating_display_karma))
             { ckrating_display_karma(); } ?>

      Order comments by their ratings

      If you want to be  adventurous in displaying comments in a post, you can use comment rating value to order the comments. This is done sorting based on the “comment_karma” field in the Wordpress “comment” table. Two things need to be done.

      1. Choose the comment rating value. The value for “comment_karma” field can take three options, i.e. Likes, Dislikes or Both. This is configured in “Comment Rating Pro Options” page, “Advanced Options”.
      2. Modify your theme’s “comments.php” file to change how comments are sorted.

      If your theme does NOT use the new wp_list_comments() function (see this post
      to understand what wp_list_comments() do). Then use the Comment Rating Pro’s function ckrating_get_comment() to retrieve comments in a certain sorting order for the current post.

         $post_id = $post->ID;
         $comments = ckrating_get_comments(
            "post_id=$post_id&orderby=comment_karma&order=DESC");
         foreach($comments as $comm) :
      // Now display the comment detail.  Here in a grossly simplified way
        echo($comm->comment_author);
        echo($comm->comment_time);
        echo($comm->comment_text);
            // etc. etc. ...
      
         endforeach;
      

      If your theme uses wp_list_comments(), I haven’t figure out how to modify it.  The flexibility offered by wp_list_comments() is too limited to allow customization.

      Comment Rating Widget Faq

      Do I need both Get Recent Comment and Comment Rating Widget plugins?

      No you don’t.  You only need to have Comment Rating Widget activated.  If you keep both plugin activated, there will be a conflict.

      In fact, if you had Get Recent Comment installed before, you need to click the “Reset template to default” to get the Comment Rating Widget template.

      I cannot see the Comment Rating images/votes on my sidebar.

      Please check the Comment Rating Widget option page, the default template should look like the following.

      <li><a href=”%comment_link” title=”%post_title, %post_date”>%comment_author</a>: %comment_excerpt %comment_rating</li>

      If not, please  click the “Reset template to default” to get the Comment Rating Widget template.

      How do I control the displayed image and rating in the widget?

      The comment rating and images on display can be “Likes only”, “Dislikes only”, or Both.  This is customizable by the “Value for comment_karma” option in Comment Rating (under Advanced Option).

      I made the change to the Comment Rating “Value for comment_karma”, but there’s no change on the sidebar.

      The plugin comes with an internal cache to reduce performance impact on page loading.  You have to clean the cache by clicking on Comment Rating Widget option “Update recent comment options” at the bottom.

      If the Comment Rating plugin is not installed, will this widget still work?

      Yes, this plug in will function exactly as “Get Recent Comment”.

      Older Posts »