I saw a really cool thing on ProBlogDesign. In the comments there is also the amount of comments the comment authors made. Here is a screenshost.

Here is a function you can use to get and echo the number of comments a comment author made. Put it in the functions.php file in your theme.
function commentCountAuthor(){
$oneText = 'One comment';
$moreText = '% comments';
global $wpdb;
$result = $wpdb->get_var('
SELECT
COUNT(comment_ID)
FROM
'.$wpdb->comments.'
WHERE
comment_author_email = "'.get_comment_author_email().'"'
);
if($result == 1):
echo str_replace('%', $result, $oneText);
elseif($result > 1):
echo str_replace('%', $result, $moreText);
endif;
}
Simply call the functions inside the comments loop.
commentCountAuthor();
Our WordPress themes
We have a few WordPress themes that we would like you to take a look at if you want.
check out the portfolio











This is really slick. I have seen this implemented on several blogs which is really cool.
One question…If I were to use my name and someone else’s email address, will my comment show up with the number of comments the other user had, since I used their email?
My counter question is, why would you use someone else’s email address when you post a comment?
It can easily be made to check the name instead of email. But i guess people use different names more then they use different emails.
Hi, me again
Great hack! I’m looking for a hack to show top commentators. I’ve found a plugin (Show Top Commentators) but I can’t make it work on my site. Do you plan to write a code for it? Since you already show amount of comments a comment author made, maybe you can go a step further
Thanks!
@Sullivan – Check back tomorrow.
Is it possible to Exclude some Author to be counted?
@Jauhari – Yeah, just wrap the whole part inside the function with a conditional statement where you check if the email is not same as the email of the author you want to exclude. You can populate an array with the authors emails and then use php function in_array(). Let me know if you need help with that and i’ll update the tutorial.
Hi Boba, did you decide to do something about what I suggested? Just checking
I published it yesterday
http://wpcanyon.com/tipsandtricks/show-top-commentators-in-wordpress-without-a-plugin/
You rock!!!
In the comments there is also the amount of comments the comment authors made. I have seen this implemented on several blogs which is really cool. But i guess people use different names more then they use different emails.Once men and women have realized just how such a system was being understood, they will often understand that this thing is seriously helpful in some counties. Also, there exist multiple separate readings of this world-view.
wah.. mantap mas Boba
terima kasih..
I’m from Serbia, i don’t understand Indonesian, but thx to google translate i figured out the “terima kasih”
You’re welcome.
aku sudah memperbaiki
terima kasih informasi nya mas Boba
It is necessary to frequently visit your blog)) interesting!
Thanks, learned a lot of useful information.