]> git.mxchange.org Git - mailer.git/commitdiff
Reset rewritten, SQL fixed, zeros are now numeric
authorRoland Häder <roland@mxchange.org>
Fri, 12 Sep 2008 16:51:08 +0000 (16:51 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 12 Sep 2008 16:51:08 +0000 (16:51 +0000)
47 files changed:
.gitattributes
beg.php
doubler.php
inc/autopurge.php
inc/check-reset.php [new file with mode: 0644]
inc/databases.php
inc/db/lib-mysql3.php
inc/doubler_send.php
inc/functions.php
inc/gen_mediadata.php
inc/libs/admins_functions.php
inc/libs/autopurge_functions.php
inc/libs/bonus_functions.php
inc/libs/cache_functions.php
inc/libs/doubler_functions.php
inc/libs/rallye_functions.php
inc/libs/sponsor_functions.php
inc/libs/surfbar_functions.php
inc/libs/task_functions.php
inc/libs/user_functions.php
inc/modules/admin/what-admins_mails.php
inc/modules/admin/what-del_transfer.php
inc/modules/admin/what-email_details.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-list_payouts.php
inc/modules/admin/what-list_rallyes.php
inc/modules/admin/what-list_sponsor.php
inc/modules/admin/what-list_transfer.php
inc/modules/admin/what-list_unconfirmed.php
inc/modules/admin/what-send_bonus.php
inc/modules/admin/what-theme_check.php
inc/modules/admin/what-updates.php
inc/modules/guest/what-login.php
inc/modules/guest/what-mediadata.php
inc/modules/member/what-order.php
inc/modules/member/what-payout.php
inc/modules/member/what-points.php
inc/modules/member/what-transfer.php
inc/modules/member/what-unconfirmed.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/patch-system.php
inc/pool-update.php
inc/reset/reset_daily.php
inc/session.php
mailid_top.php
ref.php

index ee112d0aa861d74f9edb85e81a25ee9f6f7c0aa8..98ad788718d16b52220ff304e423073a816e16a0 100644 (file)
@@ -79,6 +79,7 @@ inc/.htaccess -text
 inc/.secret/.htaccess -text
 inc/autopurge.php -text
 inc/cache/.htaccess -text
 inc/.secret/.htaccess -text
 inc/autopurge.php -text
 inc/cache/.htaccess -text
+inc/check-reset.php -text
 inc/config.php -text
 inc/databases.php -text
 inc/db/.htaccess -text
 inc/config.php -text
 inc/databases.php -text
 inc/db/.htaccess -text
diff --git a/beg.php b/beg.php
index a7e4e82aefd70298ab8ad6666bfb94da68145331..d207d5cf542a3e959cc5d853b64a7efb3dba2822 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -103,7 +103,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                                define('__BEG_POINTS', TRANSLATE_COMMA($points));
                        } else {
                                // Other status
                                define('__BEG_POINTS', TRANSLATE_COMMA($points));
                        } else {
                                // Other status
-                               $uid = "0";
+                               $uid = 0;
                        }
                }
 
                        }
                }
 
index 53ee0682606feaf46f0c85fdc7c85c76fcc8ead3..eab1a6d5335985ee2cc2864e6467bcfec461523e 100644 (file)
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 // Set module
 $GLOBALS['module'] = "doubler";
 $GLOBALS['refid'] = 0;
 // Set module
 $GLOBALS['module'] = "doubler";
 $GLOBALS['refid'] = 0;
-$CSS = "0";
+$CSS = 0;
 
 // Load the required file(s)
 require ("inc/config.php");
 
 // Load the required file(s)
 require ("inc/config.php");
index 6873a1542ad1cb5345402087602c28d2bfbf5d44..a0896be2c32a52c8911a8af81318a8ada6c813bd 100644 (file)
@@ -51,7 +51,7 @@ if (($_CONFIG['auto_purge_active'] == "Y") && ($_CONFIG['auto_purge'] > 0))
        }
 
        // Init variables
        }
 
        // Init variables
