My First WordPress Plugin – Recent Comments

Filed in: WordPress, WordPress Plugins — January 4th, 2005
Intro LcF’s Recent Comments: I don’t understand why people like to have recent comments shows the comment text instead of the post title.

My 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!

Like this post? Please share:

Follow @liewcf on Twitter; Join Facebook page; Subscribe to free newsletter for updates like this article..

  • http://www.james35.info/ Jonna

    Personally, I just dont git. how couple most people not understand all of this? Anyway. My 2pennies : )

    Jonna

  • http://www.james35.info/ Jonna

    Personally, I just dont git. how couple most people not understand all of this? Anyway. My 2pennies : )

    Jonna

  • http://www.gbmini.net/ Ian C.

    Nice – thanks :)

  • http://www.gbmini.net/ Ian C.

    Nice – thanks :)

  • http://www.gbmini.net Ian C.

    Nice – thanks :)

  • http://www.icouple.sg/ Quang Minh

    Thanksssssssssssssssss a lot man :D
    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 :D Maybe you want to consider it to update the plugin. Otherwise, it’s PERFECT :)

    Thanks again, and Happy new Year :)

  • http://www.icouple.sg Quang Minh

    Thanksssssssssssssssss a lot man :D
    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 :D Maybe you want to consider it to update the plugin. Otherwise, it’s PERFECT :)

    Thanks again, and Happy new Year :)

  • http://www.pointnclickgames.com/ Sherly

    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’;}”

  • http://www.pointnclickgames.com Sherly

    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’;}”

  • http://blogging.isgreat.org/ alex

    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. ;-)

  • http://blogging.isgreat.org alex

    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. ;-)

  • Pingback: 10 Essential Plug-ins for WordPress version 2.1 : www.Recruiting-USA.com

  • Maryland

    This nice is very good, i will recomend it to my friends and partners

  • Maryland

    This nice is very good, i will recomend it to my friends and partners

  • Pingback: 10 Essential Plug-ins for WordPress Version 2.1 - Meta Tags : www.Recruiting-USA.com

  • http://mp3players2.com/ Tom

    Line 41 in lcf_get_recent_comments.php where output is defined:

    replace “$comment_content” with “$comment_excerpt”
    need helppp

  • http://mp3players2.com Tom

    Line 41 in lcf_get_recent_comments.php where output is defined:

    replace “$comment_content” with “$comment_excerpt”
    need helppp

t