SMF Shop

SMFShop => Requested additions => Items => Topic started by: D on November 09, 2007, 12:37:27 am

Title: Item request: Decrease Karma
Post by: D on November 09, 2007, 12:37:27 am
Ok, so just to be different, my forum does karma backwards.  Low karma is good and good karma is bad.  Is there any way I can get an item to let a user decrease their karma?
Title: Re: Item request: Decrease Karma
Post by: spearfish on May 19, 2008, 10:46:19 am
Hmm.... seems nice and simple.  If you have any knowledge of a text editor + ftp program....

Edit /Sources/shop/items/IncreaseKarma.php

Change:

Code: [Select]
class item_IncreaseKarma extends itemTemplateto
Code: [Select]
class item_DecreaseKarma extends itemTemplate
and....

Code: [Select]
db_query("

UPDATE {$db_prefix}members

SET karmaGood = karmaGood + {$item_info[1]}

WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);

return 'Successfully increased your Karma by ' . $item_info[1] . '!';

to

Code: [Select]
db_query("

UPDATE {$db_prefix}members

SET karmaBad = karmaBad + {$item_info[1]}

WHERE ID_MEMBER = {$ID_MEMBER}", __FILE__, __LINE__);

return 'Successfully decreased your Karma by ' . $item_info[1] . '!';

~~~

Then save that as DecreseKarma.php and upload it to where all the other items live.  I'm not going to bother to make a package for this because there's probably not that great of a demand.... Sorry.
Title: Re: Item request: Decrease Karma
Post by: sontoloyo on April 28, 2011, 09:23:57 pm
How about a "KARMA BOMB" item to decrease somebody else karma by x points ???