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
define('__BEG_POINTS', TRANSLATE_COMMA($points));
} else {
// Other status
- $uid = "0";
+ $uid = 0;
}
}
// Set module
$GLOBALS['module'] = "doubler";
$GLOBALS['refid'] = 0;
-$CSS = "0";
+$CSS = 0;
// Load the required file(s)
require ("inc/config.php");
}
// 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
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
{
// 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;
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
--- /dev/null
+<?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
+
+//
+?>
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);
$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!
- $lines = "0";
+ $lines = 0;
}
return $lines;
}
}
// Initialize variables
-$jackpot = "0"; $user = "0";
+$jackpot = 0; $user = 0;
// Get total points of the doubler itself
$DOUBLER_POINTS = DOUBLER_GET_TOTAL_POINTS_LEFT();
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);
else
{
// No referral points found
- $ref = "0";
+ $ref = 0;
}
// Exclude webmaster from doubling...
}
//
function SELECTION_COUNT($array) {
- $ret = "0";
+ $ret = 0;
if (is_array($array)) {
foreach ($array as $key => $sel) {
if (!empty($sel)) $ret++;
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";
}
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";
}
{
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";
}
// 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)
- $OUT .= " <OPTION value=\"1929\"><1930</OPTION>\n";
+ $OUT .= "<OPTION value=\"1929\"><1930</OPTION>\n";
$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";
}
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;
- $OUT .= " <OPTION value=\"".$idx."\"";
+ $OUT .= "<OPTION value=\"".$idx."\"";
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;
- $OUT .= " <OPTION value=\"".$idx."\"";
+ $OUT .= "<OPTION value=\"".$idx."\"";
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\"";
- $OUT .= ">".YES."</OPTION>
- <OPTION value=\"N\"";
+ $OUT .= ">".YES."</OPTION>\n<OPTION value=\"N\"";
if ($DEFAULT == "N") $OUT .= " selected=\"selected\"";
$OUT .= ">".NO."</OPTION>\n";
break;
// 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;
+
// 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;
+
// First of all years...
$Y = abs(floor($timestamp / (31536000 + $SWITCH)));
// Next months...
$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...
//
- if ($return_array)
- {
+ if ($return_array) {
// Just put all data in an array for later use
$OUT = array(
'YEARS' => $Y,
'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";
- 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";
}
- 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";
}
- 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";
}
- 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";
}
- 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";
}
- 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";
}
- 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 .= "</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";
- 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";
- }
- else
- {
+ } else {
$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++)
$OUT .= ">".$idx."</OPTION>\n";
}
$OUT .= " </SELECT></TD>\n";
- }
- else
- {
+ } else {
$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";
- 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";
- }
- else
- {
+ } else {
$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";
- 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";
- }
- else
- {
+ } else {
$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";
- 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";
- }
- else
- {
+ } else {
$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";
- 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";
- }
- else
- {
+ } else {
$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";
- 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";
- }
- else
- {
+ } else {
$OUT .= "<INPUT type=\"hidden\" name=\"".$prefix."_se\" value=\"0\">\n";
}
$OUT .= "</TR>\n";
}
//
function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) {
- $ret = "0";
+ $ret = 0;
+
// Do we have a leap year?
$SWITCH = 0;
$TEST = date('Y', time()) / 4;
}
// 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")) {
} // 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());
// Update config
UPDATE_CONFIG("last_month", $currMonth);
} // END - if
+
+ // Return array
+ return $INC_POOL;
}
// Handle extra values
function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) {
$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);
$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!
- $bsent = "0"; $bclicks = "0";
+ $bsent = 0; $bclicks = 0;
}
// Load (maybe) missing file
global $cacheInstance;
// Begin the update
- $cacheInstance_UPDATE = "0";
+ $cacheInstance_UPDATE = 0;
foreach ($POST['login'] as $id => $login) {
// Secure ID number
$id = bigintval($id);
// 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);
{
// ... to jackpot account
ADD_JACKPOT($points);
- if (empty($jackpot)) $jackpot = "0";
+ if (empty($jackpot)) $jackpot = 0;
$jackpot += $points;
}
else
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__);
- $bonus = "0"; $mail = $mid;
+ $bonus = 0; $mail = $mid;
break;
}
$ctime = filectime($inc);
} else {
// No, it doesn't. Zero date/time
- $ctime = "0";
+ $ctime = 0;
}
// Remember change date/time in class
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
{
global $_CONFIG;
// Initialize variables
- $points = "0";
+ $points = 0;
if ($_CONFIG['doubler_own'] == "Y")
{
// 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",
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;
$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);
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;
SQL_FREERESULT($result_ref);
if (empty($cnt))
{
- $cnt = "0";
+ $cnt = 0;
}
else
{
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 = "";
$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')",
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
if (empty($TITLEs[$key])) $TITLEs[$key] = TASK_ADMIN_UNKNOWN_LIST_TITLE;
$content['row_link'] = "<A href=\"".URL."/modules.php?module=admin&what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</A>";
} else {
- $content['row_link'] = "0";
+ $content['row_link'] = 0;
}
// Switch color
function alpha($sortby, $colspan, $return=false)
{
global $_CONFIG;
- if (empty($_GET['offset'])) $_GET['offset'] = "0";
+ if (empty($_GET['offset'])) $_GET['offset'] = 0;
$ADD = "&page=".$_GET['page']."&offset=".$_GET['offset'];
if (!empty($_GET['mode'])) $ADD .= "&mode=".SQL_ESCAPE($_GET['mode']);
function SortLinks($letter, $sortby, $colspan, $return=false)
{
$OUT = "";
- if (empty($_GET['offset'])) $_GET['offset'] = "0";
+ if (empty($_GET['offset'])) $_GET['offset'] = 0;
$ADD = "&page=".$_GET['page']."&offset=".$_GET['offset'];
if (!empty($_GET['mode'])) $ADD .= "&mode=".SQL_ESCAPE($_GET['mode']);
// 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\">
// 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
elseif ($unconfirmed < 0)
{
// Sometimes rarely displayed minus values will be "fixed" to zero
- $unconfirmed = "0";
+ $unconfirmed = 0;
}
// List mail
// 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'])) {
// 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);
$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);
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));
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);
- 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);
- }
- else
- {
+ } else {
// 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__);
// 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':
{
case 'Y':
$content['notify_title'] = RALLYE_STOP_NOTIFY_NOW;
- $content['notify'] = "0";
+ $content['notify'] = 0;
break;
case 'N':
{
case 'Y':
$content['auto_title'] = RALLYE_STOP_AUTO_ADD_NOW;
- $content['auto'] = "0";
+ $content['auto'] = 0;
break;
case 'N':
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
// 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
// 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));
$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
// 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");
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++) {
}
} elseif (!empty($_POST['new_pass'])) {
// New password requested
- $UID = "0";
+ $UID = 0;
if (!empty($_POST['id'])) $UID = $_POST['id'];
} else {
// Not logged in
- $UID = "0"; $hash = "";
+ $UID = 0; $hash = "";
}
$URL = ""; $ADD = "";
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']));
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");
-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");
-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");
- 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");
- if (empty($dmy)) $dmy = "0";
- if (empty($dmy2)) $dmy2 = "0";
+ if (empty($dmy)) $dmy = 0;
+ if (empty($dmy2)) $dmy2 = 0;
$sent += $dmy2; $clicks += $dmy;
}
$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
// 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);
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);
$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
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);
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
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
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);
$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
$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);
$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
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
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
- $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__);
SQL_FREERESULT($result_refs);
$TREF += $REFS;
} else {
- $REFS = "0";
+ $REFS = 0;
}
// Transfer data to array for template
}
// Run the SQL command
- $total = "0";
+ $total = 0;
$result = SQL_QUERY_ESC($SQL, array($GLOBALS['userid']), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
// Free memory
SQL_FREERESULT($result);
- $total = "0";
+ $total = 0;
if (SQL_NUMROWS($result) > 0)
{
// Output rows
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...
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()) {
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();
// 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
$AND = "";
}
if ((!isset($DEPTH)) && (!$return)) {
- $DEPTH = "0";
+ $DEPTH = 0;
$prefix = "<DIV class=\"you_are_here\">".YOU_ARE_HERE." <STRONG><A class=\"you_are_here\" href=\"".URL."/modules.php?module=".$GLOBALS['module'].$LINK_ADD."\">Home</A></STRONG>";
} else {
if (!$return) $DEPTH++;
//
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'",
SQL_FREERESULT($result);
if (empty($ret)) {
if (($lookFor == "counter") || ($lookFor == "id")) {
- $ret = "0";
+ $ret = 0;
} else {
$ret = "0.00000";
}
// Count up referral depth
if (empty($DEPTH)) {
// Initialialize referral system
- $DEPTH = "0";
+ $DEPTH = 0;
} else {
// Increase referral level
$DEPTH++;
function UPDATE_REF_COUNTER($uid)
{
global $REF_LVL, $cacheInstance;
+
// 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",
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;
+ // Empty session?
+ if (empty($SID)) {
+ // This is invalid here!
+ print "Invalid session. Backtrace:<pre>";
+ debug_print_backtrace();
+ die("</pre>");
+ } // END - if
+
// 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";
- }
+ } // END - if
+
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__);
- 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',
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!
- $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__);
// 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
}
// 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))
$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
************************************************************************/
// 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);
}
// Start the session
@session_start();
+global $PHPSESSID;
$PHPSESSID = @session_id();
// Store language code in cookie
$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");
}
// 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']);
} // 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);