More misc fixes and rewrites (sorry, lame description)
[mailer.git] / inc / libs / task_functions.php
index 78c842db866f7652e2e66b17c2614bce80a862bf..5968a53ddf44eceb011087a8c3ac1cd1ba3f4442 100644 (file)
@@ -321,7 +321,7 @@ ORDER BY d.userid");
 
        if (GET_EXT_VERSION('bonus') >= '0.8.7') {
                // List all notifications
-               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_bonus` WHERE is_notify='Y' ORDER BY timestamp DESC");
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_bonus` WHERE `is_notify`='Y' ORDER BY `timestamp` DESC");
                $WHATs[]  = 'list_notifications';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_NOTIFICATIONS');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_NOTIFICATIONS_TITLE');
@@ -352,8 +352,8 @@ ORDER BY d.userid");
 
                ADD_SQL("SELECT ".$USE." AS points
 FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE `status`='CONFIRMED' AND ".$USE.">0".$lastOnline."
-ORDER BY points DESC, userid");
+WHERE `status`='CONFIRMED' AND ".$USE." > 0".$lastOnline."
+ORDER BY points DESC, `userid` ASC");
                $WHATs[]  = 'list_bonus';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_BONUS');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_BONUS_TITLE');
@@ -370,8 +370,8 @@ ORDER BY points DESC, userid");
                }
 
                ADD_SQL("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data`
-WHERE `status`='CONFIRMED' AND beg_points>0".$lastOnline."
-ORDER BY beg_points DESC, userid");
+WHERE `status`='CONFIRMED' AND `beg_points` > 0".$lastOnline."
+ORDER BY `beg_points` DESC, `userid` ASC");
                $WHATs[]  = 'list_beg';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_BEG');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_BEG_TITLE');
@@ -379,7 +379,7 @@ ORDER BY beg_points DESC, userid");
 
        if (EXT_IS_ACTIVE('doubler')) {
                // List waiting payouts
-               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_doubler` WHERE completed='N' ORDER BY `id`");
+               ADD_SQL("SELECT `id` FROM `{!_MYSQL_PREFIX!}_doubler` WHERE `completed`='N' ORDER BY `id`");
                $WHATs[]  = 'list_doubler&mode=waiting&select=all';
                $DESCRs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_WAITING');
                $TITLEs[] = getMessage('ADMIN_TASK_LIST_DOUBLER_WAITING_TITLE');