-       $admin_points = "0";
+       $admin_points = 0;
 
        // Then check for outdated mail order. We don't delete them just the confirmation links will be deleted.
        $result = SQL_QUERY_ESC("SELECT s.id, s.userid, s.pool_id, t.price
 
        // Then check for outdated mail order. We don't delete them just the confirmation links will be deleted.
        $result = SQL_QUERY_ESC("SELECT s.id, s.userid, s.pool_id, t.price
@@ -63,7 +63,7 @@ WHERE s.timestamp_ordered <= %s ORDER BY s.userid",
        if (SQL_NUMROWS($result) > 0)
        {
                // Start deleting procedure
        if (SQL_NUMROWS($result) > 0)
        {
                // Start deleting procedure
-               $uid = "0"; $points = "0";
+               $uid = 0; $points = 0;
                while(list($mid, $sender, $pool, $price) = SQL_FETCHROW($result))
                {
                        // Check if confirmation links are purged or not
                while(list($mid, $sender, $pool, $price) = SQL_FETCHROW($result))
                {
                        // Check if confirmation links are purged or not
@@ -79,7 +79,7 @@ WHERE s.timestamp_ordered <= %s ORDER BY s.userid",
                                {
                                        // Directly add points back to senders account
                                        AUTOPURGE_ADD_POINTS($uid, $points);
                                {
                                        // Directly add points back to senders account
                                        AUTOPURGE_ADD_POINTS($uid, $points);
-                                       $points = "0";
+                                       $points = 0;
                                }
                                // Add points
                                $uid = $sender; $points += $price; $admin_points += $price;
                                }
                                // Add points
                                $uid = $sender; $points += $price; $admin_points += $price;
@@ -110,7 +110,7 @@ WHERE s.timestamp_ordered <= %s ORDER BY s.userid",
                if (SQL_NUMROWS($result) > 0)
                {
                        // Start deleting procedure
                if (SQL_NUMROWS($result) > 0)
                {
                        // Start deleting procedure
-                       $points = "0";
+                       $points = 0;
                        while (list($bid, $price) = SQL_FETCHROW($result))
                        {
                                // Check if confirmation links are purged or not
                        while (list($bid, $price) = SQL_FETCHROW($result))
                        {
                                // Check if confirmation links are purged or not
diff --git a/inc/check-reset.php b/inc/check-reset.php
new file mode 100644 (file)
index 0000000..7596a8d
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/12/2008 *
+ * ===============                              Last change: 09/12/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : check-reset.php                                  *
+ * -------------------------------------------------------------------- *
+ * Short description : Checks for if reset shall be executed            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Prueft ob Reset laufen soll                      *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// 01    2                            2        2         3321    1                         2                     21    1                        2                    21    1                        2                  21    1      2                 21    1         10
+if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
+       // Do daily things in external PHP file but only when script is completely setup
+       // Daily reset was run!
+       define('__DAILY_RESET', true);
+
+       // Add more includes
+       $INC_POOL = RESET_ADD_INCLUDES();
+
+       // Run the full reset scripts
+       foreach ($INC_POOL as $incFile) {
+               require_once($incFile);
+       } // END - foreach
+} // END - if
+
+//
+?>
index 28f1bb91541e5207b47020bd9bc2b60f2536936f..a5f1522c60fcc09fa2c98ec668e0a35b6797a3e6 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_SVN_REVISION', "308");
+define('CURR_SVN_REVISION', "309");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index dbc65715064067207997c72f3a7a501167972a0a..f09301c9b48e104e4e22049d8b78ce3cb79dbdd5 100644 (file)
@@ -105,10 +105,10 @@ function SQL_NUMROWS($result) {
                $lines = @mysql_num_rows($result);
 
                // Is the result empty? Then we have an error!
                $lines = @mysql_num_rows($result);
 
                // Is the result empty? Then we have an error!
-               if (empty($lines)) $lines = "0";
+               if (empty($lines)) $lines = 0;
        } else {
                // No resource given, no lines found!
        } else {
                // No resource given, no lines found!
-               $lines = "0";
+               $lines = 0;
        }
        return $lines;
 }
        }
        return $lines;
 }
index 71685ced4ea0542deff4ce7aae370565676ce932..1fe8475e0f8815581edfc0dde7f5bf0febe1640b 100644 (file)
@@ -38,7 +38,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
 }
 
 // Initialize variables
 }
 
 // Initialize variables
-$jackpot = "0"; $user = "0";
+$jackpot = 0; $user = 0;
 
 // Get total points of the doubler itself
 $DOUBLER_POINTS = DOUBLER_GET_TOTAL_POINTS_LEFT();
 
 // Get total points of the doubler itself
 $DOUBLER_POINTS = DOUBLER_GET_TOTAL_POINTS_LEFT();
@@ -51,7 +51,7 @@ if ($DOUBLER_POINTS == 0) {
 unset($_GET['DOUBLER_UID']);
 unset($_POST['DOUBLER_UID']);
 set_session('DOUBLER_UID', "");
 unset($_GET['DOUBLER_UID']);
 unset($_POST['DOUBLER_UID']);
 set_session('DOUBLER_UID', "");
-if (empty($DOUBLER_UID)) $DOUBLER_UID = "0";
+if (empty($DOUBLER_UID)) $DOUBLER_UID = 0;
 
 // Check for doubles which we can pay out
 $min = bigintval($_CONFIG['doubler_min'] * 2);
 
 // Check for doubles which we can pay out
 $min = bigintval($_CONFIG['doubler_min'] * 2);
@@ -103,7 +103,7 @@ if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y"))
                         else
                        {
                                // No referral points found
                         else
                        {
                                // No referral points found
-                               $ref = "0";
+                               $ref = 0;
                        }
 
                        // Exclude webmaster from doubling...
                        }
 
                        // Exclude webmaster from doubling...
index 6484f86506c605f8010c22e206c570b431cd0c14..8b416e865c721fa80ad535632a30afbe752e7a18 100644 (file)
@@ -597,7 +597,7 @@ function FRAMETESTER($URL) {
 }
 //
 function SELECTION_COUNT($array) {
 }
 //
 function SELECTION_COUNT($array) {
-       $ret = "0";
+       $ret = 0;
        if (is_array($array)) {
                foreach ($array as $key => $sel) {
                        if (!empty($sel)) $ret++;
        if (is_array($array)) {
                foreach ($array as $key => $sel) {
                        if (!empty($sel)) $ret++;
@@ -1090,7 +1090,7 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0")
        case "day": // Day
                for ($idx = 1; $idx < 32; $idx++)
                {
        case "day": // Day
                for ($idx = 1; $idx < 32; $idx++)
                {
-                       $OUT .= "      <OPTION value=\"".$idx."\"";
+                       $OUT .= "<OPTION value=\"".$idx."\"";
                        if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                        $OUT .= ">".$idx."</OPTION>\n";
                }
                        if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                        $OUT .= ">".$idx."</OPTION>\n";
                }
@@ -1099,7 +1099,7 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0")
        case "month": // Month
                foreach ($MONTH_DESCR as $month => $descr)
                {
        case "month": // Month
                foreach ($MONTH_DESCR as $month => $descr)
                {
-                       $OUT .= "      <OPTION value=\"".$month."\"";
+                       $OUT .= "<OPTION value=\"".$month."\"";
                        if ($DEFAULT == $month) $OUT .= " selected=\"selected\"";
                        $OUT .= ">".$descr."</OPTION>\n";
                }
                        if ($DEFAULT == $month) $OUT .= " selected=\"selected\"";
                        $OUT .= ">".$descr."</OPTION>\n";
                }
@@ -1114,7 +1114,7 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0")
                {
                        for ($idx = $YEAR; $idx < ($YEAR + 11); $idx++)
                        {
                {
                        for ($idx = $YEAR; $idx < ($YEAR + 11); $idx++)
                        {
-                               $OUT .= "      <OPTION value=\"".$idx."\"";
+                               $OUT .= "<OPTION value=\"".$idx."\"";
                                if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                                if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
@@ -1124,17 +1124,17 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0")
                        // Current year minus 1
                        for ($idx = 2003; $idx <= ($YEAR + 1); $idx++)
                        {
                        // Current year minus 1
                        for ($idx = 2003; $idx <= ($YEAR + 1); $idx++)
                        {
-                               $OUT .= "      <OPTION value=\"".$idx."\">".$idx."</OPTION>\n";
+                               $OUT .= "<OPTION value=\"".$idx."\">".$idx."</OPTION>\n";
                        }
                }
                 else
                {
                        // Get current year and subtract 16 (for erotic content)
                        }
                }
                 else
                {
                        // Get current year and subtract 16 (for erotic content)
-                       $OUT .= "      <OPTION value=\"1929\">&lt;1930</OPTION>\n";
+                       $OUT .= "<OPTION value=\"1929\">&lt;1930</OPTION>\n";
                        $YEAR = date('Y', time()) - 16;
                        for ($idx = 1930; $idx <= $YEAR; $idx++)
                        {
                        $YEAR = date('Y', time()) - 16;
                        for ($idx = 1930; $idx <= $YEAR; $idx++)
                        {
-                               $OUT .= "      <OPTION value=\"".$idx."\"";
+                               $OUT .= "<OPTION value=\"".$idx."\"";
                                if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                                if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
@@ -1143,30 +1143,27 @@ function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0")
 
        case "sec":
        case "min":
 
        case "sec":
        case "min":
-               for ($idx = 0; $idx < 60; $idx+=5)
-               {
+               for ($idx = 0; $idx < 60; $idx+=5) {
                        if (strlen($idx) == 1) $idx = "0".$idx;
                        if (strlen($idx) == 1) $idx = "0".$idx;
-                       $OUT .= "      <OPTION value=\"".$idx."\"";
+                       $OUT .= "<OPTION value=\"".$idx."\"";
                        if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                        $OUT .= ">".$idx."</OPTION>\n";
                }
                break;
 
        case "hour":
                        if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                        $OUT .= ">".$idx."</OPTION>\n";
                }
                break;
 
        case "hour":
-               for ($idx = 0; $idx < 24; $idx++)
-               {
+               for ($idx = 0; $idx < 24; $idx++) {
                        if (strlen($idx) == 1) $idx = "0".$idx;
                        if (strlen($idx) == 1) $idx = "0".$idx;
-                       $OUT .= "      <OPTION value=\"".$idx."\"";
+                       $OUT .= "<OPTION value=\"".$idx."\"";
                        if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                        $OUT .= ">".$idx."</OPTION>\n";
                }
                break;
 
        case "yn":
                        if ($DEFAULT == $idx) $OUT .= " selected=\"selected\"";
                        $OUT .= ">".$idx."</OPTION>\n";
                }
                break;
 
        case "yn":
-               $OUT .= "      <OPTION value=\"Y\"";
+               $OUT .= "<OPTION value=\"Y\"";
                if ($DEFAULT == "Y") $OUT .= " selected=\"selected\"";
                if ($DEFAULT == "Y") $OUT .= " selected=\"selected\"";
-               $OUT .= ">".YES."</OPTION>
-                       <OPTION value=\"N\"";
+               $OUT .= ">".YES."</OPTION>\n<OPTION value=\"N\"";
                if ($DEFAULT == "N") $OUT .= " selected=\"selected\"";
                $OUT .= ">".NO."</OPTION>\n";
                break;
                if ($DEFAULT == "N") $OUT .= " selected=\"selected\"";
                $OUT .= ">".NO."</OPTION>\n";
                break;
@@ -1302,17 +1299,20 @@ function GENERATE_IMAGE($img_code, $header=true) {
        // Remove image from memory
        imagedestroy($image);
 }
        // Remove image from memory
        imagedestroy($image);
 }
-function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="center", $return_array=false)
-{
+// Create selection box or array of splitted timestamp
+function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="center", $return_array=false) {
        // Calculate 15-seconds timestamp (15-seconds-steps shall be fine ;) )
        $timestamp = round($timestamp / 15) * 15;
        // Calculate 15-seconds timestamp (15-seconds-steps shall be fine ;) )
        $timestamp = round($timestamp / 15) * 15;
+
        // Do we have a leap year?
        $SWITCH = 0;
        $TEST = date('Y', time()) / 4;
        $M1 = date("m", time());
        $M2 = date("m", (time() + $timestamp));
        // Do we have a leap year?
        $SWITCH = 0;
        $TEST = date('Y', time()) / 4;
        $M1 = date("m", time());
        $M2 = date("m", (time() + $timestamp));
+
        // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
        if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02"))  $SWITCH = ONE_DAY;
        // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
        if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02"))  $SWITCH = ONE_DAY;
+
        // First of all years...
        $Y = abs(floor($timestamp / (31536000 + $SWITCH)));
        // Next months...
        // First of all years...
        $Y = abs(floor($timestamp / (31536000 + $SWITCH)));
        // Next months...
@@ -1327,11 +1327,11 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen
        $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / ONE_DAY) * 24 * 60 - ($M / 12 * (365 + $SWITCH / ONE_DAY) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
        // And at last seconds...
        $s = abs(floor($timestamp - $Y * (365 + $SWITCH / ONE_DAY) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / ONE_DAY) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
        $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / ONE_DAY) * 24 * 60 - ($M / 12 * (365 + $SWITCH / ONE_DAY) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
        // And at last seconds...
        $s = abs(floor($timestamp - $Y * (365 + $SWITCH / ONE_DAY) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / ONE_DAY) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
+
        //
        // Now we convert them in seconds...
        //
        //
        // Now we convert them in seconds...
        //
-       if ($return_array)
-       {
+       if ($return_array) {
                // Just put all data in an array for later use
                $OUT = array(
                        'YEARS'   => $Y,
                // Just put all data in an array for later use
                $OUT = array(
                        'YEARS'   => $Y,
@@ -1342,61 +1342,57 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen
                        'MINUTES' => $m,
                        'SECONDS' => $s
                );
                        'MINUTES' => $m,
                        'SECONDS' => $s
                );
-       }
-        else
-       {
+       } else {
                // Generate table
                $OUT  = "<DIV align=\"".$align."\">\n";
                $OUT .= "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_table dashed\">\n";
                $OUT .= "<TR>\n";
                // Generate table
                $OUT  = "<DIV align=\"".$align."\">\n";
                $OUT .= "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_table dashed\">\n";
                $OUT .= "<TR>\n";
-               if (ereg('Y', $display) || (empty($display)))
-               {
+
+               if (ereg('Y', $display) || (empty($display))) {
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._YEARS."</STRONG></TD>\n";
                }
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._YEARS."</STRONG></TD>\n";
                }
-               if (ereg("M", $display) || (empty($display)))
-               {
+
+               if (ereg("M", $display) || (empty($display))) {
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._MONTHS."</STRONG></TD>\n";
                }
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._MONTHS."</STRONG></TD>\n";
                }
-               if (ereg("W", $display) || (empty($display)))
-               {
+
+               if (ereg("W", $display) || (empty($display))) {
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._WEEKS."</STRONG></TD>\n";
                }
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._WEEKS."</STRONG></TD>\n";
                }
-               if (ereg("D", $display) || (empty($display)))
-               {
+
+               if (ereg("D", $display) || (empty($display))) {
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._DAYS."</STRONG></TD>\n";
                }
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._DAYS."</STRONG></TD>\n";
                }
-               if (ereg("h", $display) || (empty($display)))
-               {
+
+               if (ereg("h", $display) || (empty($display))) {
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._HOURS."</STRONG></TD>\n";
                }
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._HOURS."</STRONG></TD>\n";
                }
-               if (ereg("m", $display) || (empty($display)))
-               {
+
+               if (ereg("m", $display) || (empty($display))) {
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._MINUTES."</STRONG></TD>\n";
                }
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._MINUTES."</STRONG></TD>\n";
                }
-               if (ereg("s", $display) || (empty($display)))
-               {
+
+               if (ereg("s", $display) || (empty($display))) {
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._SECONDS."</STRONG></TD>\n";
                }
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._SECONDS."</STRONG></TD>\n";
                }
+
                $OUT .= "</TR>\n";
                $OUT .= "<TR>\n";
                $OUT .= "</TR>\n";
                $OUT .= "<TR>\n";
-               if (ereg('Y', $display) || (empty($display)))
-               {
+
+               if (ereg('Y', $display) || (empty($display))) {
                        // Generate year selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ye\" size=\"1\">\n";
                        // Generate year selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ye\" size=\"1\">\n";
-                       for ($idx = 0; $idx <= 10; $idx++)
-                       {
+                       for ($idx = 0; $idx <= 10; $idx++) {
                                $OUT .= "    <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $Y) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
                                $OUT .= "    <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $Y) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
-               }
-                else
-               {
+               } else {
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ye\" value=\"0\">\n";
                }
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ye\" value=\"0\">\n";
                }
-               if (ereg("M", $display) || (empty($display)))
-               {
+
+               if (ereg("M", $display) || (empty($display))) {
                        // Generate month selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_mo\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 11; $idx++)
                        // Generate month selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_mo\" size=\"1\">\n";
                        for ($idx = 0; $idx <= 11; $idx++)
@@ -1406,89 +1402,72 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
-               }
-                else
-               {
+               } else {
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mo\" value=\"0\">\n";
                }
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mo\" value=\"0\">\n";
                }
-               if (ereg("W", $display) || (empty($display)))
-               {
+
+               if (ereg("W", $display) || (empty($display))) {
                        // Generate week selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_we\" size=\"1\">\n";
                        // Generate week selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_we\" size=\"1\">\n";
-                       for ($idx = 0; $idx <= 4; $idx++)
-                       {
+                       for ($idx = 0; $idx <= 4; $idx++) {
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $W) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $W) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
-               }
-                else
-               {
+               } else {
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_we\" value=\"0\">\n";
                }
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_we\" value=\"0\">\n";
                }
-               if (ereg("D", $display) || (empty($display)))
-               {
+
+               if (ereg("D", $display) || (empty($display))) {
                        // Generate day selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_da\" size=\"1\">\n";
                        // Generate day selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_da\" size=\"1\">\n";
-                       for ($idx = 0; $idx <= 31; $idx++)
-                       {
+                       for ($idx = 0; $idx <= 31; $idx++) {
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $D) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $D) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
-               }
-                else
-               {
+               } else {
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_da\" value=\"0\">\n";
                }
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_da\" value=\"0\">\n";
                }
-               if (ereg("h", $display) || (empty($display)))
-               {
+
+               if (ereg("h", $display) || (empty($display))) {
                        // Generate hour selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ho\" size=\"1\">\n";
                        // Generate hour selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ho\" size=\"1\">\n";
-                       for ($idx = 0; $idx <= 23; $idx++)
-                       {
+                       for ($idx = 0; $idx <= 23; $idx++)      {
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $h) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $h) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
-               }
-                else
-               {
+               } else {
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ho\" value=\"0\">\n";
                }
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_ho\" value=\"0\">\n";
                }
-               if (ereg("m", $display) || (empty($display)))
-               {
+
+               if (ereg("m", $display) || (empty($display))) {
                        // Generate minute selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_mi\" size=\"1\">\n";
                        // Generate minute selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_mi\" size=\"1\">\n";
-                       for ($idx = 0; $idx <= 59; $idx++)
-                       {
+                       for ($idx = 0; $idx <= 59; $idx++) {
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $m) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $m) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
-               }
-                else
-               {
+               } else {
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mi\" value=\"0\">\n";
                }
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_mi\" value=\"0\">\n";
                }
-               if (ereg("s", $display) || (empty($display)))
-               {
+
+               if (ereg("s", $display) || (empty($display))) {
                        // Generate second selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_se\" size=\"1\">\n";
                        // Generate second selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_se\" size=\"1\">\n";
-                       for ($idx = 0; $idx <= 45; $idx+=15)
-                       {
+                       for ($idx = 0; $idx <= 45; $idx += 15) {
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $s) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $s) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
                        }
                        $OUT .= "  </SELECT></TD>\n";
-               }
-                else
-               {
+               } else {
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_se\" value=\"0\">\n";
                }
                $OUT .= "</TR>\n";
                        $OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_se\" value=\"0\">\n";
                }
                $OUT .= "</TR>\n";
@@ -1500,7 +1479,8 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen
 }
 //
 function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) {
 }
 //
 function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) {
-       $ret = "0";
+       $ret = 0;
+
        // Do we have a leap year?
        $SWITCH = 0;
        $TEST = date('Y', time()) / 4;
        // Do we have a leap year?
        $SWITCH = 0;
        $TEST = date('Y', time()) / 4;
@@ -2365,7 +2345,7 @@ function GET_DIR_AS_ARRAY ($baseDir, $prefix) {
 }
 // Load more reset scripts
 function RESET_ADD_INCLUDES () {
 }
 // Load more reset scripts
 function RESET_ADD_INCLUDES () {
-       global $_CONFIG, $INC_POOL;
+       global $_CONFIG;
 
        // Is the reset set or old sql_patches?
        if ((!isBooleanConstantAndTrue('__DAILY_RESET')) || (GET_EXT_VERSION("sql_patches") < "0.4.5")) {
 
        // Is the reset set or old sql_patches?
        if ((!isBooleanConstantAndTrue('__DAILY_RESET')) || (GET_EXT_VERSION("sql_patches") < "0.4.5")) {
@@ -2374,7 +2354,7 @@ function RESET_ADD_INCLUDES () {
        } // END - if
 
        // Get more daily reset scripts
        } // END - if
 
        // Get more daily reset scripts
-       $INC_POOL = array_merge($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/reset/", "reset_"));
+       $INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/reset/", "reset_");
 
        // Create current week mark
        $currWeek = date("W", time());
 
        // Create current week mark
        $currWeek = date("W", time());
@@ -2399,6 +2379,9 @@ function RESET_ADD_INCLUDES () {
                // Update config
                UPDATE_CONFIG("last_month", $currMonth);
        } // END - if
                // Update config
                UPDATE_CONFIG("last_month", $currMonth);
        } // END - if
+
+       // Return array
+       return $INC_POOL;
 }
 // Handle extra values
 function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) {
 }
 // Handle extra values
 function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) {
index 07d1e7a7e9d04d7cef752cdb137a9fbbb8c92fd4..07a0b4f44c1f5c14da81d2193532517b536e3a0b 100644 (file)
@@ -42,8 +42,8 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 $result_media = SQL_QUERY("SELECT SUM(max_rec) AS max_rec, SUM(clicks) AS clicks
 FROM "._MYSQL_PREFIX."_user_stats", __FILE__, __LINE__);
 list($nsent, $nclicks) = SQL_FETCHROW($result_media);
 $result_media = SQL_QUERY("SELECT SUM(max_rec) AS max_rec, SUM(clicks) AS clicks
 FROM "._MYSQL_PREFIX."_user_stats", __FILE__, __LINE__);
 list($nsent, $nclicks) = SQL_FETCHROW($result_media);
-if (empty($nsent))   $nsent   = "0";
-if (empty($nclicks)) $nclicks = "0";
+if (empty($nsent))   $nsent   = 0;
+if (empty($nclicks)) $nclicks = 0;
 
 // Free memory
 SQL_FREERESULT($result_media);
 
 // Free memory
 SQL_FREERESULT($result_media);
@@ -63,13 +63,13 @@ if (EXT_IS_ACTIVE("bonus"))
        $result_media = SQL_QUERY("SELECT SUM(mails_sent) AS bonus_sent, SUM(clicks) AS bonus_clicks
 FROM "._MYSQL_PREFIX."_bonus", __FILE__, __LINE__);
        list($bsent, $bclicks) = SQL_FETCHROW($result_media);
        $result_media = SQL_QUERY("SELECT SUM(mails_sent) AS bonus_sent, SUM(clicks) AS bonus_clicks
 FROM "._MYSQL_PREFIX."_bonus", __FILE__, __LINE__);
        list($bsent, $bclicks) = SQL_FETCHROW($result_media);
-       if (empty($bsent))   $bsent   = "0";
-       if (empty($bclicks)) $bclicks = "0";
+       if (empty($bsent))   $bsent   = 0;
+       if (empty($bclicks)) $bclicks = 0;
 }
  else
 {
        // Not found!
 }
  else
 {
        // Not found!
-       $bsent = "0"; $bclicks = "0";
+       $bsent = 0; $bclicks = 0;
 }
 
 // Load (maybe) missing file
 }
 
 // Load (maybe) missing file
index 55cebce7d93c79a8c4c738b1b072a734ba16e7bd..8e254a61e504f8ed4b456cebb054addfda07febd 100644 (file)
@@ -178,7 +178,7 @@ function ADMINS_CHANGE_ADMIN_ACCOUNT($POST) {
        global $cacheInstance;
 
        // Begin the update
        global $cacheInstance;
 
        // Begin the update
-       $cacheInstance_UPDATE = "0";
+       $cacheInstance_UPDATE = 0;
        foreach ($POST['login'] as $id => $login) {
                // Secure ID number
                $id = bigintval($id);
        foreach ($POST['login'] as $id => $login) {
                // Secure ID number
                $id = bigintval($id);
@@ -362,7 +362,7 @@ function ADMINS_DELETE_ADMIN_ACCOUNTS ($POST) {
 // Remove the given accounts
 function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) {
        // Begin removal
 // Remove the given accounts
 function ADMINS_REMOVE_ADMIN_ACCOUNTS ($POST) {
        // Begin removal
-       $cacheInstance_UPDATE = "0";
+       $cacheInstance_UPDATE = 0;
        foreach ($POST['sel'] as $id => $del) {
                // Secure ID number
                $id = bigintval($id);
        foreach ($POST['sel'] as $id => $del) {
                // Secure ID number
                $id = bigintval($id);
index 62073918fc055ad5ebe1ed11fe9e4295fe343428..1b20a242ea13ed78023ca009f47dacfb96b530fa 100644 (file)
@@ -61,7 +61,7 @@ function AUTOPURGE_ADD_POINTS($uid, $points)
        {
                // ... to jackpot account
                ADD_JACKPOT($points);
        {
                // ... to jackpot account
                ADD_JACKPOT($points);
-               if (empty($jackpot)) $jackpot = "0";
+               if (empty($jackpot)) $jackpot = 0;
                $jackpot += $points;
        }
         else
                $jackpot += $points;
        }
         else
index 9fa4477f44fae9a6d020a763bfe6e0b65854a223..366606a243d6649687743275e4596cd338c202ee 100644 (file)
@@ -52,13 +52,13 @@ function BONUS_ADD_TURBO_POINTS($mid, $uid, $type)
        case "bonusid":
                $result = SQL_QUERY_ESC("SELECT clicks FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
                 array($mid), __FILE__, __LINE__);
        case "bonusid":
                $result = SQL_QUERY_ESC("SELECT clicks FROM "._MYSQL_PREFIX."_bonus WHERE id=%s LIMIT 1",
                 array($mid), __FILE__, __LINE__);
-               $bonus = $mid; $mail = "0";
+               $bonus = $mid; $mail = 0;
                break;
 
        case "mailid" :
                $result = SQL_QUERY_ESC("SELECT clicks FROM "._MYSQL_PREFIX."_user_stats WHERE id=%s LIMIT 1",
                 array($mid), __FILE__, __LINE__);
                break;
 
        case "mailid" :
                $result = SQL_QUERY_ESC("SELECT clicks FROM "._MYSQL_PREFIX."_user_stats WHERE id=%s LIMIT 1",
                 array($mid), __FILE__, __LINE__);
-               $bonus = "0"; $mail = $mid;
+               $bonus = 0; $mail = $mid;
                break;
        }
 
                break;
        }
 
index e0c3fec20cd0b42090b05bc01ce33b78f94ffb07..1394c129b3e4ddd1c81da5cb87086fc49ab5be9e 100644 (file)
@@ -103,7 +103,7 @@ class mxchange_cache
                        $ctime = filectime($inc);
                } else {
                        // No, it doesn't. Zero date/time
                        $ctime = filectime($inc);
                } else {
                        // No, it doesn't. Zero date/time
-                       $ctime = "0";
+                       $ctime = 0;
                }
 
                // Remember change date/time in class
                }
 
                // Remember change date/time in class
index 85ad9e68722cac22ee6f6fcbfbb1465683cfb2eb..7137020b47a5361b2ce05304a30752664643c794 100644 (file)
@@ -41,8 +41,8 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC")
 {
        global $_CONFIG;
 function DOUBLER_GENERATE_TABLE($uid="0", $done='N', $ref='N', $sort="ASC")
 {
        global $_CONFIG;
-       if (empty($cnt)) $cnt = "0";
-       $ADD = ""; $DT_MODE = "0";
+       if (empty($cnt)) $cnt = 0;
+       $ADD = ""; $DT_MODE = 0;
        if ($uid > 0)
        {
                // Load entries only from a single user
        if ($uid > 0)
        {
                // Load entries only from a single user
@@ -128,7 +128,7 @@ function DOUBLER_GET_TOTAL_POINTS_LEFT()
 {
        global $_CONFIG;
        // Initialize variables
 {
        global $_CONFIG;
        // Initialize variables
-       $points = "0";
+       $points = 0;
 
        if ($_CONFIG['doubler_own'] == "Y")
        {
 
        if ($_CONFIG['doubler_own'] == "Y")
        {
index d6aaef96f8b3ced669a4605a8e559013dce3ee34..b7cb9d06359eac502f7b96a1a34e2ccf38afabf9 100644 (file)
@@ -94,7 +94,7 @@ function RALLYE_AUTOSTART_RALLYES($result)
 
                // Get refs by userid
                $cnt = RALLYE_GET_REFCOUNT($uid);
 
                // Get refs by userid
                $cnt = RALLYE_GET_REFCOUNT($uid);
-               if (empty($cnt)) $cnt = "0"; // Added prevent some unknown troubles... :-?
+               if (empty($cnt)) $cnt = 0; // Added prevent some unknown troubles... :-?
 
                // Check if line is already included...
                $result_ref = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s AND userid=%s LIMIT 1",
 
                // Check if line is already included...
                $result_ref = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_rallye_users WHERE rallye_id=%s AND userid=%s LIMIT 1",
@@ -230,7 +230,7 @@ LIMIT 1", array(bigintval($uid), $_CONFIG['ref_payout'], $since), __FILE__, __LI
                list($refpoints) = SQL_FETCHROW($result_ref);
                SQL_FREERESULT($result_ref);
 
                list($refpoints) = SQL_FETCHROW($result_ref);
                SQL_FREERESULT($result_ref);
 
-               if (empty($refpoints)) $refpoints = "0";
+               if (empty($refpoints)) $refpoints = 0;
 
                // And subtract start refs
                $cnt -= $refs;
 
                // And subtract start refs
                $cnt -= $refs;
@@ -316,7 +316,7 @@ VALUES ('%s', '%s', '0')",
                        $DATA['now_t'] = MAKE_DATETIME(time(), "2");
                        $DATA['title'] = $title;
                        $DATA['id']    = $id;  // ID for the rallye details link
                        $DATA['now_t'] = MAKE_DATETIME(time(), "2");
                        $DATA['title'] = $title;
                        $DATA['id']    = $id;  // ID for the rallye details link
-                       $DATA['ref']   = "0";
+                       $DATA['ref']   = 0;
 
                        // Load prices
                        $prices = RALLYE_ADD_PRICES($id);
 
                        // Load prices
                        $prices = RALLYE_ADD_PRICES($id);
@@ -551,7 +551,7 @@ WHERE d.status='CONFIRMED' AND d.max_mails > 0 AND d.mails_confirmed >= %s AND p
                list($refpoints) = SQL_FETCHROW($result_ref);
                SQL_FREERESULT($result_ref);
 
                list($refpoints) = SQL_FETCHROW($result_ref);
                SQL_FREERESULT($result_ref);
 
-               if (empty($refpoints)) $refpoints = "0";
+               if (empty($refpoints)) $refpoints = 0;
 
                // Store calculated new refs to array
                $users['uid'][]     = $uid;
 
                // Store calculated new refs to array
                $users['uid'][]     = $uid;
@@ -798,7 +798,7 @@ WHERE s.userid=%s AND s.level=0", array(bigintval($uid)), __FILE__, __LINE__);
                SQL_FREERESULT($result_ref);
                if (empty($cnt))
                {
                SQL_FREERESULT($result_ref);
                if (empty($cnt))
                {
-                       $cnt = "0";
+                       $cnt = 0;
                }
                 else
                {
                }
                 else
                {
index c9ce82d799044ae4d7448dc72c7030f9bc0ffacb..fdf4eb9f43b4bded1bc1104cc22545c38181eeb5 100644 (file)
@@ -153,7 +153,7 @@ function SPONSOR_HANDLE_SPONSOR(&$POST, $NO_UPDATE=false, $MSGs=array(), $RET_ST
        if ($SAVE)
        {
                // Default is no force even when a guest want to abuse this force switch
        if ($SAVE)
        {
                // Default is no force even when a guest want to abuse this force switch
-               if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = "0";
+               if ((empty($POST['force'])) || (!IS_ADMIN())) $POST['force'] = 0;
 
                // SQL and message string is empty by default
                $SQL = ""; $MSG = "";
 
                // SQL and message string is empty by default
                $SQL = ""; $MSG = "";
index 8d238b5e44621b5c5a0565d2b37d4712278c2ac4..8b491c650acadd8365588e92f1ac3e3f6ffeb09e 100644 (file)
@@ -225,7 +225,7 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
        $uid = bigintval($urlData['uid']);
 
        // Is the id set?
        $uid = bigintval($urlData['uid']);
 
        // Is the id set?
-       if (empty($uid)) $uid = "0";
+       if (empty($uid)) $uid = 0;
 
        // Just run the insert query for now
        SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid, url, reward, costs, status) VALUES('%s', '%s', %s, %s, '%s')",
 
        // Just run the insert query for now
        SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_surfbar_urls (userid, url, reward, costs, status) VALUES('%s', '%s', %s, %s, '%s')",
@@ -884,7 +884,7 @@ LIMIT 1",
                if ((!isset($SURFBAR_CACHE['last_surfed'])) || (is_null($SURFBAR_CACHE['last_surfed']))) {
                        // Fix it here
                        //DEBUG_LOG(__FUNCTION__.":last_surfed - FIXED!");
                if ((!isset($SURFBAR_CACHE['last_surfed'])) || (is_null($SURFBAR_CACHE['last_surfed']))) {
                        // Fix it here
                        //DEBUG_LOG(__FUNCTION__.":last_surfed - FIXED!");
-                       $SURFBAR_CACHE['last_surfed'] = "0";
+                       $SURFBAR_CACHE['last_surfed'] = 0;
                } // END - if
 
                // Get base/fixed reward and costs
                } // END - if
 
                // Get base/fixed reward and costs
index d5b79dc22d67349ac2101a7e189fc32a7817548f..94fb9b9c7da581f0b8f6ea31ca61f7b25bc7839c 100644 (file)
@@ -572,7 +572,7 @@ function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){
                        if (empty($TITLEs[$key])) $TITLEs[$key] = TASK_ADMIN_UNKNOWN_LIST_TITLE;
                        $content['row_link'] = "<A href=\"".URL."/modules.php?module=admin&amp;what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</A>";
                } else {
                        if (empty($TITLEs[$key])) $TITLEs[$key] = TASK_ADMIN_UNKNOWN_LIST_TITLE;
                        $content['row_link'] = "<A href=\"".URL."/modules.php?module=admin&amp;what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</A>";
                } else {
-                       $content['row_link'] = "0";
+                       $content['row_link'] = 0;
                }
 
                // Switch color
                }
 
                // Switch color
index b2971443404452602024f6a831460199d15a89b7..9c42fb28a2b8f6b6b072b4deb35d2db5aa9d284a 100644 (file)
@@ -41,7 +41,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 function alpha($sortby, $colspan, $return=false)
 {
        global $_CONFIG;
 function alpha($sortby, $colspan, $return=false)
 {
        global $_CONFIG;
-       if (empty($_GET['offset'])) $_GET['offset'] = "0";
+       if (empty($_GET['offset'])) $_GET['offset'] = 0;
        $ADD = "&amp;page=".$_GET['page']."&amp;offset=".$_GET['offset'];
        if (!empty($_GET['mode'])) $ADD .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
 
        $ADD = "&amp;page=".$_GET['page']."&amp;offset=".$_GET['offset'];
        if (!empty($_GET['mode'])) $ADD .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
 
@@ -91,7 +91,7 @@ function alpha($sortby, $colspan, $return=false)
 function SortLinks($letter, $sortby, $colspan, $return=false)
 {
        $OUT = "";
 function SortLinks($letter, $sortby, $colspan, $return=false)
 {
        $OUT = "";
-       if (empty($_GET['offset'])) $_GET['offset'] = "0";
+       if (empty($_GET['offset'])) $_GET['offset'] = 0;
        $ADD = "&amp;page=".$_GET['page']."&amp;offset=".$_GET['offset'];
        if (!empty($_GET['mode'])) $ADD .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
 
        $ADD = "&amp;page=".$_GET['page']."&amp;offset=".$_GET['offset'];
        if (!empty($_GET['mode'])) $ADD .= "&amp;mode=".SQL_ESCAPE($_GET['mode']);
 
index 620c42338a23e577553cd85b01b0d0dd06e3fe8d..08c14b722df7a4c592dcca4b26c195ef823ac0ad 100644 (file)
@@ -54,7 +54,7 @@ if (isset($_POST['edit']))
                        // First of all load data from DB
                        $result = SQL_QUERY_ESC("SELECT admin_id, id FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' ORDER BY id",
                         array($template), __FILE__, __LINE__);
                        // First of all load data from DB
                        $result = SQL_QUERY_ESC("SELECT admin_id, id FROM "._MYSQL_PREFIX."_admins_mails WHERE mail_template='%s' ORDER BY id",
                         array($template), __FILE__, __LINE__);
-                       $OUT = ""; $aid = "0"; $aid2 = "0";
+                       $OUT = ""; $aid = 0; $aid2 = 0;
                        while (list($aid, $id) = SQL_FETCHROW($result))
                        {
                                $OUT .= "<SELECT name=\"admin_id[".$id."]\" size=\"1\" class=\"admin_select\">
                        while (list($aid, $id) = SQL_FETCHROW($result))
                        {
                                $OUT .= "<SELECT name=\"admin_id[".$id."]\" size=\"1\" class=\"admin_select\">
index 7a3b3c223842c5411dce9eed9106e3487402a21c..0f1b92788eda977fccf5ced8472938535f1bf3c0 100644 (file)
@@ -60,7 +60,7 @@ if (isset($_POST['del']))
 
 // We only need outgoing transfers
 $result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out ORDER BY trans_id", __FILE__, __LINE__);
 
 // We only need outgoing transfers
 $result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out ORDER BY trans_id", __FILE__, __LINE__);
-$total = "0";
+$total = 0;
 if (SQL_NUMROWS($result) > 0)
 {
        // Output rows
 if (SQL_NUMROWS($result) > 0)
 {
        // Output rows
index 4cfcb50a70d0668806e62bbc6369298c28f50b6a..afe6ac45435ce9d4bc8154585a0ce97c145bc384 100644 (file)
@@ -154,7 +154,7 @@ if (SQL_NUMROWS($result_list) > 0)
                 elseif ($unconfirmed < 0)
                {
                        // Sometimes rarely displayed minus values will be "fixed" to zero
                 elseif ($unconfirmed < 0)
                {
                        // Sometimes rarely displayed minus values will be "fixed" to zero
-                       $unconfirmed = "0";
+                       $unconfirmed = 0;
                }
 
                // List mail
                }
 
                // List mail
index c33b616d40a82a0bddabd137a32c44810fa05438..ce0379f0c24425fcd2914ed12c0be639013a201b 100644 (file)
@@ -44,7 +44,7 @@ global $cacheInstance, $cacheArray, $cacheMode;
 
 // Normally we want the overview of all registered extensions
 $do = "overview";
 
 // Normally we want the overview of all registered extensions
 $do = "overview";
-$SEL = "0";
+$SEL = 0;
 if (!empty($_POST['sel'])) $SEL = SELECTION_COUNT($_POST['sel']);
 
 if (!empty($_GET['reg_ext'])) {
 if (!empty($_POST['sel'])) $SEL = SELECTION_COUNT($_POST['sel']);
 
 if (!empty($_GET['reg_ext'])) {
@@ -72,7 +72,7 @@ if (!empty($_GET['reg_ext'])) {
        // Change settings like CSS file load
        if (isset($_POST['modify'])) {
                // Change entries
        // Change settings like CSS file load
        if (isset($_POST['modify'])) {
                // Change entries
-               $cacheInstance_UPDATE = "0";
+               $cacheInstance_UPDATE = 0;
                foreach ($_POST['sel'] as $id => $sel) {
                        // Secure ID
                        $id = bigintval($id);
                foreach ($_POST['sel'] as $id => $sel) {
                        // Secure ID
                        $id = bigintval($id);
@@ -197,7 +197,7 @@ if (!empty($_GET['reg_ext'])) {
        $do = "delete";
 } elseif ((isset($_POST['remove'])) && ($SEL > 0) && (!IS_DEMO())) {
        // Remove extensions from DB (you have to delete all files manually!)
        $do = "delete";
 } elseif ((isset($_POST['remove'])) && ($SEL > 0) && (!IS_DEMO())) {
        // Remove extensions from DB (you have to delete all files manually!)
-       $cacheInstance_UPDATE = "0";
+       $cacheInstance_UPDATE = 0;
        foreach ($_POST['sel'] as $id => $active) {
                // Secure ID number
                $id = bigintval($id);
        foreach ($_POST['sel'] as $id => $active) {
                // Secure ID number
                $id = bigintval($id);
@@ -297,7 +297,7 @@ case "register": // Register new extension
                SQL_FREERESULT($result);
 
                // Disable cache update by default
                SQL_FREERESULT($result);
 
                // Disable cache update by default
-               $cacheInstance_UPDATE = "0";
+               $cacheInstance_UPDATE = 0;
                if (!empty($subj)) {
                        // Extract extension's name from subject...
                        $ext_name = trim(substr($subj, 1, strpos($subj, ":") - 1));
                if (!empty($subj)) {
                        // Extract extension's name from subject...
                        $ext_name = trim(substr($subj, 1, strpos($subj, ":") - 1));
index a4d1dc66bc80401040c21bfbf636cdc126ed89b8..5a6df80094415f13d6ea046d2d69b32d2b678c45 100644 (file)
@@ -49,28 +49,22 @@ if (!empty($_GET['pid']))
        SQL_FREERESULT($result);
 
        // Obtain some data
        SQL_FREERESULT($result);
 
        // Obtain some data
-       if (empty($_GET['task']) && (!empty($uid)) && ($uid > 0))
-       {
+       if (empty($_GET['task']) && (!empty($uid)) && ($uid > 0)) {
                // Get task ID from database
                $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE userid=%s AND task_type='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1",
                 array(bigintval($uid)), __FILE__, __LINE__);
                list($task) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
                // Get task ID from database
                $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_task_system WHERE userid=%s AND task_type='PAYOUT_REQUEST' AND task_created='".$tstamp."' LIMIT 1",
                 array(bigintval($uid)), __FILE__, __LINE__);
                list($task) = SQL_FETCHROW($result);
                SQL_FREERESULT($result);
-               if (empty($task)) $task = "0";
-
-       }
-        elseif ((empty($uid)) || ($uid == "0"))
-       {
+               if (empty($task)) $task = 0;
+       } elseif ((empty($uid)) || ($uid == "0")) {
                // Cannot obtain member ID!
                LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_USERID);
                // Cannot obtain member ID!
                LOAD_TEMPLATE("admin_settings_saved", false, PAYOUT_FAILED_OBTAIN_USERID);
-       }
-        else
-       {
+       } else {
                // Get task ID from URL
                $task = $_GET['task'];
        }
                // Get task ID from URL
                $task = $_GET['task'];
        }
-       if ((!empty($task)) && (!empty($uid)) && ($uid > 0))
-       {
+
+       if ((!empty($task)) && (!empty($uid)) && ($uid > 0)) {
                // Load user's data
                $result = SQL_QUERY_ESC("SELECT email, sex, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
                 array(bigintval($uid)), __FILE__, __LINE__);
                // Load user's data
                $result = SQL_QUERY_ESC("SELECT email, sex, surname, family FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
                 array(bigintval($uid)), __FILE__, __LINE__);
index 7ef34bd3022dd9fe93ef404b695ea64d2487eba9..4438870eee70aee9589aebc598b44f89b249eefd 100644 (file)
@@ -341,7 +341,7 @@ ORDER BY start_time DESC",
                                // Rallye is active so do not edit it!
                                $content['select'] = "<STRONG class=\"big\">".$id."</STRONG>";
                                $content['active_title'] = RALLYE_DEACTIVATE_NOW;
                                // Rallye is active so do not edit it!
                                $content['select'] = "<STRONG class=\"big\">".$id."</STRONG>";
                                $content['active_title'] = RALLYE_DEACTIVATE_NOW;
-                               $content['active'] = "0";
+                               $content['active'] = 0;
                                break;
 
                        case 'N':
                                break;
 
                        case 'N':
@@ -355,7 +355,7 @@ ORDER BY start_time DESC",
                        {
                        case 'Y':
                                $content['notify_title'] = RALLYE_STOP_NOTIFY_NOW;
                        {
                        case 'Y':
                                $content['notify_title'] = RALLYE_STOP_NOTIFY_NOW;
-                               $content['notify'] = "0";
+                               $content['notify'] = 0;
                                break;
 
                        case 'N':
                                break;
 
                        case 'N':
@@ -369,7 +369,7 @@ ORDER BY start_time DESC",
                        {
                        case 'Y':
                                $content['auto_title'] = RALLYE_STOP_AUTO_ADD_NOW;
                        {
                        case 'Y':
                                $content['auto_title'] = RALLYE_STOP_AUTO_ADD_NOW;
-                               $content['auto'] = "0";
+                               $content['auto'] = 0;
                                break;
 
                        case 'N':
                                break;
 
                        case 'N':
index 9135b5b2cd02003e4e9213a37b76438113484c3b..498444a912e223565386c1440283c5d9e3ae65dc 100644 (file)
@@ -61,7 +61,7 @@ WHERE id='%s' LIMIT 1",
                 array(bigintval($_GET['id'])), __FILE__, __LINE__);
                list($orders) = SQL_FETCHROW($result_orders);
                SQL_FREERESULT($result_orders);
                 array(bigintval($_GET['id'])), __FILE__, __LINE__);
                list($orders) = SQL_FETCHROW($result_orders);
                SQL_FREERESULT($result_orders);
-               if (empty($orders)) $orders = "0";
+               if (empty($orders)) $orders = 0;
 
                // Prepare all data for the template
                //  Sponsor's ID
 
                // Prepare all data for the template
                //  Sponsor's ID
index 4a4a926b89b3239e6ab19deb499062ac506cbcb5..64b64747506fbfc7a3beb65118dcd5390448cd7b 100644 (file)
@@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // We only need outgoing transfers
 $result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out ORDER BY trans_id", __FILE__, __LINE__);
 
 // We only need outgoing transfers
 $result = SQL_QUERY("SELECT userid, to_uid, trans_id, points, reason, time_trans FROM "._MYSQL_PREFIX."_user_transfers_out ORDER BY trans_id", __FILE__, __LINE__);
-$total = "0";
+$total = 0;
 if (SQL_NUMROWS($result) > 0)
 {
        // Output rows
 if (SQL_NUMROWS($result) > 0)
 {
        // Output rows
index 1c763694f52bbb4d87af433f5f46d851241c6ca9..7fe2287fa09dd131b08dead4f3d7df942b2a861a 100644 (file)
@@ -96,7 +96,7 @@ if ($listed)
 
                // Transfer data to constants for the template
                if (($stats_id > 0) && ($ID == "-1")) $ID = $stats_id;
 
                // Transfer data to constants for the template
                if (($stats_id > 0) && ($ID == "-1")) $ID = $stats_id;
-               if ($col == "bonus_id") $sender = "0";
+               if ($col == "bonus_id") $sender = 0;
                define('__LIST_UNCON_SENDER' , $sender);
                define('__LIST_UNCON_SUBJECT', COMPILE_CODE($subj));
                define('__LIST_UNCON_TEXT'   , COMPILE_CODE($text));
                define('__LIST_UNCON_SENDER' , $sender);
                define('__LIST_UNCON_SUBJECT', COMPILE_CODE($subj));
                define('__LIST_UNCON_TEXT'   , COMPILE_CODE($text));
index 345a7bdaf76b2041acecdbedb317952a0d755cbb..799d6069691fe78c4e993ec36e1739aa7bdd001d 100644 (file)
@@ -169,7 +169,7 @@ VALUES ('%s', '%s', '%s', '%s', '%s', 'NEW', UNIX_TIMESTAMP(), '%s', '%s', '%s',
                        $CATS['name'][] = $cat;
                        $result_uids = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s",
                         array(bigintval($id)), __FILE__, __LINE__);
                        $CATS['name'][] = $cat;
                        $result_uids = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s",
                         array(bigintval($id)), __FILE__, __LINE__);
-                       $uid_cnt = "0";
+                       $uid_cnt = 0;
                        while (list($ucat) = SQL_FETCHROW($result_uids))
                        {
                                $result_ver = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data
                        while (list($ucat) = SQL_FETCHROW($result_uids))
                        {
                                $result_ver = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data
index e266ccb6324844dc4d9153e6f6c1bbea1ca113b6..b3368dd7796a757a90c988f463e71e1b32db2293 100644 (file)
@@ -44,7 +44,7 @@ global $cacheInstance, $cacheArray, $cacheMode;
 
 // Normally we want the overview of all registered theme_check
 $mode = "overview";
 
 // Normally we want the overview of all registered theme_check
 $mode = "overview";
-$SEL = "0";
+$SEL = 0;
 
 // Get response from our server
 $response = GET_URL("check-themes.php");
 
 // Get response from our server
 $response = GET_URL("check-themes.php");
index aacab360913fc171609b04300adb617d413381ee..4bf1d60f1df4903b748f9c836c1102f35871d99e 100644 (file)
@@ -85,7 +85,7 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($
 
                if (($response[3] != "[EOF]") && ($ONLINE['version'] == FULL_VERSION)) {
                        // We have found new patches (newer than FULL_VERSION)
 
                if (($response[3] != "[EOF]") && ($ONLINE['version'] == FULL_VERSION)) {
                        // We have found new patches (newer than FULL_VERSION)
-                       $max = str_replace("\n", "", $response[sizeof($response) - 2]); $TOTAL_SIZE = "0";
+                       $max = str_replace("\n", "", $response[sizeof($response) - 2]); $TOTAL_SIZE = 0;
 
                        // Maximum of available pacthes extracted (above). Now we can get all informations
                        for ($idx = 0; $idx < $max; $idx++) {
 
                        // Maximum of available pacthes extracted (above). Now we can get all informations
                        for ($idx = 0; $idx < $max; $idx++) {
index 3aeef30560b4e2d5992cdce9bbd017876988ff27..ecf3887652dca4f3893b9ecaef704fce1e4468be 100644 (file)
@@ -64,11 +64,11 @@ if ((!empty($GLOBALS['userid'])) && (isSessionVariableSet('u_hash')))
        }
 } elseif (!empty($_POST['new_pass'])) {
        // New password requested
        }
 } elseif (!empty($_POST['new_pass'])) {
        // New password requested
-       $UID = "0";
+       $UID = 0;
        if (!empty($_POST['id'])) $UID = $_POST['id'];
 } else {
        // Not logged in
        if (!empty($_POST['id'])) $UID = $_POST['id'];
 } else {
        // Not logged in
-       $UID = "0"; $hash = "";
+       $UID = 0; $hash = "";
 }
 
 $URL = ""; $ADD = "";
 }
 
 $URL = ""; $ADD = "";
@@ -229,7 +229,7 @@ if (IS_MEMBER()) {
        if (!empty($_POST['email'])) $_POST['email'] = str_replace("{DOT}", '.', $_POST['email']);
 
        // Set ID number when left empty
        if (!empty($_POST['email'])) $_POST['email'] = str_replace("{DOT}", '.', $_POST['email']);
 
        // Set ID number when left empty
-       if (empty($_POST['id'])) $_POST['id'] = "0";
+       if (empty($_POST['id'])) $_POST['id'] = 0;
 
        // Probe userid/nickname
        $probe_nickname = ((EXT_IS_ACTIVE("nickname")) && (("".round($_POST['id'])."") != $_POST['id']));
 
        // Probe userid/nickname
        $probe_nickname = ((EXT_IS_ACTIVE("nickname")) && (("".round($_POST['id'])."") != $_POST['id']));
index 5d7439a7a59dbc978143df6dfab13bd9bade4e15..e73614e2f447011a5f8a294cb2b0f232f4f7c90e 100644 (file)
@@ -101,28 +101,28 @@ define('rec', $dummy);
 SQL_FREERESULT($result_rec);
 
 // Initial lots of variables
 SQL_FREERESULT($result_rec);
 
 // Initial lots of variables
-$bmails = "0"; $sent = "0"; $max = "0"; $rec = "0"; $clicks = "0";
+$bmails = 0; $sent = 0; $max = 0; $rec = 0; $clicks = 0;
 
 // Mail orders (only current)
 $nmails = MEDIA_GET_ENTRY("normal_orders");
 
 // Mail orders (only current)
 $nmails = MEDIA_GET_ENTRY("normal_orders");
-if (empty($nmails)) $nmails = "0";
+if (empty($nmails)) $nmails = 0;
 
 // Mails sent so far
 $clicks = MEDIA_GET_ENTRY("normal_clicks");
 $sent   = MEDIA_GET_ENTRY("normal_send");
 
 // Mails sent so far
 $clicks = MEDIA_GET_ENTRY("normal_clicks");
 $sent   = MEDIA_GET_ENTRY("normal_send");
-if (empty($sent))   $sent   = "0";
-if (empty($clicks)) $clicks = "0";
+if (empty($sent))   $sent   = 0;
+if (empty($clicks)) $clicks = 0;
 
 // Bonus mails
 if (EXT_IS_ACTIVE("bonus")) {
        $bmails = MEDIA_GET_ENTRY("bonus_orders");
 
 // Bonus mails
 if (EXT_IS_ACTIVE("bonus")) {
        $bmails = MEDIA_GET_ENTRY("bonus_orders");
-       if (empty($bmails)) $bmails = "0";
+       if (empty($bmails)) $bmails = 0;
 
        // Count bonus mails clicks / sent mails
        $dmy  = MEDIA_GET_ENTRY("bonus_clicks");
        $dmy2 = MEDIA_GET_ENTRY("bonus_send");
 
        // Count bonus mails clicks / sent mails
        $dmy  = MEDIA_GET_ENTRY("bonus_clicks");
        $dmy2 = MEDIA_GET_ENTRY("bonus_send");
-       if (empty($dmy))  $dmy  = "0";
-       if (empty($dmy2)) $dmy2 = "0";
+       if (empty($dmy))  $dmy  = 0;
+       if (empty($dmy2)) $dmy2 = 0;
        $sent += $dmy2; $clicks += $dmy;
 }
 
        $sent += $dmy2; $clicks += $dmy;
 }
 
@@ -140,7 +140,7 @@ define('_clr', TRANSLATE_COMMA($clr)."%");
 $result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
 list($jackpot) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
 $result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
 list($jackpot) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
-if (empty($jackpot)) $jackpot = "0";
+if (empty($jackpot)) $jackpot = 0;
 define('jackpot', TRANSLATE_COMMA($jackpot));
 
 // Total referral link clicks, total logins
 define('jackpot', TRANSLATE_COMMA($jackpot));
 
 // Total referral link clicks, total logins
@@ -152,9 +152,9 @@ SQL_FREERESULT($result);
 // Get total points
 $points = MEDIA_GET_ENTRY("total_points");
 
 // Get total points
 $points = MEDIA_GET_ENTRY("total_points");
 
-if (empty($points)) $points = "0";
-if (empty($ref))    $ref    = "0";
-if (empty($logins)) $logins = "0";
+if (empty($points)) $points = 0;
+if (empty($ref))    $ref    = 0;
+if (empty($logins)) $logins = 0;
 
 define('__TOTAL_POINTS'   , TRANSLATE_COMMA($points));
 define('__TOTAL_REFCLICKS', $ref);
 
 define('__TOTAL_POINTS'   , TRANSLATE_COMMA($points));
 define('__TOTAL_REFCLICKS', $ref);
@@ -168,9 +168,9 @@ $result = SQL_QUERY("SELECT SUM(counter), SUM(clicks) FROM "._MYSQL_PREFIX."_ref
 list($views, $clicks) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
 
 list($views, $clicks) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
 
-if (empty($total))  $total  = "0";
-if (empty($views))  $views  = "0";
-if (empty($clicks)) $clicks = "0";
+if (empty($total))  $total  = 0;
+if (empty($views))  $views  = 0;
+if (empty($clicks)) $clicks = 0;
 
 define('__REF_TOTAL' , $total);
 define('__REF_VIEWS' , $views);
 
 define('__REF_TOTAL' , $total);
 define('__REF_VIEWS' , $views);
@@ -191,7 +191,7 @@ if (EXT_IS_ACTIVE("beg")) {
        $result = SQL_QUERY("SELECT SUM(beg_clicks) FROM "._MYSQL_PREFIX."_user_data WHERE beg_clicks>0", __FILE__, __LINE__);
        list($extra) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
        $result = SQL_QUERY("SELECT SUM(beg_clicks) FROM "._MYSQL_PREFIX."_user_data WHERE beg_clicks>0", __FILE__, __LINE__);
        list($extra) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
-       if (empty($extra)) $extra = "0";
+       if (empty($extra)) $extra = 0;
        $content = array(
                'lang'  => MEDIA_BEG_CLICKS,
                'value' => $extra
        $content = array(
                'lang'  => MEDIA_BEG_CLICKS,
                'value' => $extra
@@ -209,10 +209,10 @@ if (EXT_IS_ACTIVE("doubler")) {
        list($count2, $points2) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
        list($count2, $points2) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
-       if (empty($count1))  $count1  = "0";
-       if (empty($count2))  $count2  = "0";
-       if (empty($points1)) $points1 = "0";
-       if (empty($points2)) $points2 = "0";
+       if (empty($count1))  $count1  = 0;
+       if (empty($count2))  $count2  = 0;
+       if (empty($points1)) $points1 = 0;
+       if (empty($points2)) $points2 = 0;
 
        // Add header
        $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, MEDIA_DOUBLER_HEADER);
 
        // Add header
        $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, MEDIA_DOUBLER_HEADER);
@@ -251,7 +251,7 @@ ON h.userid=d.userid
 WHERE d.holiday_active='Y'",
  __FILE__, __LINE__);
        list($holiday) = SQL_FETCHROW($result);
 WHERE d.holiday_active='Y'",
  __FILE__, __LINE__);
        list($holiday) = SQL_FETCHROW($result);
-       if (empty($holiday)) $holiday = "0";
+       if (empty($holiday)) $holiday = 0;
        $content = array(
                'lang'  => MEDIA_HOLIDAY_COUNT,
                'value' => $holiday
        $content = array(
                'lang'  => MEDIA_HOLIDAY_COUNT,
                'value' => $holiday
@@ -268,8 +268,8 @@ LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
 ON t.userid=d.userid",
  __FILE__, __LINE__);
        list($count_in, $points_in) = SQL_FETCHROW($result);
 ON t.userid=d.userid",
  __FILE__, __LINE__);
        list($count_in, $points_in) = SQL_FETCHROW($result);
-       if (empty($count_in))  $count_in  = "0";
-       if (empty($points_in)) $points_in = "0";
+       if (empty($count_in))  $count_in  = 0;
+       if (empty($points_in)) $points_in = 0;
 
        $result = SQL_QUERY("SELECT DISTINCT COUNT(t.id), SUM(t.points)
 FROM "._MYSQL_PREFIX."_user_transfers_out AS t
 
        $result = SQL_QUERY("SELECT DISTINCT COUNT(t.id), SUM(t.points)
 FROM "._MYSQL_PREFIX."_user_transfers_out AS t
@@ -277,8 +277,8 @@ LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
 ON t.userid=d.userid",
  __FILE__, __LINE__);
        list($count_out, $points_out) = SQL_FETCHROW($result);
 ON t.userid=d.userid",
  __FILE__, __LINE__);
        list($count_out, $points_out) = SQL_FETCHROW($result);
-       if (empty($count_out))  $count_out  = "0";
-       if (empty($points_out)) $points_out = "0";
+       if (empty($count_out))  $count_out  = 0;
+       if (empty($points_out)) $points_out = 0;
 
        // Add header
        $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, MEDIA_TRANSFER_HEADER);
 
        // Add header
        $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, MEDIA_TRANSFER_HEADER);
index b4c2f9a8cb13b1253d7f5df3011ceb3447619c8d..ccbc0821a5d4ec6b84077d13e020d70e0a74bb3c 100644 (file)
@@ -104,7 +104,7 @@ $HTML_EXT = EXT_IS_ACTIVE("html_mail");
 $result_p = SQL_QUERY_ESC("SELECT SUM(points) FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s",
  array($GLOBALS['userid']), __FILE__, __LINE__);
 
 $result_p = SQL_QUERY_ESC("SELECT SUM(points) FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s",
  array($GLOBALS['userid']), __FILE__, __LINE__);
 
-$TOTAL = "0";
+$TOTAL = 0;
 if (SQL_NUMROWS($result_p) > 0)
 {
        // Load points
 if (SQL_NUMROWS($result_p) > 0)
 {
        // Load points
@@ -137,7 +137,7 @@ if (($HOLIDAY == "Y") && (GET_EXT_VERSION("holiday") >= "0.1.3"))
        $result = SQL_QUERY_ESC("SELECT id, data_type FROM "._MYSQL_PREFIX."_pool WHERE sender=%s AND url='%s' AND timestamp > %s LIMIT 1",
         array($GLOBALS['userid'], $_POST['url'], bigintval(time() - $_CONFIG['url_tlock'])), __FILE__, __LINE__);
 
        $result = SQL_QUERY_ESC("SELECT id, data_type FROM "._MYSQL_PREFIX."_pool WHERE sender=%s AND url='%s' AND timestamp > %s LIMIT 1",
         array($GLOBALS['userid'], $_POST['url'], bigintval(time() - $_CONFIG['url_tlock'])), __FILE__, __LINE__);
 
-       $type = "TEMP"; $id = "0";
+       $type = "TEMP"; $id = 0;
        if (SQL_NUMROWS($result) == 1)
        {
                list($id, $type) = SQL_FETCHROW($result);
        if (SQL_NUMROWS($result) == 1)
        {
                list($id, $type) = SQL_FETCHROW($result);
@@ -485,7 +485,7 @@ array(
                                $result_uids = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s AND userid != '%s' ORDER BY userid",
                                 array(bigintval($id), $GLOBALS['userid']), __FILE__, __LINE__);
 
                                $result_uids = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%s AND userid != '%s' ORDER BY userid",
                                 array(bigintval($id), $GLOBALS['userid']), __FILE__, __LINE__);
 
-                               $uid_cnt = "0";
+                               $uid_cnt = 0;
                                while (list($ucat) = SQL_FETCHROW($result_uids))
                                {
                                        // Check for holiday system
                                while (list($ucat) = SQL_FETCHROW($result_uids))
                                {
                                        // Check for holiday system
index 1a828cdb9c88d6270c1014e5e83e6ee500a2720c..1983bb7171fa9b53334fe02cd5ec8a7ff3d70111 100644 (file)
@@ -49,7 +49,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
 ADD_DESCR("member", basename(__FILE__));
 
 $result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
 ADD_DESCR("member", basename(__FILE__));
 
 $result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
-$TPTS = "0";
+$TPTS = 0;
 while (list($lvl, $per) = SQL_FETCHROW($result_depths))
 {
        // Load referral points
 while (list($lvl, $per) = SQL_FETCHROW($result_depths))
 {
        // Load referral points
index 87f17ee8ed16cff002a458fd6df5c98a883b72d4..129fb4026384d3410d18aa52689aeaf7e5cfd6fb 100644 (file)
@@ -54,12 +54,12 @@ if (GET_EXT_VERSION("bonus") >= "0.4.4") $depths += 4;
 define('__ROWS_VALUE', ($depths*2+15));
 
 // Init some vars...
 define('__ROWS_VALUE', ($depths*2+15));
 
 // Init some vars...
-$TPTS = "0"; $TREF = "0"; $TLOCK = "0"; $OUT = "";
+$TPTS = 0; $TREF = 0; $TLOCK = 0; $OUT = "";
 
 // Load ref levels
 while (list($lvl, $per) = SQL_FETCHROW($result_depths)) {
        // Initialize ref-count
 
 // Load ref levels
 while (list($lvl, $per) = SQL_FETCHROW($result_depths)) {
        // Initialize ref-count
-       $REFS = "0";
+       $REFS = 0;
 
        // Load referral points
        $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%s LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
 
        // Load referral points
        $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%s LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
@@ -79,7 +79,7 @@ while (list($lvl, $per) = SQL_FETCHROW($result_depths)) {
                SQL_FREERESULT($result_refs);
                $TREF += $REFS;
        } else {
                SQL_FREERESULT($result_refs);
                $TREF += $REFS;
        } else {
-               $REFS = "0";
+               $REFS = 0;
        }
 
        // Transfer data to array for template
        }
 
        // Transfer data to array for template
index 0e9c148ae811478d6e9b9e6793f8583905bdb465..eac91e3a0b5b8c9492474b1d4a1f047497c9cdff 100644 (file)
@@ -362,7 +362,7 @@ case "list_out": // List only outgoing transactions
        }
 
        // Run the SQL command
        }
 
        // Run the SQL command
-       $total = "0";
+       $total = 0;
        $result = SQL_QUERY_ESC($SQL, array($GLOBALS['userid']), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0)
        {
        $result = SQL_QUERY_ESC($SQL, array($GLOBALS['userid']), __FILE__, __LINE__);
        if (SQL_NUMROWS($result) > 0)
        {
@@ -456,7 +456,7 @@ array($GLOBALS['userid'], $_CONFIG['transfer_max']), __FILE__, __LINE__);
        // Free memory
        SQL_FREERESULT($result);
 
        // Free memory
        SQL_FREERESULT($result);
 
-       $total = "0";
+       $total = 0;
        if (SQL_NUMROWS($result) > 0)
        {
                // Output rows
        if (SQL_NUMROWS($result) > 0)
        {
                // Output rows
index 114276f7abdb9902572fad44bf81c31e9ac18436..4e22502eaf9ef06b8719801775e6ddc2271bf00c 100644 (file)
@@ -57,7 +57,7 @@ if (EXT_IS_ACTIVE("bonus")) {
 if (SQL_NUMROWS($result) > 0)
 {
        // Please confirm these mails!
 if (SQL_NUMROWS($result) > 0)
 {
        // Please confirm these mails!
-       $sum = "0"; $SW = 2; $OUT = "";
+       $sum = 0; $SW = 2; $OUT = "";
        while (list($id, $id2, $type) = SQL_FETCHROW($result))
        {
                // Load data from stats table...
        while (list($id, $id2, $type) = SQL_FETCHROW($result))
        {
                // Load data from stats table...
index 59921655d456eb81294f022e6db0667f7e444fe2..1f2fefc671e73cfa5b11c68aaa3dca6228c5f419 100644 (file)
@@ -124,23 +124,7 @@ LIMIT 1", __FILE__, __LINE__);
                                        require_once(PATH."inc/theme-manager.php");
 
                                        // Run daily reset
                                        require_once(PATH."inc/theme-manager.php");
 
                                        // Run daily reset
-                                       // 01    2                            2        2         3321    1                         2                     21    1                        2                    21    1                        2                  21    1      2                 21    1         10
-                                       if ((date("d", $_CONFIG['last_update']) != date("d", time())) && (!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (!isset($_GET['register'])) && ($CSS != 1)) {
-                                               // Do daily things in external PHP file but only when script is completely setup
-                                               $INC_POOL = array();
-                                               $INC_POOL[] = sprintf("%sinc/reset/reset_daily.php", PATH);
-
-                                               // Daily reset was run!
-                                               define('__DAILY_RESET', true);
-
-                                               // Add more includes
-                                               RESET_ADD_INCLUDES();
-
-                                               // Run the full reset scripts
-                                               foreach ($INC_POOL as $incFile) {
-                                                       require_once($incFile);
-                                               } // END - foreach
-                                       } // END - if
+                                       require_once(PATH."inc/check-reset.php");
 
                                        // Load admin include file if he is admin
                                        if (IS_ADMIN()) {
 
                                        // Load admin include file if he is admin
                                        if (IS_ADMIN()) {
@@ -163,7 +147,7 @@ LIMIT 1", __FILE__, __LINE__);
                                        UPDATE_LOGIN_DATA();
 
                                        // Update online list
                                        UPDATE_LOGIN_DATA();
 
                                        // Update online list
-                                       UPDATE_ONLINE_LIST(get_session('PHPSESSID'), $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']);
+                                       UPDATE_ONLINE_LIST($PHPSESSID, $GLOBALS['module'], $GLOBALS['action'], $GLOBALS['what']);
 
                                        // Load theme name
                                        $currTheme = GET_CURR_THEME();
 
                                        // Load theme name
                                        $currTheme = GET_CURR_THEME();
@@ -182,7 +166,7 @@ LIMIT 1", __FILE__, __LINE__);
                                                        // Anything else like begging link
                                                        $GLOBALS['what'] = "";
                                                }
                                                        // Anything else like begging link
                                                        $GLOBALS['what'] = "";
                                                }
-                                       }
+                                       } // END - if
 
                                        // Update sending pool
                                        if (($CSS != "1") && ($CSS != "-1")) require_once(PATH."inc/pool-update.php"); // Sends out mails in configureable steps
 
                                        // Update sending pool
                                        if (($CSS != "1") && ($CSS != "-1")) require_once(PATH."inc/pool-update.php"); // Sends out mails in configureable steps
index 8ddbea29c9404486280f61d5c47c56b11b3f0e92..e1df712762f9ea86ceb7691c76a55959b953c2a1 100644 (file)
@@ -245,7 +245,7 @@ function ADD_DESCR($ACC_LVL, $file, $return = false, $output = true) {
                $AND = "";
        }
        if ((!isset($DEPTH)) && (!$return)) {
                $AND = "";
        }
        if ((!isset($DEPTH)) && (!$return)) {
-               $DEPTH = "0";
+               $DEPTH = 0;
                $prefix = "<DIV class=\"you_are_here\">".YOU_ARE_HERE."&nbsp;<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</A></STRONG>";
        } else {
                if (!$return) $DEPTH++;
                $prefix = "<DIV class=\"you_are_here\">".YOU_ARE_HERE."&nbsp;<STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</A></STRONG>";
        } else {
                if (!$return) $DEPTH++;
@@ -1004,7 +1004,7 @@ function REMOVE_RECEIVER(&$ARRAY, $key, $uid, $pool_id, $stats_id="", $bonus=fal
 //
 function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false)
 {
 //
 function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid", $onlyRows=false)
 {
-       $ret = "0";
+       $ret = 0;
        if ($onlyRows) {
                // Count rows
                $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
        if ($onlyRows) {
                // Count rows
                $result = SQL_QUERY_ESC("SELECT COUNT(%s) FROM "._MYSQL_PREFIX."_%s WHERE %s='%s'",
@@ -1021,7 +1021,7 @@ function GET_TOTAL_DATA($search, $tableName, $lookFor, $whereStatement="userid",
        SQL_FREERESULT($result);
        if (empty($ret)) {
                if (($lookFor == "counter") || ($lookFor == "id")) {
        SQL_FREERESULT($result);
        if (empty($ret)) {
                if (($lookFor == "counter") || ($lookFor == "id")) {
-                       $ret = "0";
+                       $ret = 0;
                } else {
                        $ret = "0.00000";
                }
                } else {
                        $ret = "0.00000";
                }
@@ -1057,7 +1057,7 @@ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $lock
        // Count up referral depth
        if (empty($DEPTH)) {
                // Initialialize referral system
        // Count up referral depth
        if (empty($DEPTH)) {
                // Initialialize referral system
-               $DEPTH = "0";
+               $DEPTH = 0;
        } else {
                // Increase referral level
                $DEPTH++;
        } else {
                // Increase referral level
                $DEPTH++;
@@ -1156,8 +1156,9 @@ function ADD_POINTS_REFSYSTEM($uid, $points, $send_notify=false, $rid="0", $lock
 function UPDATE_REF_COUNTER($uid)
 {
        global $REF_LVL, $cacheInstance;
 function UPDATE_REF_COUNTER($uid)
 {
        global $REF_LVL, $cacheInstance;
+
        // Make it sure referral level zero (member him-/herself) is at least selected
        // Make it sure referral level zero (member him-/herself) is at least selected
-       if (empty($REF_LVL)) $REF_LVL = "0";
+       if (empty($REF_LVL)) $REF_LVL = 0;
 
        // Update counter
        $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refsystem SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1",
 
        // Update counter
        $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refsystem SET counter=counter+1 WHERE userid=%s AND level='%s' LIMIT 1",
@@ -1191,45 +1192,50 @@ function UPDATE_REF_COUNTER($uid)
                if ($cacheInstance->cache_file("refsystem", true)) $cacheInstance->cache_destroy();
        }
 }
                if ($cacheInstance->cache_file("refsystem", true)) $cacheInstance->cache_destroy();
        }
 }
-//
-function UPDATE_ONLINE_LIST($SID, $mod, $act, $wht)
-{
+// Updates/extends the online list
+function UPDATE_ONLINE_LIST($SID, $mod, $act, $wht) {
        global $_CONFIG;
 
        // Do not update online list when extension is deactivated
        if (!EXT_IS_ACTIVE("online", true)) return;
 
        global $_CONFIG;
 
        // Do not update online list when extension is deactivated
        if (!EXT_IS_ACTIVE("online", true)) return;
 
+       // Empty session?
+       if (empty($SID)) {
+               // This is invalid here!
+               print "Invalid session. Backtrace:<pre>";
+               debug_print_backtrace();
+               die("</pre>");
+       } // END - if
+
        // Initialize variables
        // Initialize variables
-       $uid = "0"; $rid = "0"; $MEM = "N"; $ADMIN = "N";
-       if (!empty($GLOBALS['userid']))
-       {
-               // Update member status only when userid is valid
-               if (($GLOBALS['userid'] > 0) && (IS_MEMBER()))
-               {
-                       // Is valid user
-                       $uid = $GLOBALS['userid'];
-                       $MEM = "Y";
-               }
-       }
-       if (IS_ADMIN())
-       {
+       $uid = 0; $rid = 0; $MEM = "N"; $ADMIN = "N";
+
+       // Valid userid?
+       if ((!empty($GLOBALS['userid'])) && ($GLOBALS['userid'] > 0) && (IS_MEMBER())) {
+               // Is valid user
+               $uid = bigintval($GLOBALS['userid']);
+               $MEM = "Y";
+       } // END - if
+
+       if (IS_ADMIN()) {
                // Is administrator
                $ADMIN = "Y";
                // Is administrator
                $ADMIN = "Y";
-       }
+       } // END - if
+
        if (isSessionVariableSet('refid')) {
                // Check cookie
        if (isSessionVariableSet('refid')) {
                // Check cookie
-               if (get_session('refid') > 0) $rid = $GLOBALS['refid'];
-       }
+               if (get_session('refid') > 0) $rid = bigintval($GLOBALS['refid']);
+       } // END - if
 
 
-       // Now Read data
+       // Now search for the user
        $result = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_online
 WHERE sid='%s' LIMIT 1",
  array($SID), __FILE__, __LINE__);
 
        $result = SQL_QUERY_ESC("SELECT timestamp FROM "._MYSQL_PREFIX."_online
 WHERE sid='%s' LIMIT 1",
  array($SID), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) == 1)
-       {
-               SQL_FREERESULT($result);
-               $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_online SET
+       // Entry found?
+       if (SQL_NUMROWS($result) == 1) {
+               // Then update it
+               SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_online SET
 module='%s',
 action='%s',
 what='%s',
 module='%s',
 action='%s',
 what='%s',
@@ -1239,24 +1245,18 @@ is_member='%s',
 is_admin='%s',
 timestamp=UNIX_TIMESTAMP()
 WHERE sid='%s' LIMIT 1",
 is_admin='%s',
 timestamp=UNIX_TIMESTAMP()
 WHERE sid='%s' LIMIT 1",
- array(
-       $mod,
-       $act,
-       $wht,
-       bigintval($uid),
-       bigintval($rid),
-       $MEM,
-       $ADMIN,
-       $SID
-), __FILE__, __LINE__);
-       }
-        else
-       {
+                       array($mod, $act, $wht, $uid, $rid, $MEM, $ADMIN, $SID), __FILE__, __LINE__
+               );
+       } else {
                // No entry does exists so we simply add it!
                // No entry does exists so we simply add it!
-               $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_online (module, action, what, userid, refid, is_member, is_admin, timestamp, sid, ip) VALUES ('%s', '%s', '%s', %s, %s, '%s', '%s', UNIX_TIMESTAMP(), '%s', '%s')",
-                array($mod, $act, $wht, bigintval($uid), bigintval($rid), $MEM, $ADMIN, $SID, getenv('REMOTE_ADDR')), __FILE__, __LINE__);
+               SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_online (module, action, what, userid, refid, is_member, is_admin, timestamp, sid, ip) VALUES ('%s', '%s', '%s', %s, %s, '%s', '%s', UNIX_TIMESTAMP(), '%s', '%s')",
+                       array($mod, $act, $wht, $uid, $rid, $MEM, $ADMIN, $SID, getenv('REMOTE_ADDR')), __FILE__, __LINE__
+               );
        }
 
        }
 
+       // Free result
+       SQL_FREERESULT($result);
+
        // Purge old entries
        $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_online WHERE timestamp <= (UNIX_TIMESTAMP() - %s)",
         array($_CONFIG['online_timeout']), __FILE__, __LINE__);
        // Purge old entries
        $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_online WHERE timestamp <= (UNIX_TIMESTAMP() - %s)",
         array($_CONFIG['online_timeout']), __FILE__, __LINE__);
index 19659950bfa2e662378900bc91f45d3ce90793da..9eb7c43df2bb4850671e0d28d84ce5d30bd56bb2 100644 (file)
@@ -41,7 +41,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 // Check for patch level differences between databases and current hard-coded
 if (CURR_SVN_REVISION > $_CONFIG['patch_level']) {
        // Update database and CONFIG array
 // Check for patch level differences between databases and current hard-coded
 if (CURR_SVN_REVISION > $_CONFIG['patch_level']) {
        // Update database and CONFIG array
-       UPDATE_CONFIG(array("patch_level", "path_ctime"), array(CURR_SVN_REVISION, "UNIX_TIMESTAMP()"));
+       UPDATE_CONFIG(array("patch_level", "patch_ctime"), array(CURR_SVN_REVISION, "UNIX_TIMESTAMP()"));
        $_CONFIG['patch_level'] = CURR_SVN_REVISION;
        $_CONFIG['patch_ctime'] = time();
 } // END - if
        $_CONFIG['patch_level'] = CURR_SVN_REVISION;
        $_CONFIG['patch_ctime'] = time();
 } // END - if
index 592ef3b5fc49f32bd3fd84e5f2c3c409b049dd4c..fad28479f8f987dc9c705f0d4e97c9e74467d86f 100644 (file)
@@ -54,7 +54,7 @@ if ($HTML_EXT)
 }
 
 // Reset variables
 }
 
 // Reset variables
-$cnt = "0"; $cnt2 = "0"; $LAST_SENT_ID = "0"; $cnt_back = array("0"); $points_BACK = array("0");
+$cnt = 0; $cnt2 = 0; $LAST_SENT_ID = 0; $cnt_back = array("0"); $points_BACK = array("0");
 if (SQL_NUMROWS($result_main) > 0)
 {
        while ($DATA = SQL_FETCHROW($result_main))
 if (SQL_NUMROWS($result_main) > 0)
 {
        while ($DATA = SQL_FETCHROW($result_main))
@@ -208,7 +208,7 @@ if (SQL_NUMROWS($result_main) > 0)
                                                $result_user = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET timestamp_send=UNIX_TIMESTAMP() WHERE pool_id=%s LIMIT 1",
                                                 array(bigintval($DATA[0])), __FILE__, __LINE__);
 
                                                $result_user = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_stats SET timestamp_send=UNIX_TIMESTAMP() WHERE pool_id=%s LIMIT 1",
                                                 array(bigintval($DATA[0])), __FILE__, __LINE__);
 
-                                               $LAST_SENT_ID = $DATA[0]; $cnt = "0";
+                                               $LAST_SENT_ID = $DATA[0]; $cnt = 0;
                                                $cnt2 += $cnt;
 
                                                // Update mediadata if version is 0.0.4 or higher
                                                $cnt2 += $cnt;
 
                                                // Update mediadata if version is 0.0.4 or higher
index d18d2fbd629c3dbef228117e36d472918b147b23..b8adac194a26bb242491e2d848c64be7ee909b7c 100644 (file)
@@ -32,8 +32,7 @@
  ************************************************************************/
 
 // Some security stuff...
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
index 7710e9bf6553a3f1629d824d1b17c893fc2bbb76..b3c4dfbd554b8f103a2a79fdeb8c0b8e5ebd5358 100644 (file)
@@ -47,6 +47,7 @@ if (($VIEW == 1) && ($_SERVER['PHP_SELF'])) return;
 
 // Start the session
 @session_start();
 
 // Start the session
 @session_start();
+global $PHPSESSID;
 $PHPSESSID = @session_id();
 
 // Store language code in cookie
 $PHPSESSID = @session_id();
 
 // Store language code in cookie
index 1ac56046dccd60a7cdb3ade0be9f1ce54d45d197..6810f06aa3640aa10abcb69b18a1e0aed6e39249 100644 (file)
@@ -39,7 +39,7 @@ global $what, $action;
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Tell everyone we are in this module
 $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 
 // Tell everyone we are in this module
-$GLOBALS['module'] = "mailid";  $CSS = "0";
+$GLOBALS['module'] = "mailid";  $CSS = 0;
 
 // Load the required file(s)
 require ("inc/config.php");
 
 // Load the required file(s)
 require ("inc/config.php");
@@ -53,7 +53,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
        }
 
        // Secure all data
        }
 
        // Secure all data
-       $url_uid = "0"; $url_bid = "0"; $url_mid = "0"; $code = "0"; $mode = "";
+       $url_uid = 0; $url_bid = 0; $url_mid = 0; $code = 0; $mode = "";
        if (!empty($_GET['uid']))     $url_uid = bigintval($_GET['uid']);
        if (!empty($_GET['mailid']))  $url_mid = bigintval($_GET['mailid']);
        if (!empty($_GET['bonusid'])) $url_bid = bigintval($_GET['bonusid']);
        if (!empty($_GET['uid']))     $url_uid = bigintval($_GET['uid']);
        if (!empty($_GET['mailid']))  $url_mid = bigintval($_GET['mailid']);
        if (!empty($_GET['bonusid'])) $url_bid = bigintval($_GET['bonusid']);
diff --git a/ref.php b/ref.php
index d733f53f890d8728273b27f436b060d88761f03d..dbbff4b257a41a5bf132fc18bb861edfa7f30d43 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -73,7 +73,7 @@ if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_install
                } // END - if
 
                // Also edit this 0 !
                } // END - if
 
                // Also edit this 0 !
-               if (empty($ref)) $ref = "0";
+               if (empty($ref)) $ref = 0;
 
                // We have an refid here. So we simply add it
                $URL .= bigintval($ref);
 
                // We have an refid here. So we simply add it
                $URL .= bigintval($ref);