Integration with OG

moshe weitzman - December 15, 2007 - 14:40
Project:User Karma
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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.

#1

moshe weitzman - December 15, 2007 - 14:42
Category:bug report» support request

To 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 :)

#2

mercmobily - December 15, 2007 - 14:45
Category:support request» bug report

Hi,

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.

#3

mercmobily - December 16, 2007 - 14:34

Hi 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.

#4

moshe weitzman - December 19, 2007 - 13:46
Category:bug report» feature request

Yes, 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.

#5

mercmobily - December 19, 2007 - 14:44

Hi,

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.

#6

moshe weitzman - December 19, 2007 - 15:24

Sounds very nice, merc. Thanks.

#7

mercmobily - December 19, 2007 - 23:44

Hi,

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.

#8

mercmobily - December 24, 2007 - 04:45

Hi,

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.

#9

mercmobily - December 27, 2007 - 11:23

Hi,

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.

#10

mercmobily - December 29, 2007 - 06:58
Project:Simple Karma» User Karma
Version:5.x-1.x-dev» 5.x-1.x-dev

Hi 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.

#11

mercmobily - February 17, 2008 - 05:16
Status:active» closed

Hi,

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.

#12

wasaka - March 2, 2008 - 04:43

You 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

#13

mercmobily - March 5, 2008 - 04:57

Hi,

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.

 
 

Drupal is a registered trademark of Dries Buytaert.