Have you ever had a lot of comments on a blog post and had trouble following the conversation? Now you can have no trouble at all, with my new Wordpress Plugin – Comment Connection.
Comment Connection is a simple plugin that detects the @commenter reference in a comment and turns that name into a link to a previous comment. An example can be seen on this post. It works by filtering comments when they are printed, then retrieves the comment ID of the last comment made by the person being referenced. There is no modification necessary to make it work, and it will work with previous comments as well.
It has been tested with the most recent version of Wordpress, 2.7. If you have problems with an earlier version, or even if it works properly, please contact me or post a comment.
Usage
Inside a comment, write @commenter where commenter is the name of the author you are replying to, followed by a line break, colon, comma and now a dash.
Download latest version of Comment Connection
Installation
- Copy the folder comment-connection to your Wordpress plugin folder (usually wp-content/plugins).
- Open the Wordpress Admin Panel and activate plugin.
Limitations
- Commenter reference must be an exact match of the original author’s name.
- One database query for every comment with a reference.
- Only links to the last comment made by the author before the current comment.
- Author name cannot contain more than 2 spaces.
FAQ
What is the purpose of this plugin?
Comment Connection allows you to follow conversations that take place in post comments by linking them together automatically.
What symbol triggers the response?
Since version 1.1, both a new line and : activate the plugin.
Will the plugin work if I use a different case?
Yes. Comment Connection will still find the reference if the case is different. Ex. @john smith: will reference the comment by John Smith.
Changelog
v1.0 –– May 1, 2008
* Initial release
v1.1 –– May 1, 2008
* Added support for using : on the references
* Optimized code to limit the database queries to 1 per comment with a reference
v1.2 –– May 1, 2008
* removed the need for PHP buffer
v1.3 –– May 3, 2008
* changes mode of reference detection
* processes comments with multiple references
v1.4 — May 19, 2008
* update readme file
v1.5 — May 22, 2008
* Added support for comma activation
v1.5.1 — July 28, 2008
* Cleaned up code and readme file
v1.6 — January 6, 2009
* Updated for WordPress 2.7
* Added dash separator

22 responses so far ↓
1 wesg // Apr 22, 2008 at 10:15 am
Sample comment 1
2 wesg // Apr 22, 2008 at 10:15 am
@wesg
Sample response
3 impropio // May 1, 2008 at 10:37 am
Test!
4 Dave M. // May 1, 2008 at 11:19 am
@wesg: So what happens when there are two comments by the same author? How does it know which one to link to? I’m guessing it doesn’t.
5 Dave M. // May 1, 2008 at 11:21 am
@wesg
So I also have to use a line break to separate the reply name from the rest of the comment. Why is this? Something to do with the code that is used to find the at symbol followed by the name? Hmmm.
6 wesg // May 1, 2008 at 11:24 am
@Dave M.
At this point the plugin always links to the last comment made before your post. So for example in your comment you say @wesg, you’ll notice that the comment it links to is the last comment I made before yours.
And yes, right now it uses a line break to find the comments. I hope in the next version, I will be able to add : support as well.
7 wesg // May 1, 2008 at 9:56 pm
@impropio: Sample response 2, using version 1.2
8 Christopher // May 2, 2008 at 12:32 am
@wesg:
I quite like this plugin, however, there is one small caveat: The replace function replaces *any* ocurance of the author’s name with a link, not just the first ocurance. Something like
str_ireplace("@".$author, '@' . $author . '', $comment)works much better.9 Trisha Cupra // May 2, 2008 at 3:24 am
@wesg: I have WP 2.5.1 installed, and I’m only getting the first @commenter being linked when I have two @commenters (new paragraph for second one) in one comment.
@Dave M.: Just testing to see what happens here…
10 Trisha Cupra // May 2, 2008 at 5:12 am
I should have said @wesg and @Dave M.
11 Trisha Cupra // May 4, 2008 at 12:42 am
Wow, you fixed it with the update. Wonderful! Thanks.
12 Elliott Cost // May 14, 2008 at 6:00 pm
Pretty cool plugin. Nice job!
13 willy // May 22, 2008 at 1:01 am
@Elliott Cost test
14 wesg // May 22, 2008 at 6:48 am
@willy, there needs to be something after the text to activate the plugin. Though you will notice on my comment that I have added comma support.
15 phalkunz // May 27, 2008 at 6:03 am
@wesg: i find this plugin really cool. I never thought of something like. Great job!
16 Paradox // Jul 24, 2008 at 10:16 pm
Hey, one annoying typo.
In the code, at line 67, you said “str_ireplace”.
If a user doesn’t know how to edit this, they may take the errors they will get at face value, and not do anything about it.
I just remove the i, and it works, but some people, even that is too much.
17 wesg // Jul 24, 2008 at 10:45 pm
@paradox
Thanks for pointing that out, but that extra i is key to making the plugin work. You’ll notice in my response that Paradox isn’t capitalized, but the replacement still works. Without the i —
str_replace— the plugin doesn’t replace words that aren’t the same case.For more information, visit http://php.mirror.camelnetwork.com/manual/en/function.str-ireplace.php
18 meohmy // Dec 15, 2008 at 9:54 pm
Cool concept, gonna test it out… thanks!
@Trisha Cupra: testing…
19 wesg // Dec 16, 2008 at 12:49 am
@meohmy: Thanks for the comment. I edited it slightly because what you had written wouldn’t trigger the response. Since some names have spaces in them, the plugin looks for a character following your reference (in my case, a colon). With no character following your comment, it would not make the change.
20 Eric // Jan 10, 2009 at 11:42 am
@wesg: Great !
Edited by Wes to include an @:D
21 test // Apr 27, 2009 at 4:35 am
@wesg
Ye that seems cool
22 mk // Jan 28, 2010 at 10:23 pm
This works with tons of WP versions, just not 2.9.1
Leave a Comment