TinyPortal

General => Chit chat => Topic started by: Sledge on May 19, 2006, 04:44:18 PM

Title: Vote = Karma Question
Post by: Sledge on May 19, 2006, 04:44:18 PM
I know this is an SMF question, and I have a post on their board about it but so far no one has replied. I thought I'd ask here, maybe it's something simple to do.

I'm trying to mod my SMF so whenever someone votes in a poll, their karma gets bumped up one. I see the poll feature in SSI.php, and I've disected karma.php, but I don't know enough about coding to edit what I need to edit to get this to work. Is there anyone who can help?
Title: Re: Vote = Karma Question
Post by: Xarcell on May 19, 2006, 04:53:37 PM
Don't you think people would abuse thier karma this way?

People could create polls, and then vote on them. Unnesscary polls...

If you disable polls for a board, then you can't create one either. I like teh overall idea, but I think it would create more modding than you think to keep it from being abused.

EDIT: actually I just did some experimenting. You could change a board to "reply only", and the admin/moderator can still post polls.
Title: Re: Vote = Karma Question
Post by: Xarcell on May 19, 2006, 04:54:10 PM
I would like to get my hands on this mod as well.
Title: Re: Vote = Karma Question
Post by: Sledge on May 19, 2006, 05:00:29 PM
Quote from: Xarcell on May 19, 2006, 04:53:37 PM
Don't you think people would abuse thier karma this way?

People could create polls, and then vote on them. Unnesscary polls...

If you disable polls for a board, then you can't create one either. I like teh overall idea, but I think it would create more modding than you think to keep it from being abused.

EDIT: actually I just did some experimenting. You could change a board to "reply only", and the admin/moderator can still post polls.

My site is a political polling and debate site and I intend to reward users for participating in polls by giving them "Political Capital (karma)" for each vote. Users can't award each other karma, and yes, I'll have the permission for posting polls turned off for regular users. The Political Capital can be cashed to enter drawings for prizes, etc.
Title: Re: Vote = Karma Question
Post by: Sledge on May 21, 2006, 02:45:09 AM
Got it. The folks at SMF were very helpful. Here's what we did, if anyone else is interested:

Quote from: mytreo on May 20, 2006, 01:11:13 AM
For SMF 1.1 [and 1.0.7] see line 184 in Poll.php

Add this....

// Change by one.
updateMemberData($ID_MEMBER, array('karmaGood' => '+'));


Before this....

// Return to the post...
redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);


I haven't tested this. It may not even work, but if it doesn't then it's probably just an include file missing which is easily fixed.

Chris

:up: