By Rachel C on
Is there a way to show the members who have posted the most comments (or contributed the most to the site)? E.g. Top 20 Members.
Is there a way to show the members who have posted the most comments (or contributed the most to the site)? E.g. Top 20 Members.
Comments
Can anyone help?
Can anyone help?
Add it to the wish list...
I've wanted such a feature for a long time, myself, Rachel, and there is no such beastie.
Custom Block
It would be a fairly simple block. You could base it off the top nodes block.
---
Code Orange: Drink Your Juice
Look at 'comments' table in Database
I agree that programing this wouldn't be to complex. You would just need to pull the 'uid' feild of the 'comments' table in the database, sort them, and then do a count to see who had the most. Then just sort them again to get the list. Does this help?
Here's the SQL statement
Here's the SQL statement you'd need, which would give you the following results (per the Gamegrene.com database at least):
SELECT COUNT(cid) AS count, users.uid, users.name FROM comments LEFT JOIN users ON comments.uid = users.uid WHERE comments.uid != 0 GROUP BY uid ORDER BY count DESC LIMIT 20;http://disobey.com/
http://gamegrene.com/
http://www.disobey.com/
one gaint step up - you bet they'll be back
If you wanted to take this one gaint step up. You could store the users points and reward them Privileges based on thier points.
I don't program, so I can't help there. But if anyone wants to build such a Mod and hook it into the other features - I can do Specs :-).
I work with you and show you how to triple your customer Loyalty and have them Participate more. they'll be coming back more and more.
I also have a methodology for reducing Spam "Hey, remove me from your emailing list" I didn't sign up when in FACT they did sign up -- they just forgot.
They forget and you get a Spam complaint :-( we can help there :-)
point/karma/reward system discussion
FYI, this type of thing was being discussed about a month ago. I don't know if anyone followed it up with any code (I've been outta the loop lately).
http://drupal.org/node/14175
Also,
http://drupal.org/node/1260
http://drupal.org/node/14583
while it hasn't been started...
I am talking with Moshe about developing this module. My idea is to meld this idea into the Node Moderation, Comment Moderation, and AutoMember modules. Ideally, it will also be flexible enough to allow several point scoring systems.
I will let you know when we start actually having code.
---
Code Orange: Drink Your Juice
Autorole does some of this
Check out the autorole.module It allows for some of this automatic role management you mention. In combination with the SQL command posted above this could be a cool community tool.
And here's a rough demo...
1. Go to http://yoursite.com/admin/block/add
2. The Block Title is "Top 20 Users".
3. The Block Description is "Top 20 Users".
4. The Input Filter is "PHP Code".
5. And the block body is below.
Save your block and enable it as usual. This is a VERY VERY basic block, just to show you as an example. It doesn't link to the user's profile, and it writes raw HTML as opposed to using the Drupal template builtins. Adding those features are an exercise for the reader.
http://disobey.com/
http://gamegrene.com/
http://www.disobey.com/
Ok, I bit..
..at least on the linking to a user's journal feature...for the convenience of non-programmers...
Now, if only there were a place to list out the most recent comments that a user posted....
Thanks so much, that's
Thanks so much, that's wonderful!
for non-clean urls...
The code above assumes that you are using clean urls. The more generic solution would be:
I wonder if there shouldn't be a section on drupal.org for clever block hacks such as these. There are so many little things like this that don't necessarily warrant creating a module for but would be "nice to have". Maybe someone should create a stupidblocktricks.module to house so many such blocks.
where
Where in the handbook do you feel such a section should go? I agree with you, it would be nice. It is also posible.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
I don't know if the handbook
I don't know if the handbook would be a proper place for them. I suppose if a new top-level section was created ("Tips and Tricks"?), it could fit in, but none of the current sections would naturally house them very well.
I would think that another section on the Downloads page would make more sense. There's already Drupal, Modules, Themes, Translations and Theme Engines, why not add another section here for inline code hacks and blocks?
I don't have much of a personal preference for storing them so long as they're not too difficult to find. The current bag of tricks is not really easy for people to find (http://cvs.drupal.org/viewcvs/drupal/contributions/tricks/blocks/) and requires CVS access to contribute to.
The blocks repository already exists, but it is hard to find.
http://drupal.org/node/17170
Perhaps it would be nice to propose moving this book page to another location, where it could be more useful?
---
Code Orange: Drink Your Juice
Agreed
I never would have looked under the Administration Guide's Troubleshooting FAQ for a repository of various blocks.
posted for now.
neither would I
http://drupal.org/node/15638
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
New Handbook Section Created
Just to keep links up to date in the forums I wanted to mention that I created a higher level Blocks directory where these custom blocks may be posted.
top_users.module
Maybe this is something you and others can use? It's based on some of the example code here but are a module and use Drupal funktions for item list etc.
Comment correction
Used another module as template and forgot to change a comment block.
/**
* Implementation of hook_block().
*
* Generates a block with the top users,
* the ones that has posted most comments.
* $nlimit sets the number of top users to display
*/