My First WordPress Plugin - Recent Comments
Filed in: WordPress, WordPress Plugins — January 4th, 2005My recent comment plugin display in format of nickname @ post title. ‘Nickname’ will be linked to comment author’s website(if submited), ‘post title’ will be linked to the comment’s permalink, AND mouseover it to preview the comment text!
Updated (2005-04-22): This script works on Wordpress 1.5!
Not really my original work… I have forgotten the orginal author name. The script is using in previous version of WordPress where no plugin support(put in my-hacks.php). I modified it to have my own style of displaying recent comments.
Now I upgraded to WordPRess 1.2.2 (works in WP1.5), I think it is time to dump the old my-hack.php and use only Plugin. I need to convert the script into a WordPress plugin…
Well, it is much simpler than I thought. In fact, no need to modify single bit of the code. I just add some plugin comments and save the file as lcf_recent_comment.php. ![]()
Dump the file into my wordpress plugin folder, then goto “Plugins” under WordPress Admin, and my plugin is listed there! Activate it, and add lcf_get_recent_comments(); php function(don’t complain about the function name, initially it is MY function. :P) into template. Done!
If you like the recent comment list in my blog(see it?), you can download here.
Hope you like it! Any feedback is welcome!
Popularity: 2% [?]
Free AntiVirus!
Comments Feed
TrackBack URL



March 14th, 2005 at 11:37 am
thanks for the plugin, works great!
June 1st, 2005 at 6:53 am
I would love to have the ability to truncate the topic title to an ellipsis if it is longer than x characters.
For example:
Commenter @ This is a really long…
June 18th, 2005 at 10:00 pm
I have installed your plugin, but have some problems.
I want only the first 10-15 words of the comment shown so I have added this:
‘, true) ?>
but the complete comment is shown. what is wrong?
regards
June 18th, 2005 at 10:02 pm
sorry the line didn’t show correct
lcf_get_recent_comments(10, 25, ”, ”, true)
June 19th, 2005 at 5:58 pm
found the bug/error
Line 41 in lcf_get_recent_comments.php where output is defined:
replace “$comment_content” with “$comment_excerpt”
June 23rd, 2005 at 5:10 pm
Jeeeeeeeeeeeeeeezuz! Been looking for that like a mad man! Great work! You’re on my “Acknowledgments” roll!
June 23rd, 2005 at 5:35 pm
@Sylvain: glad that you like it too.
June 30th, 2005 at 1:03 am
[...] ess blog. The priority of a post depends on its comments. More comments, higher priority! RECENT COMMENTS- As what it is called. This plugin [...]
November 13th, 2005 at 9:12 pm
Been searching the last hour for the perfect comment plugin and i found it here.. thanks LCF. you rock.
November 27th, 2005 at 12:13 pm
Hey LcF:
Fantastic plugin. I spent a good two hours looking for a tool that would allow me to do exactly what yours does. After I had nearly given up all hope…I found you. Many, many thanks.
I’d like to make a slight modification, if it doesn’t offend, but don’t know how. Perhaps you can help?
I don’t want the comment author’s to link to their url in the menu (it will still be linked from the comment itself). How do I adjust to code so only the comment title itself is a hotlink, not the author’s name?
Also, I attempted to change the number of comments listed (from 5 to 7) and it generate a host of error messages from wordpress about the header already being generated.
I’m a complete novice when it comes to this stuff, so any assistance you can offer will be greatly appreciated.
Jacqui
December 23rd, 2005 at 11:00 pm
Lcf,
Thanks your plug-in
It is nice ^___^
January 3rd, 2006 at 1:16 pm
good if you could add a gravatar beside the commenter!
January 3rd, 2006 at 1:35 pm
thank you for the suggestion, stchatterbox.
January 7th, 2006 at 4:51 pm
Your plugin is great. Works perfect on Wordpress 2.0 too.
Thanks.
January 9th, 2006 at 5:38 pm
Hey LcF,
Thanks for this plugin. I have a question: Is there a way to list also the comments made on pages (I have for example a Guest Book with a template that makes use of the same comment-code as the normal post-pages)? At this moment only comments made on posts are listed.
Rado
January 24th, 2006 at 9:34 pm
hi your plugin is very useful. but i want to prevent seek website name. what can i do?
April 21st, 2006 at 11:44 am
hello LcF,
Is this plugin compatible iwth wp 2? thanks.
April 21st, 2006 at 1:34 pm
Yes, the plugin should works with WordPress 1.5 and above.
June 22nd, 2006 at 12:29 am
Nice plugin! Will implement it soon! Thanks for your contributions!
June 22nd, 2006 at 6:01 am
Fantastic! Works like a charm. FYI for whom need the exact code to add to your sidebar, here ya go:
[Note: Code is ripped automatically by WordPress... ]
Add the above to top and bottom portions of code in the sidebar.
October 14th, 2006 at 2:40 pm
[...] LCF Recent Comments [...]
December 17th, 2006 at 9:58 am
Personally, I just dont git. how couple most people not understand all of this? Anyway. My 2pennies : )
Jonna
December 20th, 2006 at 11:16 pm
Nice - thanks
December 26th, 2006 at 3:28 am
Thanksssssssssssssssss a lot man
I love the simplicity of your plugin, I only need 2 thing for the recent comment: author + topic link; and your plugin provided it, simple and yet effective.
Just one small thing to point out, sometimes the author is “Anonymous”, your plugin will show “” (blank) in the author name, I modified it a liite bit to show “Anonymous” instead of blank name
Maybe you want to consider it to update the plugin. Otherwise, it’s PERFECT
Thanks again, and Happy new Year
February 13th, 2007 at 4:11 pm
Thanks for the nifty plugin, it is running perfectly in my website. I also modified the code to display Anonymous just like what Quang MIngh suggested :
“if ($comment->comment_author != “”){
$comment_author = stripslashes($comment->comment_author);
}
else {$comment_author=’Anonymous’;}”
February 17th, 2007 at 6:13 pm
Hi, Thanks Liew for the plugin. I have it up and running on my blog. Marcela, I’m using WordPress 2.1, so it should be no problem with WordPress 2.0.
March 6th, 2007 at 2:09 am
[...] Recent Comments - shows recent comments with link back to commenter’s site and link to comment (by Liew Cheon Fong and available on his blog) [...]
March 7th, 2007 at 1:21 pm
This nice is very good, i will recomend it to my friends and partners
March 15th, 2007 at 9:44 pm
[...] Recent Comments - shows recent comments with link back to commenter’s site and link to comment (by Liew Cheon Fong and available on his blog) [...]
September 15th, 2007 at 11:00 pm
Line 41 in lcf_get_recent_comments.php where output is defined:
replace “$comment_content” with “$comment_excerpt”
need helppp