| Huvudsidan | Blog | Kontakt | English | Wordpress widget |

 

Widget for Simple Recent Comments

Friday 7th April 2006 (viewed 77772 times)

Cheesus! I was up till 7 am yesterday, playing around with wordpress. It’s like a drug! I spent several hours learning how to make a widget out of the module Simple Recent Comments written by Raoul. He also kindly offered to link to my site if I put up the widget on my homepage.

So here it is! To use it, you have to install the widget-plugin from wordpress.

Requirements: Wordpress 2.x

Here’s how you install it:

  1. Make sure you have the widget-plugin from wordpress installed.
  2. Download the file and unzip it.
  3. Place the widget_simple_recent_comments.php in your wp-content/plugins/widgets directory.
  4. Go to your administration panel and activate the widget.
  5. Go to the widget administration panel in Presentation and drag’n'drop the little rascal onto your sidebar. You can also change the settings for the plugin there.

Simple as that D

UPDATE 2006-05-03: Raoul made some changes to his code to allow the use of non-standard table names for wordpress. I’ve included his fix in version 0.2.1!

UPDATE 2006-05-04: I got a report that an error is returned if there are no comments. Fixed it in version 0.2.2. Thanks to anshul!

UPDATE 2006-09-06: Paul Hampson reported that if the title contained HTML-elements, the html would be displayed in the hover text of the link to the post in the comment. This is fixed in version 0.2.3. Thanks Paul!

File: Widget simple recent comments v0.2.3

Modified: Friday 3rd August 2007

 

