]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/bonus_functions.php
More rewrites to make use of (cached) wrapper functions
[mailer.git] / inc / libs / bonus_functions.php
index 8570debddff4212e612b400c22f323179dddd851..55fb01e9cef71f0766f41a5fcd32eba84d6dd84e 100644 (file)
@@ -151,7 +151,7 @@ function addBonusRanks ($data, $type, $userid) {
        // Load rankings
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
                array($type, $data), __FUNCTION__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Start generating the ranking list
                $max = SQL_NUMROWS($result);
 
@@ -240,7 +240,7 @@ function handleBonusPoints ($mode) {
        // Subtract points from...
        switch (getConfig('bonus_mode')) {
                case 'JACKPOT': // ... jackpot
-                       if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (getConfig('bonus_userid') > 0)) {
+                       if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (isValidUserId(getConfig('bonus_userid')))) {
                                if ($total >= $points) {
                                        // Subtract points from userid's account
                                        subtractPointsFromJackpot('bonus_payout_jackpot', getConfig('bonus_userid'), $points);