]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/doubler_functions.php
Another column fix
[mailer.git] / inc / libs / doubler_functions.php
index 057c76bd039b6131fccd2cc889db66f7af01ffb1..3c44736a4c689bdb9a5b0a8f34b32ae87ce580ef 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
+
 //
-function DOUBLER_GENERATE_TABLE($uid="0", $done="N", $ref="N", $sort="ASC")
+function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC")
 {
-       global $CONFIG;
-       if (empty($cnt)) $cnt = "0";
-       $ADD = ""; $DT_MODE = "0";
+       global $_CONFIG;
+       if (empty($cnt)) $cnt = 0;
+       $ADD = ""; $DT_MODE = 0;
        if ($uid > 0)
        {
                // Load entries only from a single user
@@ -60,17 +60,17 @@ function DOUBLER_GENERATE_TABLE($uid="0", $done="N", $ref="N", $sort="ASC")
        if (($done == "Y") && ($sort == "ASC"))
        {
                // Already payed out points (latest payouts first)
-               $limit = $CONFIG['doubler_display_old'];
+               $limit = $_CONFIG['doubler_display_old'];
        }
         elseif ($sort == "ASC")
        {
                // List entries which will receive their payout soon
-               $limit = $CONFIG['doubler_display_pay'];
+               $limit = $_CONFIG['doubler_display_pay'];
        }
         elseif ($sort == "DESC")
        {
                // Newest entries
-               $limit = $CONFIG['doubler_display_new'];
+               $limit = $_CONFIG['doubler_display_new'];
        }
 
        // List entries
@@ -126,17 +126,17 @@ LIMIT ".$limit, __FILE__, __LINE__);
 //
 function DOUBLER_GET_TOTAL_POINTS_LEFT()
 {
-       global $CONFIG;
+       global $_CONFIG;
        // Initialize variables
-       $points = "0";
+       $points = 0;
 
-       if ($CONFIG['doubler_own'] == "Y")
+       if ($_CONFIG['doubler_own'] == "Y")
        {
                // Take points from doubler's own account
-               $points += $CONFIG['doubler_points'] - $CONFIG['doubler_used'];
+               $points += $_CONFIG['doubler_points'] - $_CONFIG['doubler_used'];
        }
 
-       if ($CONFIG['doubler_jackpot'] == "Y")
+       if ($_CONFIG['doubler_jackpot'] == "Y")
        {
                // Load jackpot
                $result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
@@ -146,10 +146,10 @@ function DOUBLER_GET_TOTAL_POINTS_LEFT()
                if (!empty($jackpot)) $points += $jackpot;
        }
 
-       if ($CONFIG['doubler_uid'] > 0)
+       if ($_CONFIG['doubler_uid'] > 0)
        {
                // Get user's points
-               $user = GET_TOTAL_DATA($CONFIG['doubler_uid'], "user_points", "points");
+               $user = GET_TOTAL_DATA($_CONFIG['doubler_uid'], "user_points", "points");
                $points += $user;
        }