43 Comments for “Widget for Simple Recent Comments” »

  1. Modin wrote,

    blonde Soooo this is something you might use if you’re working on your own blog with WordPress?… pope pope pope pope pope

    April 10th 2006 at 22:32 (10:32 pm) — Using Firefox Firefox 1.5.0.1 on Windows Windows XP

  2. Mika Perälä wrote,

    Yes, that is correct! :pom: See my sidebar? It contains different little code snippets, and to make it easier for the user to move them around, a widget system was created. This allows me to drag and drop the desired functions to my sidebar in the admin interface instead of having to change the PHP-code. And what I did was to take an existing plugin for Wordpress and turn it into a widget )

    April 10th 2006 at 23:35 (11:35 pm) — Using Firefox Firefox 1.5.0.1 on Windows Windows XP

  3. anshul wrote,

    There is a bug I did like to report. The plugin gives an error message when there are no comments. A simple fix. Add the following after line 86

    if(!empty($comments))

    Nice widget otherwise!

    May 4th 2006 at 16:46 (4:46 pm) — Using Firefox Firefox 1.5.0.3 on Windows Windows XP

  4. Mika Perälä wrote,

    Ooh! Bad me! d eeg: Thanks D I’ve fixed it now!

    May 4th 2006 at 23:25 (11:25 pm) — Using Firefox Firefox 1.5.0.3 on Windows Windows XP

  5. Paul \\\"TBBle\\\" Hampson wrote,

    The line:

    $output .= \\\"\\n\\tID) . \\\"#comment-\\\" . $comment->comment_ID  .
    \\\"\\\\\" title=\\\\\"on \\\" . $comment->post_title . \\\"\\\\\">\\\" .
    $comment->comment_author . \\\": \\\" . strip_tags($comment->com_excerpt)
    . $dots . \\\"\\\";

    causes a problem with titles containing HTML, in the title element. For posts this is easily fixed by changing the_title to the_title_rss, but I can\\\’t seem to quickly find a similar RSS-ising function for this string pulled from the database…

    June 4th 2006 at 14:17 (2:17 pm) — Using Firefox Firefox 1.5.0.4 on Windows Windows XP

  6. Paul "TBBle" Hampson wrote,

    Ah, got it…

    apply_filters(’the_title_rss’, $text)

    June 4th 2006 at 14:36 (2:36 pm) — Using Firefox Firefox 1.5.0.4 on Windows Windows XP

  7. Milly wrote,

    Hi,

    My admin. panel will only show the widget when I place it in the plugin map, where I can activate it. But there’s no widget panel in Presentation, from where I can drag the thing onto a sidebar.
    Is there another way to get the widget in there ?

    I’m very new to all this, so I need some help. Thanks. -[

    September 2nd 2006 at 23:08 (11:08 pm) — Using Firefox Firefox 1.5.0.6 on Windows Windows 2000

  8. Mika Perälä wrote,

    Hello Milly! Saw your question about the Recent Comments Widget ) I’ve written this reply in your blog too, so others can follow it.

    Have you installed the wordpress Widget Plugin in your wordpress?

    September 7th 2006 at 00:07 (12:07 am) — Using Firefox Firefox 1.5.0.6 on Windows Windows XP

  9. Milly wrote,

    Hi Mika,
    Thanks for your reply, and leaving a message on my weblog. I’ve been reading my head off, these last few days, and have managed to make sense of the dozens of comments and instructions and help-functions everywhere (can one have too much information?), and found out about the widget plugin.
    And it works, as you probably saw.

    I find it quite difficult to find beginnings and ends in the overwhelming amount of information, but I’m glad it’s there; having none is too often the case.
    I’m learning every day, but being “middle aged” makes that not that easy. )
    Thanks again,
    Milly

    September 7th 2006 at 03:38 (3:38 am) — Using Firefox Firefox 1.5.0.6 on Windows Windows 2000

  10. Mika Perälä wrote,

    Ah, yes, saw it, was wondering if it was this plugin D

    Wuhuu! :pom: Congrats to getting it to work! Yeah, it’s not easy if you’ve not done it for years before. I’m lucky to be ‘only’ 32, and have many years of working with computers behind me.

    It seems you’re making a lot of headway into the cyberspace! Good luck I say in the future, and if you have any troubles with my plugin, just write )

    September 7th 2006 at 03:52 (3:52 am) — Using Firefox Firefox 1.5.0.6 on Windows Windows XP

  11. Milly wrote,

    ) @Mika,

    Thanks. No, I wasn’t using your plugin at that time. Am now.
    Could do with some examples of codes to pre/append, because I have no idea what to use that for. blonde

    September 11th 2006 at 03:00 (3:00 am) — Using Firefox Firefox 1.5.0.6 on Windows Windows 2000

  12. Mika Perälä wrote,

    I don’t use it myself ) It’s there just as an option if someone would like to use it somehow. But code could be a title to prepend or special HTML you want to add before or after the list.

    September 12th 2006 at 16:22 (4:22 pm) — Using Firefox Firefox 1.5.0.6 on Windows Windows XP

  13. Dana wrote,

    Wow! I totally love this widget! Thank you so much for making it.

    I am using the Sandbox theme with the sidebar links similar to the ones in the Simplr theme, so when I first installed the widget it looked really funny. I played around with the plugin code and figured out how to make it look pretty, so now I am completely thrilled.

    Thanks again!

    September 19th 2006 at 19:01 (7:01 pm) — Using Firefox Firefox 1.5.0.7 on Windows Windows XP

  14. Mika Perälä wrote,

    Hehe! Glad you have use of it! :pom:

    Oh, haven’t looked at how it works in the different themse. I’m guessing the themes rely on a certain markup for their CSS-files to work properly, and you had to change some of the HTML-code to reflect that?

    September 20th 2006 at 09:32 (9:32 am) — Using Firefox Firefox 1.5.0.7 on Windows Windows XP

  15. James wrote,

    Would like to request limiting the number of characters for the title… it seems to break my widgets in IE

    September 25th 2006 at 13:15 (1:15 pm) — Using Internet Explorer Internet Explorer 6.0 on Windows Windows XP

  16. Jared E. wrote,

    Hi, the widget is great. I just have one question. Is a control form suppose to come up so that options can be chosen? In the code it says:

    // This registers our optional widget control form. Because of this
    // our widget will have a button that reveals a 520×480 pixel form.
    register_widget_control(’Simple Recent Comments’, ‘widget_simple_recent_comments_control’, 520, 480);

    How do you make so that this control form comes up?

    September 28th 2006 at 00:30 (12:30 am) — Using Firefox Firefox 1.5.0.7 on Windows Windows XP

  17. Mika Perälä wrote,

    It comes up in the widget panel, in your admin interface->Presentation->Sidebar widget.

    Hope this helps ya!

    September 28th 2006 at 08:37 (8:37 am) — Using Firefox Firefox 1.5.0.7 on Windows Windows XP

  18. Bittabola wrote,

    Hmmm, where’s my comment I left yesterday?.. ???

    October 1st 2006 at 12:16 (12:16 pm) — Using Firefox Firefox 1.5.0.7 on Windows Windows XP

  19. Mika Perälä wrote,

    Very strange! I have it in my inbox in my mail, but I cant see it in my admin interface. I’ll take a look at it later, your problem that is )

    October 1st 2006 at 15:41 (3:41 pm) — Using Firefox Firefox 1.5.0.7 on Windows Windows XP

  20. Jared E. wrote,

    The control doesn’t come up where you said it should. All that comes up is the standard drag-and-drop stuff. Nothing allowing me to control the specifics of the Recent Comments widget.

    October 9th 2006 at 01:28 (1:28 am) — Using Firefox Firefox 1.5.0.7 on Windows Windows XP

  21. Mika Perälä wrote,

    Are you able to modify the settings of the other widgets in the widget control panel? By pressing the little icon at the right side of the widget-thingie you should get up the control panel. Otherwise I would suspect a popup-blocker… are you running the installation on your own computer?

    October 9th 2006 at 14:46 (2:46 pm) — Using Firefox Firefox 1.5.0.1 on Windows Windows XP

  22. Torley wrote,

    Very kewl! I want to check this out for myself. And I like this smiley bar too, how did you do this? )

    November 4th 2006 at 13:03 (1:03 pm) — Using Firefox Firefox 2.0 on Windows Windows XP

  23. Mika Perälä wrote,

    Heya Torley ) Nice that you like it!

    The smileybar is from the plugin More Smilies, and the Smilies I’ve collected from various sites )

    November 5th 2006 at 19:32 (7:32 pm) — Using Firefox Firefox 1.5.0.7 on Windows Windows XP

  24. Torley wrote,

    Great! And now I know! )

    November 5th 2006 at 22:42 (10:42 pm) — Using Firefox Firefox 2.0 on Windows Windows XP

  25. Greg Laden wrote,

    How come almost every posting (in a blog, etc.) that provides a sidebar widget (and access to download, etc.) fails to have that self same widget deployed on that page? Has anyone else noticed this?

    The present posting seems to be an example of this. The author (in the second comment above) mentions “my sidebar” but hey, I don’t see a sidebard! How do I know this sidebar widget didn’t break the sidebar?!?

    Let’s see the widgets in action! (I’m not picking on this site … this phenomenon seems almost universal!)

    February 26th 2007 at 22:12 (10:12 pm) — Using Firefox Firefox 2.0.0.1 on Ubuntu Linux Ubuntu Linux

  26. Mika Perälä wrote,

    Heya Greg! Oh, I do use it on my own blog. It’s just that this is a post-page, which only shows the post, not the sidebar. This is a very common way to show Wordpress-blogs. You have a frontpage of the blog where you have your recent posts, and if you click on a post, you get a single-page with the post in. And in that single-page there is no sidebar.

    Could this be why you have encountered this phenomenon often?

    If you take a look at my frontblogpage:

    http://mika.kfib.org/wordpress/

    you will see the widget in action )

    February 27th 2007 at 00:13 (12:13 am) — Using Firefox Firefox 2.0.0.2 on Windows Windows XP

  27. deko wrote,

    hi, is it possible to list random comments instead of recent?

    thanks

    March 29th 2007 at 08:47 (8:47 am) — Using Firefox Firefox 2.0.0.3 on Windows Windows XP

  28. Mika Perälä wrote,

    Heya deko! No, sorry, that is beyond the scope of this little widget… blonde

    March 31st 2007 at 02:47 (2:47 am) — Using Firefox Firefox 2.0.0.3 on Windows Windows XP

  29. Philip Jägenstedt wrote,

    I was already using the simple recent comments plugin on my blog, was I surprised that it was Mika-sama himself who widgetized it. I’m having some problems though, which basically stem from the mysql database being in latin-1 but storing utf8-data, which means that incomplete characters might get pulled from the database… Trying to find a solution right now.

    May 2nd 2007 at 13:38 (1:38 pm) — Using Opera Opera 9.20 on Linux Linux

  30. Mika Perälä wrote,

    *bow bow* :pom: Did you manage to fix the problem?

    May 11th 2007 at 10:16 (10:16 am) — Using Firefox Firefox 2.0.0.3 on Windows Windows XP

  31. mirek wrote,

    Your plugin is wonderful, thank you very much!

    July 28th 2007 at 00:00 (12:00 am) — Using Firefox Firefox 2.0.0.5 on Windows Windows XP

  32. Mika Perälä wrote,

    Well, thank you! Thank’s a lot for the praise! cheer

    July 31st 2007 at 13:37 (1:37 pm) — Using Firefox Firefox 2.0.0.6 on Windows Windows XP

  33. Matthew Bennett wrote,

    Well that seems to be very simple and easy to use, just what I was looking for. Working nicely with wp 2.2. Thank you very much.

    August 13th 2007 at 16:09 (4:09 pm) — Using Firefox Firefox 2.0.0.6 on Windows Windows XP

  34. Mika Perälä wrote,

    Hello Matthew! wave Glad to hear it worked for you too ) I think I’ll have to revise the install instructions for 2.2, not sure if I have to, but since they’ve incorporated the Widget-plugin into Wordpress, I might.

    August 14th 2007 at 11:53 (11:53 am) — Using Firefox Firefox 2.0.0.6 on Windows Windows XP

  35. Easyfunk wrote,

    Thanks a lot! wave

    August 20th 2007 at 12:16 (12:16 pm) — Using Firefox Firefox 2.0.0.6 on Ubuntu Linux Ubuntu Linux

  36. Mika Perälä wrote,

    You’re most welcome )

    August 20th 2007 at 13:38 (1:38 pm) — Using Firefox Firefox 2.0.0.6 on Windows Windows XP

  37. Nin wrote,

    Marvellous! I’m working it into a footer of my new blog design, thanks!

    September 19th 2007 at 18:28 (6:28 pm) — Using Firefox Firefox 2.0.0.6 on Mac OS Mac OS X

  38. Jeff wrote,

    Wonderful lil’ widget! I tried 4 other ‘Recent Comment’ ones and was getting frustrated. Yours worked perfect and was exactly what I was looking for! Great job!

    March 2nd 2008 at 17:31 (5:31 pm) — Using Internet Explorer Internet Explorer 7.0 on Windows Windows XP

  39. PrincessPea wrote,

    Hi! I love your widget. As a baby blogger, can you help me with customising the layout? I want to have a space between each comment to make them easier to read. I have a self hosted wordpress blog.
    Many thanks.

    May 13th 2008 at 10:36 (10:36 am) — Using Internet Explorer Internet Explorer 7.0 on Windows Windows XP

  40. Roland Kopp-Wichmann wrote,

    Hi, thanks for the nice plugin.
    Question: how can I hide my own comments?
    Is that possible?

    July 20th 2008 at 08:10 (8:10 am) — Using Firefox Firefox 3.0.1 on Windows Windows XP

  41. Mika Perälä wrote,

    Hi Roland. No, unfortunately there is no such setting. I might incorporate it, if you really want it? )

    July 21st 2008 at 15:34 (3:34 pm) — Using Firefox Firefox 3.0.1 on Windows Windows XP

  42. Lars wrote,

    Hi Mika

    Is it possible to change the code of the widget, so it displays:

    1. Recent comments together with the post title?
    2. Number of comments to the post - fx (7)?
    3. No names/links of commenters?
    4. No excerpts from the comments?

    Like this:

    ‘Post title1′ (11)
    ————
    ‘Post title2′ (3)
    ————
    ‘Post title3 (6)

    eg.

    Best, Lars

    August 8th 2008 at 03:05 (3:05 am) — Using Safari Safari 525.21 on MacOS MacOS X

  43. Mika Perälä wrote,

    Heya Lars! You mean something like ‘Unread comments’ as the one I have in my sidebar?

    August 12th 2008 at 00:25 (12:25 am) — Using Firefox Firefox 3.0.1 on Windows Windows XP

 

