As far as I know, that just looks at the total comments made by each author - so you’d have to wipe out all of the comments to reset it. You could probably modify the plugin to look at only the last 30 days or last calendar month, but if you wanted random reset ability then you’d need a module/extension combination to store that information in the database in its own table.
Yeah, modifying the plugin to only look at the last calendar month or 30 days is kinda what I had in mind. I just don’t know PHP so doing this myself is out of the question. Was kinda hoping someone else had already needed this functionality and made these changes and could throw me a bone. 😊
I say go with a custom query (or hack the plugin accordingly):
{exp:query sql="SELECT COUNT(entry_id) AS count, name, email, url, author_id, weblog_id, comment_date
FROM `exp_comments` WHERE FROM_UNIXTIME(comment_date,'%m') = DATE_FORMAT(CURRENT_DATE(), '%m')
AND FROM_UNIXTIME(comment_date,'%y') = DATE_FORMAT(CURRENT_DATE(), '%y')
AND status='o' GROUP BY email ORDER BY count DESC LIMIT 10"}
{count} comments by {name}
{/exp:query}
This query shows only comments of the current month of the current year, and hopefully does what you want. If you want the last 30 days instead, that is a slightly different approach.
Wow Ingmar, that’s great! Thanks a lot for supplying me with that code. Since I make comments in reply to other comments, is there any way to exclude my own comments from the list?
Certainly. You’d simply add
... AND author_id <> '1'
where 1 is the user_id you want to exclude. So, to sum it up:
{exp:query sql="SELECT COUNT(entry_id) AS count, name, email, url, author_id, weblog_id, comment_date
FROM `exp_comments` WHERE FROM_UNIXTIME(comment_date,'%m') = DATE_FORMAT(CURRENT_DATE(), '%m')
AND FROM_UNIXTIME(comment_date,'%y') = DATE_FORMAT(CURRENT_DATE(), '%y')
AND status='o' AND author_id <> '1'GROUP BY email ORDER BY count DESC LIMIT 10"}
{count} comments by {name}
{/exp:query}
Should do what you want, I hope.
@Lisa: Yes, the wiki. Yes, I will.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.