scriptygoddess

08 Jul, 2004

Recent Commenters and Commented on posts

Posted by: Jennifer In: WordPress Plugins

UPDATE There's been a bit of debate about the need for a central database of plugins. There's a lot of developers now developing plugins, and it's quite a task to find them as a user, as well as a developer to see if something you want to do has already been done. In any case – this plugin has apparently already been done by coffee2code.com (with only some minimal differences).

I'll leave my post up in case it's still of value to anyone….

Christine asked for a plugin so that she could have a list of recent commenters on her blog (and the list needed to exclude herself) – as well, she wanted a way to show the posts that have been commented on most recently. While the two requests are different, I still put them in one plugin. (I want to note that this plugin was based heavily on the recent comments plugin by mtdewvirus.com)

Current Version: v 1.0

So here's the plugin – installation and use are pretty simple:

1) Download and install this plugin (right-click save as.. with a .php extension) – upload to your wordpress plugins folder (wp-content/plugins/ ). Activate through the admin interface.
IMPORTANT NOTE ABOUT DOWNLOAD: Make sure you do NOT have any extra spaces after the last ?> in your copy of the file. Extra spaces will give you various "header already sent" type errors.

2) This plugin has the two following functions:

get_recent_commenters();
get_recent_commented_on();

Here are how the functions are described in the plugin (which shows you the paramaters you can pass, and what their defaults are)

