New karma API
Hi,
I've just released the user_karma module.
http://drupal.org/project/user_karma
I wrote this module mainly for Drigg. It started as a simple module (300 lines) to assign karma to a user every time s/he received a vote for his/her nodes or comments.
However, it has now matured into something much, much more interesting:
-
It has a plug-in structure. This means that you can add plugins so that people can get karma for anything you like. In fact, while karma is assigned using the VotingAPI, users can get karma for recommending a story, inviting other users, etc. Anything is fine. the only constraints are: 1) The event needs to run a hook (obviously) 2) It needs to be possible to recalculate the karma.
-
It's very, very easy to write a new plugin
Please give the module a test. And... well, if you have any comments, please let me know. I think this could wekk become the foundation for Drupal's karma. I would love to know from Eaton if he thinks the implementation is solid, if the way I award karma is structurally good (basically, it's one vote to the user by the "admin" user...) etc.
Thank you!
Merc.

This is really useful
This is really useful module, thank you!
I'm like Drigg a lot.
This new Karma API module will enable lots of new karmic interactions. The wheel of karma turns slowly but grinds exceedingly fine.
Testing...
Hi,
This module really, really needs testing,
Plus, I will slowly add new ways of getting karma.
One thing that might need discussion is this. Some people would like their users to get karma for non-accountable events. For example, getting karma if they click on an external link.
Now, right now the karma module is based on the fact that it NEEDS to be possible to recalculate karma (that is, karma is based on existing data on the DB). While it's easy to write a javascript and trigger the karma amount, it's a little tricky to assign karma. The solution is to just add a table to keep track of the users' clicks on external links. However, I am pretty sure there will be more requests for this sort of stuff (that is, Karma for not-accounted-for events).
I was thinking about an extra table, like "user_karma_extras", with:
So, any karma sub-module could use it. For example, when user 3 clicks on an external link, we could insert (3,'user','http://www.me.com/clicked','') in this table. There would be a nice (simple) api to interface to this table, to keepthings minimal.
Sounds Yes? Now?
Merc.