Max karma limit

Started by proxima, November 22, 2010, 07:31:21 PM

Previous topic - Next topic

proxima

Hello, I would like to do this:

http://www.simplemachines.org/community/index.php?topic=400130.0

except on smf 2.0 rc4. i am aware that 1.1.11 differs from 2.0 rc4 so i figured there must be some change somewhere.

Thanks.

Deaks

actually using Kay's dirty trick its pretty much the same in Display.template.php

find

// Is this user allowed to modify this member's karma?
if ($message['member']['karma']['allow'])
echo '


replace with:

// Is this user allowed to modify this member's karma?
         if ($message['member']['karma']['allow'] && $message['member']['karma']['good'] < 200)
echo '


Remember to backup the file though
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

proxima

Quote from: Runic on November 22, 2010, 08:19:01 PM
actually using Kay's dirty trick its pretty much the same in Display.template.php

find

// Is this user allowed to modify this member's karma?
if ($message['member']['karma']['allow'])
echo '


replace with:

// Is this user allowed to modify this member's karma?
         if ($message['member']['karma']['allow'] && $message['member']['karma']['good'] < 200)
echo '


Remember to backup the file though
alright, it still lets the person go above 200 rep though. I am trying to make karma stop when the user has reached 200 rep.

thanks

Deaks

if they have more than 200 already then thats why it will only work on people who are not there yet
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

proxima

Quote from: Runic on November 22, 2010, 08:28:11 PM
if they have more than 200 already then thats why it will only work on people who are not there yet
yes i know, a guy on my forum had 200 rep, i repped them and it went up to 201. i would like it to stop at 200 rep.

Deaks

hmm ok ive asked kays to take a look here :)
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

proxima


Kays

Hi, I took a different approach afterwards. Check out the following thread. It should be the same for 2.0 except that the last line in Display.template.php doesn't have a <br /> at the end in 2.0.

http://www.simplemachines.org/community/index.php?topic=409941.msg2858761#msg2858761

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

proxima

Quote from: Kays on November 22, 2010, 08:54:07 PM
Hi, I took a different approach afterwards. Check out the following thread. It should be the same for 2.0 except that the last line in Display.template.php doesn't have a <br /> at the end in 2.0.

http://www.simplemachines.org/community/index.php?topic=409941.msg2858761#msg2858761
alrite, when i select rep++ it doesnt give them rep.

Deaks

so we can mark this as solved then???
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

proxima

Quote from: Runic on November 22, 2010, 09:06:03 PM
so we can mark this as solved then???
no, when i rep somebody it doesnt give them rep at all.

for instance, this guy has 0 rep. i rep him, he still has 0 rep.

Deaks

see you need to be clearer :P or maybe i need sleep

Is there any errors in the log?
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

proxima

Quote from: Runic on November 22, 2010, 09:14:33 PM
see you need to be clearer :P or maybe i need sleep

Is there any errors in the log?
nope there isn't. for instance. let's say you have 5 rep. i want to rep you, so i click the rep++ button. but however, your rep stays at 5 and does not go onto 6. this is my problem, it will not add karma to people's profiles after adding what kays said.

Kays

Try using this instead in display.php. I forgot that sessions are handled differently in 2.0


<a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';total=', $message['member']['karma']['good'] - $message['member']['karma']['bad'], ';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'], ';total=', $message['member']['karma']['good'] - $message['member']['karma']['bad'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

proxima

i added that, but now whenever i go to a post this error comes up:

http://inkast.net/index.php?topic=105.msg113#new

Kays

If you can, undo the change and reupload that file.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

proxima

unfourtunately i was foolish and did not backup the file before i did so. greatest apolagies.

here is the file, attached below:



Kays

This should work, see attached

In testing it it wouldn't work for me at first also until went in and changed the karma settings. So maybe the file cache needs to be cleared first.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

proxima

#18
alright it restored the error, however it still won't add rep. i just want the max karma that a person can obtain to be 200.

Kays

It works for me although it was cranky at first.

Have you tried changing karma settings or clearing the file cache in the Admin CP?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

proxima

#20
Quote from: Kays on November 22, 2010, 10:07:47 PM
It works for me although it was cranky at first.

Have you tried changing karma settings or clearing the file cache in the Admin CP?
didnt know you could clear file caches via admin cp, how would we do that?

edit: sorry i have to go to bed, i will speak to you tomorrow. thanks for helping, however the problem is not fully fixed yet. :)

seeya tomorrw.

Kays

Admin CP > Forum Maintenance > Routine > Empty the file cache

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

proxima

#22
alright, i emptied the file cache but however it still won't add rep to somebody's rep points. maybe its thinking they're at 200 rep but they arent  ?

Deaks

proxima do tiy still require assistance, i appologise for not posting more I left it to Kay to help if you need help please say and we can bump kays again, I have marked this as solved until you get back to us :)
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Advertisement: