Closed (fixed)
Project:
User Karma
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
15 Dec 2007 at 14:40 UTC
Updated:
5 Mar 2008 at 04:57 UTC
FYI, I am eager to do some integration between this module and Organic Groups. The main innovation is to use an author's personal score to determine whether or not his comment issues an email notification. If his karma is too low, it does not. At that point, we have achieved a self moderating email list with integrated web forum. Thats pretty much nirvana in this space.
I haven't looked at the code for simple karma at all. Just wanted all to know I'm thinking.
Comments
Comment #1
moshe weitzman commentedTo be clear, I plan to do the work on this "sometime". If there are features this module needs to make that easier (i.e. put a persons score into his $user object on user_load()), then please do them :)
Comment #2
mercmobily commentedHi,
Please count on my help if you have ANY questions.
I have not seen organic groups ever. However, I have definitely seen simple_karma :-D
Moshe, you are a bit of a Drupal guru. Now... shall I change the category to Feature Request, rather than Bug Report?
I aim at having 0 bugs in general, and this is not _actually_ a bug...
Bye,
Merc.
Comment #3
mercmobily commentedHi Moshe,
One question.
We are having problems in www.fsdaily.com because of the number of queries we make for the frontpage.
Now, this would be very straightforward:
> If there are features this module needs to make that easier (i.e. put a persons score into his $user object on user_load()),
> then please do them :)
It will take me 2 seconds. However... it would mean one extra query every time user_load is called :-(
Am I wrong?
Merc.
Comment #4
moshe weitzman commentedYes, that would be an extra query. Your table should be keyed on uid so it would be lightening fast. It also should save you queries in other places.
Comment #5
mercmobily commentedHi,
Moshe, I am basically rewriting this so that it uses the VotingAPI. This is the right way to go about voting.
I am splitting the module in three:
* The voting form (already done 100%, and it works)
* The "best comment" and "bury comment" options (very simple to do)
* The "user karma" functionalities. I will program this tomorrow. I have thought about a very, very neat way to automatically award "points" (karma) to users when somebody votes. This can eventually become something more generic - a generic karma module for Drupal, finally?)
I think I will be able to finish the lot by Sunday, I will also have to change Drigg, so that it uses the three modules rather than simple_karma (which at that point will be obsolete).
This won't change pretty much anything to you - the only difference is that you will query the VotingAPI for the user's score, rather than the simple_karma module.
Creating three small-ish modules (the biggest one is only 1500 lines) is a lot better. I have improved the code _a lot_ already.
Just to keep you informed...
Merc.
Comment #6
moshe weitzman commentedSounds very nice, merc. Thanks.
Comment #7
mercmobily commentedHi,
Thank you for the kind words!
I have created the karma module just now. I am glad you agree that this is the right way to go.
Implementing this is tricky, especially because I have nearly really used the Voting API before 3 days ago... And I am really using pretty much every single feature it has (and more) to do what I want to do.
But, I think it's doable and it's gonna work. So, there :-D
I wish I had thought about it a little earlier - I wouldn't have had to do a major rewrite before Chrissy. But hey... you live and learn.
Bye,
Merc.
Comment #8
mercmobily commentedHi,
Moshe: an update.
This is happening. The simple_karma module is basically obsolete now. I created something called "extra_voting_forms" (to vote on nodes using the VotingAPIs), and another module called "User Karma" which keeps track of an user's karma.
I am testing user_karma right now.
I am happy t add a fieldwhen a user gets loaded. However, I will make it "optional" if that's OK.
Is that all you need?
Bye,
Merc.
Comment #9
mercmobily commentedHi,
Another update: simple_karma is officially obsolete. Now, user_karma and extra_voting_forms manage everything.
(Alan is finally working on a nice drigg Theme as well... http://www.fsdaily.com looks nice, but http://www.drigg.org looks like a bad joke).
Moshe, please try out user_karma and let me know what you need to make it work for you!
Merc.
Comment #10
mercmobily commentedHi Moshe,
I moved this issue to user_karma.
Right now, user_karma is quite basic. HOWEVER, the karma calculation can be a lot more complex than what it is now.
Right now, I just count the votes received for comments and for nodes. This module can go a lot further... For example, users can receive a lot more karma for voting on a story BEFORE it was promoted, or for comments which were voted up by people with very high karma...
Now that it's a separate module, there are lots of possibilities. However, to get things started, just let me know what *you* need!
Bye,
Merc.
Comment #11
mercmobily commentedHi,
Moshe, you sort of disappeared on this one...
I've done what you've requested: now the attribute 'rank' and 'karma' are loaded with the profile.
I've also rewritten the karma module (it was in the plan) so that it has a plug-in architecture. Now, you can get karma for ALL SORTS of things: voting, writing a comment, etc. I have 1000 lines of untested code :-D However, I am sure I can go through it today.
I think this is the best basis for "the" karma module for Drupal, where each module can define means of getting karma through hooks. Yay!
I checked in the code... although it doesn't work yet. Checkout the DRUPAL-5 branch to have an idea.
So, marking this as "closed" (although it's untested) and waiting to release it.
Are you still interested?
Repen this issue if you answer, so that I actually see it)
Merc.
Comment #12
wasaka commentedYou said Alan is working on a new Theme, how's it coming?
I'd love to have tutorial and learn to do this myself.
/mark
Comment #13
mercmobily commentedHi,
Asking a UNRELATED question in a CLOSED issue is not really something you should do if you want an answer...
The theme is ready. It comes with Drigg -- feel free to download it.
Bye,
Merc.