cnp_studio (cnp studio) - An interactive division of Clark/Nikdel/Powell

A unique mix of technology, creativity and human interaction makes cnp_studio a Web development firm focused on connecting people. Creating simple, useful Web sites is what we do. Learn more about us.

WordPress Plugins

WordPress Plugins

Author Comment Reply Plugin ver. 1.04

About

Download .zip fileWe originally developed the Author Comment Reply plugin solely for use on Sony Computer Entertainment America’s (SCEA) PlayStation.Blog to visually associate reader comments and author responses. Thanks to SCEA’s desire to contribute back to the WordPress community, we are able to offer this plugin for public consumption.

The Author Comment Reply plugin gives authors the ability to reply directly to a posted comment.

Change Log

  • ver. 1.04
    • Made installation WP 2.5 compatible
  • ver. 1.03
    • Made installation WP 2.5 compatible
  • ver. 1.02
    • Bug fixes
  • ver. 1.01
    • Bug fixes

Installation

  1. Note: The Image-Rotator Plugin requires WordPress 2.3 or greater
  2. Upload the Author Comment Reply plugin to your plug-ins directory, usually wp-content/plugins to create a wp-content/plugins/comment-replies/ directory.
  3. Activate the plug-in through the Plug-ins admin screen.

Adding to a Theme

  1. Open the theme's comment file, usually
    wp-content/themes/<THEME NAME>/comments.php
  2. Add the following code within the comment loop directly under the call to comment_text():

    < ?php
    if(function_exists('cr_display_comment_replies')) {
      cr_display_comment_replies($comment);
    }
    ?>
  3. Note: Your comments page must contain the edit_comment_link function. By default this function is used on the comments page. If this function does not exist on your comment page it will need to be added before you can respond to comments.

Styling the Replies

The reply template can easily be updated via the admin under Options -> Comment-Replies. Version 1.0 of the Author Comment Reply plug-in has the following variables available:

  • %REPLY_USERID% - The User ID of the Reply Author
  • %REPLY_AUTHOR% - The nickname of the Reply Author
  • %REPLY_DATE% - The date of the reply. Uses the date format set in the WordPress Options.
  • %REPLY_TIME% - The time of the reply. Users the time format set in the WordPress Options.
  • %REPLY_TEXT% - The content of the reply

Altering Permissions

The Author Comment Reply plug-in comes with two sets of permissions handling. The Default only allows users who have permissions to edit the current post to add replies, this is usually just administrators or the author of the current post. The Author permission mode, allows any users marked as an author to add replies.

To change to Author permission handling:

  1. Open the comment-replies.php file.
  2. Find the line:
    define("CURRENT_AUTH_MODE", DEFAULT_AUTH_MODE);
  3. Replace it with:
    define("CURRENT_AUTH_MODE", AUTHOR_AUTH_MODE);

Managing Replies

You can manage all replies from the Comments area of the WordPress administration by clicking on the Comment Replies section.
Manage Comment Replies Screenshot

Adding Replies

To add a reply, simply find the comment on the front end of your site and click the "Add Reply" link for that comment. Do you not see this link? Make sure you read thoroughly the directions under adding to a theme.

