]> git.mxchange.org Git - mailer.git/commitdiff
More fixes for rallye
authorRoland Häder <roland@mxchange.org>
Sat, 4 Oct 2008 11:57:52 +0000 (11:57 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 4 Oct 2008 11:57:52 +0000 (11:57 +0000)
inc/databases.php
inc/modules/admin/what-list_rallyes.php
inc/mysql-manager.php

index eacf64ac61f17d6b95e809c67ba4fa2d6cfdf823..a8a6a86fc13069717b7eca7cb7e2b6b2f960bb57 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "440");
+define('CURR_SVN_REVISION', "441");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index d4e61658fa286837de54baa8440820531e89ed66..523ff1a9587dcdc77057d4343e27ebc295ad52fd 100644 (file)
@@ -243,7 +243,8 @@ if (isset($_POST['edit']))
                        }
 
                        // Get user points
-                       $points = GET_TOTAL_DATA($uid, "user_points", "points")  - GET_TOTAL_DATA($uid, "user_data", "used_points");
+                       $points = GET_TOTAL_DATA($uid, "user_points", "points", "userid", false, " AND ref_depth=1 LIMIT 1");
+                       //* DEBUG: */ echo basename(__FILE__).":uid={$uid},points={$points},opoints={$opoints}<br />\n";
                        $content = array(
                                'sw'      => $SW ,
                                'uid'     => $uid,
index 3ef6deee4669c9f75d5b0843facf12450b3330e7..57572a157035ff6bc2e906eaf126620a03bf4445 100644 (file)
@@ -1070,16 +1070,16 @@ function REMOVE_RECEIVER(&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fal
        return $ret;
 }
 //
-function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false) {
+function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false, $add="") {
        $ret = 0;
        if ($onlyRows) {
                // Count rows
-               $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
-                array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'%s",
+                array($lookFor, $tableName, $whereStatement, $search, $add), __FILE__, __LINE__);
        } else {
                // Add all rows
-               $result = SQL_QUERY_ESC("SELECT SUM(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
-                array($lookFor, $tableName, $whereStatement, $search), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT SUM(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'%s",
+                array($lookFor, $tableName, $whereStatement, $search, $add), __FILE__, __LINE__);
        }
 
        // Load row