get_recent_commenters($no_commenters = 5, $before = '<li>', $after = '</li>', $exclude_emails = ")
get_recent_commented_on ($no_posts = 5, $before = '<li>', $after = '</li>', $show_pass_post = false)

So just to explain, for get_recent_commenters() the parameters you can pass are:

-Number of commenters to display (this list will not show duplicates, and will be a link to the commenters blog – if they've entered on in the comment form). Default is 5

-HTML/Text to display before each commenter

-HTML/Text to display after each commenter

-Exclude emails. You can actually put a LIST of emails here, seperated by a single space, of emails of those commenters you want excluded from the list. So you can put yourself in there, and anyone else who doesn't want their name showing up. If it's just you, just put your email in there with no spaces around it.

Here's an example use

<?php get_recent_commenters(10, ", '<br />', 'me@example.com'); ?>

For get_recent_commented_on() the parameters you can pass are:

-Number of posts to display (this list will not show duplicates and will be a link to the post)

-HTML/Text to display before each post link

-HTML/Text to display after each post link

-True/False if you want to include password protected posts. (default is false – do not include password protected posts)

Here's an example use

<?php get_recent_commented_on (10, ", '<br />', false); ?>

26 Responses to "Recent Commenters and Commented on posts"

1 | WordPress:SOMY.JP 最近のコメント

December 2nd, 2004 at 7:37 am

Avatar

[…] 2004/12/2 Thursday 最近のコメント Filed under: [WordPress] – けい @ 16:37 http://www.scriptygoddess.com/archives/2004/07/08/recent-commenters-and-commented-on-posts/#more-1304 コメã […]

2 | Carthik

July 8th, 2004 at 10:13 pm

Avatar

Sounds a lot like The Recent Commenters Plugin which does what Christine wanted.

3 | Jennifer

July 8th, 2004 at 10:16 pm

Avatar

Very cool that you combined these two functions into one plugin!

you might be interested to know, too, that Coffee2code.com developed a similar plugin–and at my request yesterday, allowed the function of last commenter on X number of posts.

4 | Jennifer

July 8th, 2004 at 10:17 pm

Avatar

Yes it would… More arguments for why we need a central database for plugins. I couldn't find anything when she asked me about it. :)

5 | Jennifer

July 8th, 2004 at 10:19 pm

Avatar

Ah, Carthik beat me to it! Actually, in the WP Support forum I saw Christine make a comment about how she wished she could do her linky love, and Scott of Coffee2code responded that he had made such a code. I guess she didn't read it and went to one of the other experts. :)

6 | Jennifer

July 8th, 2004 at 10:19 pm

Avatar

Actually – i think the only difference is that mine allows you to have it exclude an email address. Certainly not worth the effort of having written a completely sepearate plugin – but oh well. Again – a central database for plugins/hacks (like mt-plugins.org) would come in very handy. :(

7 | Jennifer

July 8th, 2004 at 10:30 pm

Avatar

Well – as far as I can tell – at least the list of posts most recently commented on" is still useful. I do wish she would have told me that she had someone else working on it too :( (I had this plugin ready to go a few days ago – and thought it was really weird that his release date was yesterday – basically that we were coding the same plugin at the same time… now it makes sense)

8 | Jennifer

July 8th, 2004 at 10:59 pm

Avatar

I agree–we need a central database! It is a little hard to find all the plugins….I usually make a daily rounds of several places–Kitten's Plugins, Weblogtoolscollection, WP Plugins page, the WP Forums under plugin section, and of course YOU!

I do think your exclude by email is pretty neat–maybe your plugin and his can be combined into one super-powerful one? You did both get your inspiration from mtdewvirus and Christine!

9 | Scott

July 8th, 2004 at 11:57 pm

Avatar

Hi, Jennifer! I had actually seen the request for a Recent Commenters plugin as I was posting about my Recently Commented Posts plugin. Since I had that stepping stone, it didn't take much to implement the request.

Today I merged the aforementioned Recent Commenters plugin into the Top/Recent Commenters plugin (which either outputs a list of the top commenters (with comment count) for current post (if inside "the loop") or for the entire blog (if outside "the loop") -OR- the most recent commenters for post/site.

I added an in-function configuration option to exclude someone from the list, but only when doing 'top' and not 'recent', though it could trivially be tweaked to do either.

Alas, I was slow in posting to the wiki (which has been acting wonky lately), so I may not have done enough to get the word out. Apologies…

10 | Carthik

July 9th, 2004 at 1:15 am

Avatar

I have a neat idea for a domain name, a design(the how) plotted in my mind, but I don't have the time to struggle with the design(the css) and layout right now. I guess in a week or two, I should have a "central" plugin site that should serve WP users' purposes just fine.
If only I could build good looking sites !!

11 | Greg

July 9th, 2004 at 1:41 am

Avatar

Does this allow me to exclude a category (ie: cat= -1) or limit to one category, group of categories (ie: cat=1 or cat=1,3,5). I really need to limit the recently commented to certain categories in my weblog. So far I haven't found a solution. Thanks.

12 | elaine

July 15th, 2004 at 6:44 am

Avatar

it's duplicating the last commented posts for me… anyone else having this error ?¿

13 | Christine

July 16th, 2004 at 2:35 am

Avatar

Actually, I didn't know I had anyone else working on it. I tried the plugin that existed, it didn't do what I needed, and I talked to you about how I wished it worked like mine used to work. I couldn't find any way to contact the owner of Coffee2Code when I saw the other plugin – matter of fact, I think that was why I posted on the forums because I had no other option for contact.

I have only read about the other plugin, but yours still works differently. (I think.)

I just wish that the WP forum sent out notifications when new posts were made on topics you have commented on. It makes it very difficult to follow threads of interest.

14 | Christine

July 16th, 2004 at 2:39 am

Avatar

Key difference? Yours only lists a person one time. It also shouldn't list people that don't have a URL. (I still haven't tested the other one since yours works perfectly.)

15 | martha

July 16th, 2004 at 10:53 am

Avatar

I'm excited about this plug-in – downloaded, uploaded and attempted to activate it. However, when I activated it and then tried to view my site I got a blank screen with the message "Access denied"

Help? I'm sure there's something simple that I'm not doing but I can't figure it out.

16 | martha

July 16th, 2004 at 11:00 am

Avatar

just wanted to add that I'm keeping fooling around with it and I know that the guidelines say not to implement code if you don't know what you're doing… I'll figure it out eventually I'm sure. Just thought there might be a quick and easy answer… (Don't want to ruffle any feathers since I love this site even though I don't understand it all.)

17 | Christine

July 16th, 2004 at 10:33 pm

Avatar

I just discovered a potential bug. Donna of deliriouscool.org left a comment earlier today, but her link didn't show up on the sidebar like they normally do. She left out the e-mail address, so the plugin didn't list it. Any way to fix that glitch?

18 | Jennifer

July 17th, 2004 at 3:17 pm

Avatar

Actually it WILL list people even if they don't give a URL. At least that's the way I designed it.

As for the bugs – I can't duplicate them – so if people are still having problems please email me and we'll try to figure out what's going on:
scripty AT scriptygoddess DOT com

19 | Sherri

July 17th, 2004 at 3:37 pm

Avatar

How do I make the code to look like YOUR recent comments:

Someone said: yada yada (link)

So far, I've just been able to show 'someone', OR the 'link', but not both.

I've not been able to get the first x words of their comment at all (yada yada part).

Could it be made to look like yours? Thanks

20 | Jennifer

July 17th, 2004 at 3:45 pm

Avatar

That's a different plugin – the get recent comments plugin I talked about in the post.

21 | Sherri

July 17th, 2004 at 11:41 pm

Avatar

Thanks, having the correct plugin for what we want seems to help a LOT 8^)

22 | Typedby.com :: Serial Whiner

July 21st, 2004 at 2:33 am

Avatar

Recent Commenters – Exclude me from list
I was using Mt. Dew's Recent Comments plugin to output the most recent commenters. I wanted the comment author's name to show up with a short excerpt of the comment next to it. The plugin was working great for me but I realized that I wanted to exc…

23 | Code Novice

July 23rd, 2004 at 3:50 am

Avatar

Catching Up with Bookmarks
WordPress
Auto-close comments
Recent commenters and commented posts; additional plugin available here
Burningbird's WP modifications -- includes tons of helpful tips

ExpressionEngine
Inserting ads between entries
Banning partial IP nu…

24 | Chris

August 6th, 2004 at 5:52 am

Avatar

Thanks Jennifer, this is just what I was looking for for my new blog.

25 | Tin

August 16th, 2004 at 2:09 pm

Avatar

hi.

i recently installed this plugin. i am more interested in 'recent comments' than 'recent commentors'. when i tried using it though, by clicking on the links, only the title and author of the entry comes up. is there a way for it to display the content of the entry on the blog? does this have anything to do with the fact that i am using popup comments?

26 | Jennifer

August 16th, 2004 at 4:05 pm

Avatar

I'm not really supporting this plugin anymore – because I think the one on coffee2code is more robust than mine is. I left this post here more for archiving purposes (in case I ever need to use a bit of code from this) – but on the whole – consider the version from me "out of development". Grab his

Featured Sponsors

Genesis Framework for WordPress

Advertise Here


  • Scott: Just moved changed the site URL as WP's installed in a subfolder. Cookie clearance worked for me. Thanks!
  • Stephen Lareau: Hi great blog thanks. Just thought I would add that it helps to put target = like this:1-800-555-1212 and
  • Cord Blomquist: Jennifer, you may want to check out tp2wp.com, a new service my company just launched that converts TypePad and Movable Type export files into WordPre

About


Advertisements