X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fdoubler_send.php;h=1fd505799d8808144097bc225d72958b3f79e67a;hp=7bc256c5a17b8be5cba87be4411b1e8850817555;hb=8f60465485bd5e9ab2c0ddfa1f054458cf510042;hpb=cca98f57dff720b174d21d071cee8303462485d7 diff --git a/inc/doubler_send.php b/inc/doubler_send.php index 7bc256c5a1..1fd505799d 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -56,18 +56,18 @@ if (empty($DOUBLER_UID)) $DOUBLER_UID = 0; // Check for doubles which we can pay out $min = bigintval(getConfig('doubler_min') * 2); $result_total = SQL_QUERY_ESC("SELECT DISTINCT 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 +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' +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", array($DOUBLER_POINTS, $min), __FILE__, __LINE__); // Check for accounts with limitation $result_main = SQL_QUERY_ESC("SELECT DISTINCT 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 +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' +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 LIMIT %d", array($DOUBLER_POINTS, $min, getConfig('doubler_max_sent')), __FILE__, __LINE__); @@ -78,7 +78,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) if ((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) $result_load = $result_total; // At least one account was found - while(list($id, $uid, $points, $ip, $time) = SQL_FETCHROW($result_load)) { + while (list($id, $uid, $points, $ip, $time) = SQL_FETCHROW($result_load)) { // Only double when points are enougth! if ($DOUBLER_POINTS >= $points) { // Check for his ref points @@ -89,7 +89,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) if (($ref > 0) && ($DOUBLER_UID == $uid) && (!empty($ref))) { // Referal points found so add them and set line(s) to completed='Y' $points += $ref; - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE refid=%s AND completed='N' AND is_ref='Y'", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE refid=%s AND completed='N' AND is_ref='Y'", array(bigintval($uid)), __FILE__, __LINE__); } else { // No referal points found @@ -103,7 +103,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) } // END - if // Set entry as "payed" - SQL_QUERY_ESC("UPDATE `{!MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE id=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_doubler` SET completed='Y' WHERE id=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__); $OK = false; @@ -133,7 +133,7 @@ if (((SQL_NUMROWS($result_total) > 0) && (getConfig('doubler_sent_all') == "Y")) } // END - if // Update variables to prevent errors - $_CONFIG['doubler_used'] += $points; + incrementConfigEntry('doubler_used', $points); $DOUBLER_POINTS -= $points; // Prepare array