]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/doubler_functions.php
Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / libs / doubler_functions.php
index 9734b6037790c1779dfbd048a808ecaa6c2f1b40..4e312104a49ad68fe62b0580d1d75380edcbe135 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -67,7 +67,7 @@ function generateDoublerTable ($userid = NULL, $done = 'N', $ref = 'N', $sort =
        }
 
        // List entries
-       $result = SQL_QUERY_ESC("SELECT
+       $result = sqlQueryEscaped("SELECT
        `userid`,
        `refid`,
        `points`,
@@ -88,10 +88,10 @@ LIMIT %s",
                        $limit
                ), __FUNCTION__, __LINE__);
 
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNums($result)) {
                // List entries
                $OUT = '';
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Rewrite userid/refid only if admin is in
                        // @TODO Can't this be moved into EL?
                        if (isAdmin()) {
@@ -112,7 +112,7 @@ LIMIT %s",
                } // END - while
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
        } else {
                // List no entries
                $OUT = '<tr>
@@ -127,6 +127,7 @@ LIMIT %s",
 }
 
 // Get total points left in doubler pot
+// @TODO This could be rewritten to a filter
 function getDoublerTotalPointsLeft() {
        // Initialize variables
        $points = '0';
@@ -137,16 +138,13 @@ function getDoublerTotalPointsLeft() {
        } // END - if
 
        if ((getConfig('doubler_jackpot') == 'Y') && (isExtensionActive('jackpot'))) {
-               // Load jackpot
-               $jackpot = getJackpotPoints();
-
-               if (!empty($jackpot)) $points += $jackpot;
+               // Get+add jackpot points
+               $points += getJackpotPoints();
        } // END - if
 
        if (isValidId(getDoublerUserid())) {
                // Get user's points
-               $user = getTotalPoints(getDoublerUserid());
-               $points += $user;
+               $points += getTotalPoints(getDoublerUserid());
        } // END - if
 
        // Return value