Unknown module in non-HTML mode, debug comments removed :(
[mailer.git] / inc / mails / doubler_mails.php
index 6279fd2..6985238 100644 (file)
@@ -64,24 +64,44 @@ setSession('DOUBLER_UID', '');
 if (empty($GLOBALS['doubler_userid'])) $GLOBALS['doubler_userid'] = '0';
 
 // Check for doubles which we can pay out
-$result_total = SQL_QUERY_ESC("SELECT d.id, d.userid, d.points, d.remote_ip, d.timemark
-FROM `{?_MYSQL_PREFIX?}_doubler` AS d
-LEFT JOIN `{?_MYSQL_PREFIX?}_user_data` AS u
-ON d.userid=u.userid
-WHERE u.`status`='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N'
-ORDER BY d.timemark",
+$result_total = SQL_QUERY_ESC("SELECT
+       d.id, d.userid, d.points, d.remote_ip, d.timemark
+FROM
+       `{?_MYSQL_PREFIX?}_doubler` AS d
+LEFT JOIN
+       `{?_MYSQL_PREFIX?}_user_data` AS u
+ON
+       d.userid=u.userid
+WHERE
+       u.`status`='CONFIRMED' AND
+       d.points <= %s AND
+       d.points >= %s AND
+       d.completed='N' AND
+       d.is_ref='N'
+ORDER BY
+       d.timemark ASC",
        array(
                $DOUBLER_POINTS,
                getConfig(('doubler_min') * 2)
        ), __FILE__, __LINE__);
 
 // Check for accounts with limitation
-$result_main = SQL_QUERY_ESC("SELECT d.id, d.userid, d.points, d.remote_ip, d.timemark
-FROM `{?_MYSQL_PREFIX?}_doubler` AS d
-LEFT JOIN `{?_MYSQL_PREFIX?}_user_data` AS u
-ON d.userid=u.userid
-WHERE u.`status`='CONFIRMED' AND d.points <= %s AND d.points >= %s AND d.completed='N' AND d.is_ref='N'
-ORDER BY d.timemark
+$result_main = SQL_QUERY_ESC("SELECT
+       d.id, d.userid, d.points, d.remote_ip, d.timemark
+FROM
+       `{?_MYSQL_PREFIX?}_doubler` AS d
+LEFT JOIN
+       `{?_MYSQL_PREFIX?}_user_data` AS u
+ON
+       d.userid=u.userid
+WHERE
+       u.`status`='CONFIRMED' AND
+       d.points <= %s AND
+       d.points >= %s AND
+       d.completed='N' AND
+       d.is_ref='N'
+ORDER BY
+       d.timemark ASC
 LIMIT %d",
        array(
                $DOUBLER_POINTS,