10 Track-/Pingbacks for “Widget for Simple Recent Comments” »

  1. Site/Page: Simple-Recent-Comments WordPress Plugin

    [...] Mika Perälä has taken the time to make a sidebar widget out of this small plugin. Go grab it while it’s still hot! [...]

    April 7th 2006 at 03:13 (3:13 am)

  2. Site/Page: Script Artists » Archiv » Wordpress: Anzeige der letzten Kommentare

    [...] Die bekanntesten Plugins sind Recent Comments von MtDewVirus, Recent Comments von “Bitte keine heiße Asche einwerfen”, Simple-Recent-Comments, von dem ebenso eine widgetsfähige Version existiert, und Brians Latest Comments. [...]

    May 10th 2006 at 10:53 (10:53 am)

  3. Site/Page: KrainaMarzen.pl » SuperWordPress! - Najlepsze dodatki

    [...] Simple Recent Comments Widget [...]

    November 19th 2006 at 16:38 (4:38 pm)

  4. Site/Page: myonの‘今日も今日とて’

    Widget for Simple Recent Comments

     デフォルトのRecentCommentsではいささか味気ないので,何か別のものをとあちこち物色しておりました.目にとまったのが,Widget for Simple Recent Comments.これは,Simple-Recent-CommentsをWidget化し…

    December 18th 2006 at 23:06 (11:06 pm)

  5. Site/Page: Lo mejor de WordPress 2 son los widgets | DigiZen: Un blogfesor aprendiendo

    [...] 6. Simple Recent Comments: Para incluir los comentarios recientes [...]

    January 5th 2007 at 05:32 (5:32 am)

  6. Site/Page: » Upgraded to WordPress 2.1 Ella - Sofie Estolloso Hofmann Designs International - Weggis, Switzerland

    [...] Akismet Plugin by Matt Mullenweg, WP-PostViews by GaMerZ, Post Updated by Kaf Oseo, Peter’s Custom Anti-Spam by Peter Keung, Sidebar Widgets by Automattic, Simple Recent Comments Widget by Mika Perälä, randomimage by Justin Watt, Filosofo Home-Page Control by Austin Matzko. No problem with all these WordPress Plugins. [...]

    January 27th 2007 at 12:27 (12:27 pm)

  7. Site/Page: Digital Photography Blogs - j david macor.com - Blog Archive » This is a test post for Recent

    [...] Perälä has taken the time to make a sidebar widget out of this small plugin. Go grab it while it’s still hot! Excellent [...]

    May 1st 2007 at 01:56 (1:56 am)

  8. Site/Page: NG Life » Blog Archive » Simple Recent Comments

    [...] 作者網頁與檔案下載 [...]

    April 28th 2008 at 08:45 (8:45 am)

  9. Site/Page: WordPress theme - DarkMind 0.1 » .::: November ::: 拾壹 :::.

    [...] 發現是WordPress內建的Recent Comments Widget有問題,換了這個就好了,設定選項還更多。 5. [...]

    May 1st 2008 at 00:19 (12:19 am)

  10. Site/Page: BLOG » Upgraded to WordPress 2.5.1 » Sofie Estolloso Hofmann Designs International - Weggis, Switzerland

    [...] Example: There is a new version of Simple Recent Comments Widget available. Download version 1.2.1.20070210b here or upgrade [...]

    May 29th 2008 at 15:23 (3:23 pm)

Leave a comment

know shoot content spite spank hypo fight rool blow starwars roll ninja console smack ( pope nopom X * ??? -d -[ whip 8-) blonde -) -) zzz -O ) cheer love knupple hystery hug wave