Author Comment Reply Plugin ver. 1.04
About
We 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
- Note: The Image-Rotator Plugin requires WordPress 2.3 or greater
- Upload the Author Comment Reply plugin to your plug-ins directory, usually wp-content/plugins to create a wp-content/plugins/comment-replies/ directory.
- Activate the plug-in through the Plug-ins admin screen.
Adding to a Theme
-
Open the theme's comment file, usually
wp-content/themes/<THEME NAME>/comments.php -
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); } ?>
- 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:
- Open the comment-replies.php file.
- Find the line:
define("CURRENT_AUTH_MODE", DEFAULT_AUTH_MODE);
- 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.

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 »
Hi There,
Is there a way to get the replies to appear in the comment feed?
Cheers!
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.
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?
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.
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.
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?
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.
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.
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
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.
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.
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
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.
Ah that did indeed fix it! Thank you very much
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.
@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/
Delayed response — I’m an idiot and missed that option page.
This is awesome. thanks!
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.
Is anyone able to get this to work with Wordpress 2.5?
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
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.
The new 2.5 compatible version is up. Let us know if you run into any problems.
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.”
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.
does this plugin support any “comments to e-mail” plugin, for ex. subscribe to comments?
so does this plugin allow sending replies to suscribers ?
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
argh, sorry, how can I post code snippets?
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`)
)
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.
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?
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.
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!
@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?