]> git.mxchange.org Git - mailer.git/blobdiff - inc/monthly/monthly_bonus.php
Missing column 'active_bonus' fixed, some while() loops rewritten
[mailer.git] / inc / monthly / monthly_bonus.php
index c11ad3c823703cee6d2a9e64e5cd969416ddeacf..1ac1f05ea0fc25136d7048d42bf51dee516daa34 100644 (file)
@@ -78,7 +78,8 @@ if (($curr != $_CONFIG['last_month']) && ($_CONFIG['bonus_ranks'] > 0) && ($CSS
        $result_main = SQL_QUERY_ESC("SELECT userid, email, gender, surname, family, (0".$ADD.") AS points
 FROM "._MYSQL_PREFIX."_user_data
 ".$whereStatement1."".$ADD."
-ORDER BY active_bonus DESC, userid LIMIT %s",
+ORDER BY points DESC, userid
+LIMIT %s",
                array($whereStatement2), __FILE__, __LINE__);
 
        // Some entries were found?
@@ -88,10 +89,10 @@ ORDER BY active_bonus DESC, userid LIMIT %s",
                        // Make sure zero points are not mailed
                        if ($content['points'] > 0) {
                                // Add points to user's account directly
-                               ADD_POINTS_REFSYSTEM($content['uid'], $content['points'], false, "0", false, "direct");
+                               ADD_POINTS_REFSYSTEM("monthly_bonus", $content['uid'], $content['points'], false, "0", false, "direct");
 
                                // Translate gender/points
-                               $content['gender'] = TRANSLATE_GENDER($content['gender']);
+                               $content['gender']       = TRANSLATE_GENDER($content['gender']);
                                $content['points'] = TRANSLATE_COMMA($content['points']);
 
                                // Load email template and email it away