Karma: Changing the "Smite" to a positive value.

Started by HecticZA, July 11, 2012, 09:02:13 AM

Previous topic - Next topic

HecticZA

Good day.:)

I would like to change the Smite value to a positive value, in other words, when selected it must count towards total Karma value and not subtract from it.

In practice I will change "Applause" to "Thank you for a great post"
                                        "Smite" to "Thank you for the help"

The wording is not that important, I just would like to distinguish between post and actual help given. So for this to work the "Smite" must add and not subtract.
Can someone help please?

My knowledge level regarding web pages and coding:
NOOB
:)

ziycon

Hi HecticZA, can you explain why you would like to do this as the value for both of these would be stored in the one database field which would make it impossible to tell which link was clicked.

The other option is if you want modifications to be able to have the two values stored separately I would suggest posting in the [Mod Requests board.

HecticZA

I sort of wanted to differentiate between a good post or something you agree with and on the other hand I want to give an option where something more practical  or hands on has been done. I have members on my forum that help in ways that goes far beyond the the normal posts. It would sometime cost them money out of their own pocket, but not being compensated.

I did not realize what the request entailed and thank you for your reply.
I will probably not go the mod request root.

Thank you again for the reply.

Not sure if I must mark this as resolved?

ziycon

Once you happy that your question has been answered if you could mark it solved please, thanks.

Maybe have a look at this mod, it might do what you want, http://custom.simplemachines.org/mods/index.php?mod=710

Orangine

essentially what you're asking it's not possible, as [Smite] [Aplaud] works as -1/+1 to overall karma, in your case there should be two values, you need to use a mod (see above)

HecticZA

Thx for the help guys.
Will check out the suggestion.
:)

Orangine

Actually I might have been wrong. Looking at the karma system, it looks there are two modes: one being total and another one positive/negative. If you switch to the latter you could use them independently. The only thing is you need to adjust your display.template.php, this part:
         // Is karma display enabled?  Total or +/-?
         if ($modSettings['karmaMode'] == '1')
            echo '
                        <li class="karma">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';
         elseif ($modSettings['karmaMode'] == '2')
            echo '
                        <li class="karma">', $modSettings['karmaLabel'], ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';

         // Is this user allowed to modify this member's karma?
         if ($message['member']['karma']['allow'])
            echo '
                        <li class="karma_allow">
                           <a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
                           <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>
                        </li>';

if you need more help, let me know

MrPhil

OK, so the OP wants to repurpose Karma from Smite/Applaud (-1/+1) to use it for two flavors of Applaud? As @Orangine listed in the previous post, it appears that there are two Karma modes, one showing Good-Bad value, and the other Good and Bad separately. Use Karma mode 2 to show 'Good' and 'Bad' (whatever you relabel them to) separately and fix the line of code to format the message as you wish (drop the + and -). Don't worry about changing 'good' and 'bad' element names, as users shouldn't see those internal labels.

<li class="karma">', $modSettings['karmaLabel'], ' ', $message['member']['karma']['good'], '/', $message['member']['karma']['bad'], '</li>';

Orangine

QuoteDon't worry about changing 'good' and 'bad' element names, as users shouldn't see those internal labels.
and the text for "Applaud"/"Smite" can be changed in admin panel

Advertisement: