]> git.mxchange.org Git - mailer.git/blobdiff - inc/mails/doubler_mails.php
Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / mails / doubler_mails.php
index cac484c09848416e2e65b9c75d9bc2fdb93c0f4e..92606bfba89f384615ec89d93ae5f38633684f29 100644 (file)
@@ -58,7 +58,7 @@ if (isExtensionActive('jackpot')) {
 // Get total points of the doubler itself
 $totalPoints = getDoublerTotalPointsLeft();
 if ($totalPoints == '0') {
-       // Exit here to prevent some SQL errors (SQL_QUERY_ESC doen't insert zeros! We need to fix this...)
+       // Exit here to prevent some SQL errors (sqlQueryEscaped doen't insert zeros! We need to fix this...)
        return;
 } // END - if
 
@@ -79,7 +79,7 @@ if (isExtensionActive('holiday')) {
 } // END - if
 
 // Check for doubles which we can pay out
-$result_total = SQL_QUERY_ESC("SELECT
+$result_total = sqlQueryEscaped("SELECT
        COUNT(`do`.`id`) AS `cnt`,
 FROM
        `{?_MYSQL_PREFIX?}_doubler` AS `do`
@@ -101,13 +101,13 @@ ORDER BY
        ), __FILE__, __LINE__);
 
 // Get total count
-list($totalCount) = SQL_FETCHROW($result_total);
+list($totalCount) = sqlFetchRow($result_total);
 
 // Free memory
-SQL_FREERESULT($result_total);
+sqlFreeResult($result_total);
 
 // Check for accounts with limitation
-$result_main = SQL_QUERY_ESC("SELECT
+$result_main = sqlQueryEscaped("SELECT
        `do`.`id`,
        `do`.`userid`,
        `do`.`points`,
@@ -134,7 +134,7 @@ LIMIT {?doubler_max_sent?}",
        ), __FILE__, __LINE__);
 
 // Are there entries found?
-if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMROWS($result_main) == getConfig('doubler_group_sent')) && (getConfig('doubler_sent_all') != 'Y'))) {
+if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((sqlNumRows($result_main) == getConfig('doubler_group_sent')) && (getConfig('doubler_sent_all') != 'Y'))) {
        // Switch to matching SQL resource
        $result_load = $result_main;
        if (($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) {
@@ -142,7 +142,7 @@ if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMRO
        } // END - if
 
        // At least one account was found
-       while ($content = SQL_FETCHARRAY($result_load)) {
+       while ($content = sqlFetchArray($result_load)) {
                // Only double when points are enougth!
                if ($totalPoints >= $content['points']) {
                        // Check for his ref points
@@ -156,7 +156,7 @@ if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMRO
                        if (($refPoints > 0) && ($GLOBALS['local_doubler_userid'] == $content['userid']) && (!empty($refPoints))) {
                                // Referral points found so add them and set line(s) to completed='Y'
                                $content['points'] += $refPoints;
-                               SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_doubler` SET `completed`='Y' WHERE `refid`=%s AND `completed`='N' AND `is_ref`='Y'",
+                               sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_doubler` SET `completed`='Y' WHERE `refid`=%s AND `completed`='N' AND `is_ref`='Y'",
                                        array(bigintval($content['userid'])), __FILE__, __LINE__);
                        } else {
                                // No referral points found
@@ -171,7 +171,7 @@ if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMRO
                        } // END - if
 
                        // Set entry as "payed"
-                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_doubler` SET `completed`='Y' WHERE `id`=%s LIMIT 1",
+                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_doubler` SET `completed`='Y' WHERE `id`=%s LIMIT 1",
                                array(bigintval($content['id'])), __FILE__, __LINE__);
 
                        $okay = FALSE;
@@ -210,8 +210,8 @@ if ((($totalCount > 0) && (getConfig('doubler_sent_all') == 'Y')) || ((SQL_NUMRO
 } // END - if
 
 // Free memory
-SQL_FREERESULT($result_total);
-SQL_FREERESULT($result_main);
+sqlFreeResult($result_total);
+sqlFreeResult($result_main);
 
 // [EOF]
 ?>