Comment by author plugin
This is a little plugin I've created for Wordpress. This was created to experiment with plugins, so don't expect antything fancy. Just unzip this file to your plugin dir, activate it in the control panel, and a call to the function
gdd_comments_by_author(author_id, number, before, after);
Where
author_id = the id of the author wich comments you want to show (default set to 1, typically the admin)
number = the number of comments you want to show (default set to 10 million, I know it's a lot)
before = string to put before each result (default is <li>)
after = string to put after each result (default is </li>)
Sound complicated? I've used this myself with the variable $curauth->ID as explained here. The code I used:
<h4>Comments by <?php echo $curauth->nickname; ?></h4> <?php gdd_comments_by_author($curauth->ID, 100) ?>
Credits go to Joey Esquivel, the basic query was done by him, I just stole it and put it in a plugin.
January 17th, 2007 at 8:46 am
Hi Zoute, I wonder if this plugin could be used with my list of "top commenters" on http://www.indonesiamatters.com/. It's like this:
Top Commenters
* Hassan (511)
* Mohammed Khafi (355)
etc, etc
What I'd like to do is have the number of comments, like 511, a clickable link that goes to a page with all that person's comments on it.
Thanks,
Patung
January 20th, 2007 at 12:25 pm
Thanks for the plugin good buddy! I just happened to look today for this plugin and its only a very recent solution.
Works great!
January 20th, 2007 at 12:36 pm
BTW what would also be awesome is some way to paginate the comments of the authors although I imagine that would be quite complicated.
I just don't have the PHP skill set for that.
January 23rd, 2007 at 4:10 pm
Patung: I don't know how the list of top commenters is created, but I suppose you could edit the code that generates the list so that it links to an authorpage template, which would contain the function from this plugin.
Hone Watson: Thanks for the input, I'll look into it somewhere next week, this week is kind of busy for me.
February 8th, 2007 at 7:18 pm
And we're two weeks later, but still no time on the hand :(.
July 6th, 2007 at 6:33 am
Nice job. We are using the plugin on our author pages at MyBiggestComplaint. We are using permalinks with the post name. We had to change line 29 of the plugin to read
echo "post_name."#comment-".$recentcomment->comment_ID."\">".$recentcomment->post_title."";
Thanks.
November 25th, 2007 at 5:10 am
Awesome plugin. Is prerty permalink support possible?
November 25th, 2007 at 5:48 am
Ok, I solved it i changed to a hre...".get_permalink($recentcomment->ID)." so it uses pretty permalinks
i think you should use this code in your 0.3 version
November 26th, 2007 at 11:51 am
Xen, although it's relatively easy to use pretty permalinks, the wordpress engine will change the links this plugin creates to pretty permalinks by default. At least that's what it does in my experience.
March 11th, 2008 at 1:37 am
Thanks for plugin.. Work Now