From eac3d0759a2d43000f8efbeb6ecd193fcc87aca1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 28 Sep 2008 01:39:46 +0000 Subject: [PATCH] Hotfix for counting refback points --- inc/databases.php | 2 +- inc/extensions/ext-sql_patches.php | 1 + inc/mysql-manager.php | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/inc/databases.php b/inc/databases.php index 9752967174..fd4c517cca 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "411"); +define('CURR_SVN_REVISION', "412"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 4517ec3a44..1cfd76056c 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -644,6 +644,7 @@ PRIMARY KEY (id) `level` smallint(6) NOT NULL DEFAULT 0, `refid` bigint(20) NOT NULL DEFAULT 0, `refback` float(4,1) NOT NULL DEFAULT 0.0, +`points` FLOAT( 20,5) DEFAULT '0.00000' NOT NULL, PRIMARY KEY (`id`), UNIQUE `user_refid` (`userid`,`level`,`refid`), KEY (`level`), diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 84d2a4ddbf..26e6870c0c 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1293,6 +1293,10 @@ function ADD_REFBACK_POINTS ($uid, $ref, $points) { //* DEBUG: */ echo __FUNCTION__.":refback={$refback}
\n"; ADD_POINTS_REFSYSTEM($uid, $refback, false, "0", false, "direct"); + // Update refback table + $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_refs SET points=points+%s WHERE userid=%s AND refid=%s LIMIT 1", + array($refback, $uid, $refid), __FILE__, __LINE__); + // Reduce points if refid is found if ($refid == $ref) { // Reduce points here! -- 2.39.5