33 comments »

  • Nick on February 6th, 2008 at 1:51 pm said:

    Hi There,
    Is there a way to get the replies to appear in the comment feed?
    Cheers!

  • mike on February 6th, 2008 at 3:08 pm said:

    Hey Nick,

    There is nothing currently in the plugin to add the replies to the comment feed and since I have the comment-replies held in their own table, the comment feed won’t grab them automatically. I decided to store the replies in their own table to cut down on the complexity since the Playstation.Blog was using paged comments.

    Thank you for the feedback. I’ll see what I can do about including this in any future updates.

  • arne on February 6th, 2008 at 5:44 pm said:

    Awesome plugin.

    Interestingly enough, I’m getting an invalid argument error inside the comment-replies.php file:

    Warning: Invalid argument supplied for foreach() in /wp-content/plugins/comment-replies/comment-replies.php on line 557

    Any thoughts?

  • mike on February 6th, 2008 at 6:14 pm said:

    Good catch! I’ve uploaded a new version 1.01 with the fix. The code was trying to foreach() an empty array anytime there was a post with no replies in it. Thank you for the feedback.

  • arne on February 6th, 2008 at 8:34 pm said:

    I can’t seem to find the CSS class(es) in comment-replies.php to make sure the style difference fits with the design aesthetic of the the rest of the blog. I only see a class for displaying an avatar. I could add one but I wanted to make sure one wasn’t already being used/called.

  • Leto on February 6th, 2008 at 8:35 pm said:

    Thanks for sharing the plugin. I take it the replies aren’t part of the default comment system so something like the “Subscribe to comments” plugin (http://txfx.net/code/wordpress/subscribe-to-comments/) won’t activate i.e. send an email alert to the original commenter?

  • mike on February 7th, 2008 at 9:44 am said:

    Arne,

    I didn’t put CSS classes into the output of the variables because I didn’t want any classes interfering with styles you may already have on a site. The best way to go about adding styles to the replies is to look at the styling section of this page. You can add all the HTML mark-up you want to the reply template that will allow you to style the replies as you need.

  • mike on February 7th, 2008 at 9:49 am said:

    Hey Leto,

    As I mentioned to Nick earlier, the author comment replies are going into their own table. So they won’t be pulled in by the comment feed or most other plugins that work with the comments. I would have liked to have stored the replies in the comments table to get some of the built in features like these, but in the end, it would have caused too many issues with all the other plugins out there that read from the comments table.

  • Michel Fortin on February 7th, 2008 at 5:35 pm said:

    Hmmm. I get this bug AFTER I post the comment (in the comment box I replied to):

    Warning: Invalid argument supplied for foreach() in comment-replies.php on line 562

  • Jeffro2pt0 on February 7th, 2008 at 6:25 pm said:

    Does this REPLY link show up for regular users, those that are not registered with the blog? Its nice that I have an easy to use reply feature, but I’d like my community to have the same option.

  • mike on February 8th, 2008 at 11:23 am said:

    Hi Michel,

    I’ve released another update to the plugin, version 1.02. This should take care of your problem. Sorry you guys have had to be our guinea pigs. We tested these on several of the Blogs we work with, but sometimes you don’t see things until its out there.

    Jefro2pto:
    This version of the plugin is designed only to let authors post replies to comments. It was originally designed for Sony’s Playstation.Blog to give their authors the ability to directly respond to comments without having a large gap between the original comment and their reply. If you’re looking for something open to all users, you may want to check out Brian’s Threaded Comments.

  • Colin on February 9th, 2008 at 1:38 am said:

    Hey, I’ve been looking forward to this plugin since it was announced over at the Playstation Blog. I’ve installed it on my blog, followed the instructions and all but I seem to have run into some trouble. Whenever I attempt to add a reply, I get a 404 Not Found error, saying that edit-comments.php could not be found on the server. Any help would be greatly appreciated :)

  • mike on February 11th, 2008 at 9:11 am said:

    Colin,

    It looks like there was an issue when both Javascript was turned off and the blog wasn’t in the root of the site. I’ve uploaded version 1.03 that should solve this issue for you.

  • Colin on February 11th, 2008 at 11:42 am said:

    Ah that did indeed fix it! Thank you very much :D

  • Dean on March 4th, 2008 at 12:26 pm said:

    Hello,

    This plugin works flawlessly, thanks!

    I have a question though, is there any way to make the replies look different from the comments?

    For example, the Playstation blog replies have a red color background to them.

    Thanks again.

  • nick on March 4th, 2008 at 12:40 pm said:

    @Dean

    Yep, you can style the replies however you like. From the WordPress admin you can click the Options menu and then open up the Comment Replies option page. Here is where the HTML is pulled for how the replies will actually be styled. You can alter the display of the replies from here. You can see an example in this screen shot: http://www.flickr.com/photos/cnp_studio/2245871285/in/photostream/

  • arne on March 13th, 2008 at 6:02 pm said:

    Delayed response — I’m an idiot and missed that option page.
    This is awesome. thanks!

  • Danail Karadaliev on March 29th, 2008 at 4:34 am said:

    The plug-in is very nice and works just fine. One little problem to solve - the wp_comment_replies db table is created by default to latin1, not utf8.

  • Mark on March 29th, 2008 at 2:11 pm said:

    Is anyone able to get this to work with Wordpress 2.5?

  • flipper01 on March 31st, 2008 at 5:31 am said:

    Hi, is this compatible with wordpress v2.5?

    I’ve used this plugin on anather blog ad it worked fine, now i’m trygint o impliment it on a new blog using wordpress 2.5 and i get this message when i try to leave a reply:

    “We were unable to add your reply at this time.”

    any ideas? Hope I can get this to work as it’s a great plugin

  • mike on March 31st, 2008 at 8:10 am said:

    We haven’t had a chance to test with 2.5 yet. It looks like the WordPress admin has changed quite a bit in 2.5. I’ll make sure to have a new version up as soon as we’re able to get one complete.

  • mike on April 2nd, 2008 at 12:57 pm said:

    The new 2.5 compatible version is up. Let us know if you run into any problems.

  • flipper01 on April 3rd, 2008 at 3:33 pm said:

    thanks for updating it mike, really apreachiate it. unfortunatly it’s still not working for me, maybe it’s something i’m doing wrong? any idea what I could be doing to make this error appear when i try to leave a reply?

    “We were unable to add your reply at this time.”

  • mike on April 7th, 2008 at 12:05 pm said:

    It turned out that the version I uploaded didn’t get the compatibility changes I made. Sorry about the mistake. The new version with the changes is up.

  • ombra on April 15th, 2008 at 2:57 pm said:

    does this plugin support any “comments to e-mail” plugin, for ex. subscribe to comments?

    so does this plugin allow sending replies to suscribers ?

  • flipper01 on April 16th, 2008 at 5:42 pm said:

    Sorry Mike, it’s still giving me the same error. Am I implementing the call correctly?

    comment_approved == ‘0′) : ?>
    Thanks for the comment, we’re just checking it for naughties, check back soon

  • flipper01 on April 16th, 2008 at 5:43 pm said:

    argh, sorry, how can I post code snippets?

  • mike on April 17th, 2008 at 2:10 pm said:

    flipper01,

    It looks like the table isn’t being created for some reason. If you have database access, run the following command:

    CREATE TABLE `wp_comment_replies` (
    `reply_ID` bigint(20) unsigned NOT NULL auto_increment,
    `comment_ID` bigint(20) unsigned NOT NULL,
    `reply_author` tinytext NOT NULL,
    `reply_author_email` varchar(100) NOT NULL default ”,
    `reply_author_url` varchar(200) NOT NULL default ”,
    `reply_date` datetime NOT NULL default ‘0000-00-00 00:00:00′,
    `reply_date_gmt` datetime NOT NULL default ‘0000-00-00 00:00:00′,
    `reply_content` text NOT NULL,
    `user_id` bigint(20) NOT NULL default ‘0′,
    PRIMARY KEY (`reply_ID`),
    KEY `comment_ID` (`comment_ID`)
    )

  • Colin on April 22nd, 2008 at 10:36 pm said:

    I’ve encountered something odd on my site. I have no problems replying but for some reason, they don’t appear in the actual pages; however, they do appear in the Admin dashboard.

  • Jessica on April 23rd, 2008 at 5:08 am said:

    Hi Mike, I’ve installed the plugin just as the way you had instructed on the page, and also added to my theme, but now when i reply in other language it only shows question marks? so only english reply can be used?

  • Charles on May 8th, 2008 at 11:14 pm said:

    Mike I tried several places in my header and none seem to work and there are no error messages. I have WP 2.3.3.

    Here is the last place I tried in header.php:

    <a href=”" title=”">

    Am I doing something wrong?
    Thanks.

  • Sheeda on June 4th, 2008 at 2:00 pm said:

    Hey, I installed the plugin. Everything is fine, but when I tried to submit a reply, it returned me a 404 page. The reply was not added. Can you please help? Thanks!

  • mike on June 5th, 2008 at 8:58 am said:

    @Colin, did you add the cr_display_comment_replies($comment) function to your comment loop?

    @Jessica, sorry, we haven’t done any testing with other languages. I’ll look into possibly adding better handling for this in future release.

    @Charles, I’m not sure what you’re putting in the header. Am I missing something?

    @Sheeda, can you tell me what url it is posting to?

Leave a Reply

Latest Comments

andrew:
hey mike -- thanks for the reply, let me clarify what i mean.... I know that PHP fu...

nick:
Hi Jeff, Thanks for the heads up on the link. It's all fixed now and you should...

Jeff:
I would love to try your plugin, but the download link appears to be dead again. Ca...

mike:
@Denise: 1. The image is selected randomly each time the code is run. So normally ...

andrew:
hey -- great plugin and would like to use on several different pages, not just the ...

Categories Archives