Welcome, Guest. Please Login or Register.
November 27, 2024, 04:33:00 AM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Code 1.5.x] Karma ++/-- Bugfix « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [Code 1.5.x] Karma ++/-- Bugfix  (Read 4948 times)
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

[Code 1.5.x] Karma ++/-- Bugfix
« on: July 05, 2003, 10:27:23 PM »
Reply with quote

The bug
If you smite someone (-), then right after, applaud him, he'll get a ++. This was done to compensate the first one (in case someone clicked on the wrong link). It worked okay in the older version of Karma feature, but in since yse 1.5.0 or 1.5.1 (can't remember), we can view Karma as positive/negative, not just as total.

The fix
Open Karma.php, search for      $request = mysql_query("UPDATE {$db_prefix}members SET $field=$field+$change WHERE ID_MEMBER='$uid' $doLimitOne;") or database_error(__FILE__, __LINE__);replace with      // Karma bug fix
      if ($change == 2)
      {
         $field2 = (($dir == '+') ? 'karmaBad' : 'karmaGood');
         $request = mysql_query("UPDATE {$db_prefix}members SET $field=$field+1, $field2=$field2-1 WHERE ID_MEMBER='$uid' $doLimitOne;") or database_error(__FILE__, __LINE__);
      }
      else
         $request = mysql_query("UPDATE {$db_prefix}members SET $field=$field+$change WHERE ID_MEMBER='$uid' $doLimitOne;") or database_error(__FILE__, __LINE__);
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Ruthie
Noobie
*
Posts: 37


Re:[Code 1.5.x] Karma ++/-- Bugfix
« Reply #1 on: August 15, 2003, 09:36:37 AM »
Reply with quote

Hi there,
That sort of worked... but I'm still able to go applaud, then smite, then applaud, then smite, then applaud, then smite... so if I had the time and wanted to be a twit I could make someone go from +1/-1 to +121/-121 in one night, even though the karma restriction is set to once every 12 hours.

Is there a fix for that?

Thanks :D
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:[Code 1.5.x] Karma ++/-- Bugfix
« Reply #2 on: August 15, 2003, 06:22:09 PM »
Reply with quote

the code above should fix that, it it will reduce your previous vote by 1 and add the new vote by 1, instead of adding the new vote by 2 (in current YSE 1.5.4)

and i'm sure this has been fixed for SMF 1.0
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Ruthie
Noobie
*
Posts: 37


Re:[Code 1.5.x] Karma ++/-- Bugfix
« Reply #3 on: August 15, 2003, 06:33:04 PM »
Reply with quote

You're right... I tested it late at night and didn't check the applaud and smite totals  ::) when I was testing.. so all I saw was it go up/down/up/down/up/down and assumed that meant applauds and smites were both going up.

Thanks for your help!
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:[Code 1.5.x] Karma ++/-- Bugfix
« Reply #4 on: August 15, 2003, 07:39:59 PM »
Reply with quote

Quote from: Ruthie on August 15, 2003, 09:36:37 AM
Hi there,
That sort of worked... but I'm still able to go applaud, then smite, then applaud, then smite, then applaud, then smite... so if I had the time and wanted to be a twit I could make someone go from +1/-1 to +121/-121 in one night, even though the karma restriction is set to once every 12 hours.

Is there a fix for that?

Thanks :D


You are probably an administrator.  You can do anything without restriction ;).

-[Unknown]
Logged
Ruthie
Noobie
*
Posts: 37


Re:[Code 1.5.x] Karma ++/-- Bugfix
« Reply #5 on: August 15, 2003, 07:56:46 PM »
Reply with quote

Quote from: [Unknown] on August 15, 2003, 07:39:59 PM
Quote from: Ruthie on August 15, 2003, 09:36:37 AM
Hi there,
That sort of worked... but I'm still able to go applaud, then smite, then applaud, then smite, then applaud, then smite... so if I had the time and wanted to be a twit I could make someone go from +1/-1 to +121/-121 in one night, even though the karma restriction is set to once every 12 hours.

Is there a fix for that?

Thanks :D


You are probably an administrator.  You can do anything without restriction ;).

-[Unknown]

Yup I am... but I've been around these forums long enough to know that I have to change my account to that of a regular user before testing suspected bugs.
Logged
BrandonMiller
Jr. Member
**
Posts: 52


I'm a llama!

Re:[Code 1.5.x] Karma ++/-- Bugfix
« Reply #6 on: October 24, 2003, 08:23:54 PM »
Reply with quote

 8)
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Code 1.5.x] Karma ++/-- Bugfix « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.265 seconds with 20 queries.