<?php
/************************************************************************
- * MXChange v0.2.1 Start: 02/16/2005 *
- * =============== Last change: 01/21/2006 *
+ * Mailer v0.2.1-FINAL Start: 02/16/2005 *
+ * =================== Last change: 01/21/2006 *
* *
* -------------------------------------------------------------------- *
* File : doubler_mails.php *
if (getOutputMode() != 0) return;
// Initialize variables
-$jackpot = 0; $user = 0;
+$jackpot = '0'; $user = '0';
if (isExtensionActive('jackpot')) $jackpot = getJackpotPoints();
// Get total points of the doubler itself
$DOUBLER_POINTS = DOUBLER_GET_TOTAL_POINTS_LEFT();
-if ($DOUBLER_POINTS == 0) {
+if ($DOUBLER_POINTS == '0') {
// Exit here to prevent some SQL errors (SQL_QUERY_ESC doen't insert zeros! We need to fix this...)
return;
} // END - if
unsetGetRequestElement('DOUBLER_UID');
unsetPostRequestElement('DOUBLER_UID');
setSession('DOUBLER_UID', '');
-if (empty($GLOBALS['doubler_userid'])) $GLOBALS['doubler_userid'] = 0;
+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,
$ref = countSumTotalData($content['userid'], 'doubler', 'points', 'refid', false, " AND `completed`='N' AND `is_ref`='Y'");
// Zero refid when empty (might be helpful!)
- if (empty($ref)) $ref = 0;
+ if (empty($ref)) $ref = '0';
if (($ref > 0) && ($GLOBALS['doubler_userid'] == $content['userid']) && (!empty($ref))) {
// Referal points found so add them and set line(s) to completed='Y'
array(bigintval($content['userid'])), __FILE__, __LINE__);
} else {
// No referal points found
- $ref = 0;
+ $ref = '0';
}
// Exclude webmaster from doubling...