Reset rewritten, SQL fixed, zeros are now numeric
[mailer.git] / inc / libs / rallye_functions.php
index d6aaef96f8b3ced669a4605a8e559013dce3ee34..b7cb9d06359eac502f7b96a1a34e2ccf38afabf9 100644 (file)
@@ -94,7 +94,7 @@ function RALLYE_AUTOSTART_RALLYES($result)
 
                // Get refs by userid
                $cnt = RALLYE_GET_REFCOUNT($uid);
 
                // Get refs by userid
                $cnt = RALLYE_GET_REFCOUNT($uid);
-               if (empty($cnt)) $cnt = "0"; // Added prevent some unknown troubles... :-?
+               if (empty($cnt)) $cnt = 0; // Added prevent some unknown troubles... :-?
 
                // Check if line is already included...
                $result_ref = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s AND userid=%s LIMIT 1",
 
                // Check if line is already included...
                $result_ref = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s AND userid=%s LIMIT 1",
@@ -230,7 +230,7 @@ LIMIT 1", array(bigintval($uid), $_CONFIG['ref_payout'], $since), __FILE__, __LI
                list($refpoints) = SQL_FETCHROW($result_ref);
                SQL_FREERESULT($result_ref);
 
                list($refpoints) = SQL_FETCHROW($result_ref);
                SQL_FREERESULT($result_ref);
 
-               if (empty($refpoints)) $refpoints = "0";
+               if (empty($refpoints)) $refpoints = 0;
 
                // And subtract start refs
                $cnt -= $refs;
 
                // And subtract start refs
                $cnt -= $refs;
@@ -316,7 +316,7 @@ VALUES ('%s', '%s', '0')",
                        $DATA['now_t'] = MAKE_DATETIME(time(), "2");
                        $DATA['title'] = $title;
                        $DATA['id']    = $id;  // ID for the rallye details link
                        $DATA['now_t'] = MAKE_DATETIME(time(), "2");
                        $DATA['title'] = $title;
                        $DATA['id']    = $id;  // ID for the rallye details link
-                       $DATA['ref']   = "0";
+                       $DATA['ref']   = 0;
 
                        // Load prices
                        $prices = RALLYE_ADD_PRICES($id);
 
                        // Load prices
                        $prices = RALLYE_ADD_PRICES($id);
@@ -551,7 +551,7 @@ WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p
                list($refpoints) = SQL_FETCHROW($result_ref);
                SQL_FREERESULT($result_ref);
 
                list($refpoints) = SQL_FETCHROW($result_ref);
                SQL_FREERESULT($result_ref);
 
-               if (empty($refpoints)) $refpoints = "0";
+               if (empty($refpoints)) $refpoints = 0;
 
                // Store calculated new refs to array
                $users['uid'][]     = $uid;
 
                // Store calculated new refs to array
                $users['uid'][]     = $uid;
@@ -798,7 +798,7 @@ WHERE s.userid=%s AND s.level=0", array(bigintval($uid)), __FILE__, __LINE__);
                SQL_FREERESULT($result_ref);
                if (empty($cnt))
                {
                SQL_FREERESULT($result_ref);
                if (empty($cnt))
                {
-                       $cnt = "0";
+                       $cnt = 0;
                }
                 else
                {
                }
                 else
                {