Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Mod Requests => Aiheen aloitti: vorarg - syyskuu 26, 2007, 06:14:11 AP

Otsikko: Help me please with karma
Kirjoitti: vorarg - syyskuu 26, 2007, 06:14:11 AP
How can I make it so you need 15 karma instead of posts to modify karma?
Otsikko: Re: Help me please with karma
Kirjoitti: Kindred - syyskuu 26, 2007, 07:48:37 AP
you would need a mod to do this. 

However, it does not look like anyone has created such a mod yet.




--moving to mod request board.
Otsikko: Re: Help me please with karma
Kirjoitti: vorarg - syyskuu 26, 2007, 10:51:42 AP
Ok, thanks for the move..
Can someone please make this mod for me??
Otsikko: Re: Help me please with karma
Kirjoitti: Rudolf - syyskuu 27, 2007, 07:54:14 IP
You can do it with a few manual changes.
1. Load.php
Koodi (Search for) [Valitse]
$user_info['groups'] = array_unique($user_info['groups']);
Koodi (Add after) [Valitse]
$user_info['karma'] = array(
'good' => $user_settings['karmaGood'],
'bad' => $user_settings['karmaBad'],
'allow' => false, //you can't edit your own karma
'allow_edit' => $user_settings['karmaGood'] - $user_settings['karmaBad'] > 15
);



Koodi (Search for) [Valitse]
'allow' => !$user_info['is_guest'] && $user_info['posts'] >= $modSettings['karmaMinPosts'] && allowedTo('karma_edit') && !empty($modSettings['karmaMode']) && $ID_MEMBER != $user
Koodi (Replace with) [Valitse]
'allow' => !$user_info['is_guest'] && $user_info['karma']['allow_edit'] && $user_info['posts'] >= $modSettings['karmaMinPosts'] && allowedTo('karma_edit') && !empty($modSettings['karmaMode']) && $ID_MEMBER != $user

2. Karma.php
Koodi (Search for) [Valitse]
fatal_lang_error('smf61', false)
Koodi (Add after) [Valitse]
//You need a minimum karma to be able to edit karma
if (!$user_info['karma']['allow_edit'])
fatal_lang_error('karma_allow_edit');


3. Errors.english.php or (Errors.your_language.php)
Koodi (Search) [Valitse]
?>
Koodi (Add before) [Valitse]
$txt['karma_allow_edit'] = 'You need 15 karma points (total positive) to be able to edit other people\'s karma.';

DONE.
Replace 15 with the minimum number you want. This will count the total positive karma regardless of the type you have selected.
Maybe someone can make it in a mod, add an option and put it in the admin section. For that you need to modify a couple of more files, although they are all really small changes.
Otsikko: Re: Help me please with karma
Kirjoitti: vorarg - syyskuu 28, 2007, 05:59:24 AP
Oh no!
Now I can't see my [Rep++] Button :(
Any Fix for that please?

Thank you for actually helping BTW.
Otsikko: Re: Help me please with karma
Kirjoitti: Rudolf - syyskuu 28, 2007, 06:26:45 AP
What is the [Rep++] button?
Otsikko: Re: Help me please with karma
Kirjoitti: vorarg - syyskuu 28, 2007, 09:24:01 AP
Its my add karma button, I fixed it though, thank you very much for your help :)

Also, how do I make it so I start with 10 karma?