From 0369c36aaab5af6ed44da1e13a53baef285f79b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 12 Sep 2008 16:51:08 +0000 Subject: [PATCH] Reset rewritten, SQL fixed, zeros are now numeric --- .gitattributes | 1 + beg.php | 2 +- doubler.php | 2 +- inc/autopurge.php | 8 +- inc/check-reset.php | 56 +++++++ inc/databases.php | 2 +- inc/db/lib-mysql3.php | 4 +- inc/doubler_send.php | 6 +- inc/functions.php | 157 +++++++++----------- inc/gen_mediadata.php | 10 +- inc/libs/admins_functions.php | 4 +- inc/libs/autopurge_functions.php | 2 +- inc/libs/bonus_functions.php | 4 +- inc/libs/cache_functions.php | 2 +- inc/libs/doubler_functions.php | 6 +- inc/libs/rallye_functions.php | 10 +- inc/libs/sponsor_functions.php | 2 +- inc/libs/surfbar_functions.php | 4 +- inc/libs/task_functions.php | 2 +- inc/libs/user_functions.php | 4 +- inc/modules/admin/what-admins_mails.php | 2 +- inc/modules/admin/what-del_transfer.php | 2 +- inc/modules/admin/what-email_details.php | 2 +- inc/modules/admin/what-extensions.php | 8 +- inc/modules/admin/what-list_payouts.php | 18 +-- inc/modules/admin/what-list_rallyes.php | 6 +- inc/modules/admin/what-list_sponsor.php | 2 +- inc/modules/admin/what-list_transfer.php | 2 +- inc/modules/admin/what-list_unconfirmed.php | 2 +- inc/modules/admin/what-send_bonus.php | 2 +- inc/modules/admin/what-theme_check.php | 2 +- inc/modules/admin/what-updates.php | 2 +- inc/modules/guest/what-login.php | 6 +- inc/modules/guest/what-mediadata.php | 48 +++--- inc/modules/member/what-order.php | 6 +- inc/modules/member/what-payout.php | 2 +- inc/modules/member/what-points.php | 6 +- inc/modules/member/what-transfer.php | 4 +- inc/modules/member/what-unconfirmed.php | 2 +- inc/mysql-connect.php | 22 +-- inc/mysql-manager.php | 88 +++++------ inc/patch-system.php | 2 +- inc/pool-update.php | 4 +- inc/reset/reset_daily.php | 3 +- inc/session.php | 1 + mailid_top.php | 4 +- ref.php | 2 +- 47 files changed, 278 insertions(+), 260 deletions(-) create mode 100644 inc/check-reset.php diff --git a/.gitattributes b/.gitattributes index ee112d0aa8..98ad788718 100644 --- a/.gitattributes +++ b/.gitattributes @@ -79,6 +79,7 @@ inc/.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 diff --git a/beg.php b/beg.php index a7e4e82aef..d207d5cf54 100644 --- 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 - $uid = "0"; + $uid = 0; } } diff --git a/doubler.php b/doubler.php index 53ee068260..eab1a6d533 100644 --- a/doubler.php +++ b/doubler.php @@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = ""; // Set module $GLOBALS['module'] = "doubler"; $GLOBALS['refid'] = 0; -$CSS = "0"; +$CSS = 0; // Load the required file(s) require ("inc/config.php"); diff --git a/inc/autopurge.php b/inc/autopurge.php index 6873a1542a..a0896be2c3 100644 --- a/inc/autopurge.php +++ b/inc/autopurge.php @@ -51,7 +51,7 @@ if (($_CONFIG['auto_purge_active'] == "Y") && ($_CONFIG['auto_purge'] > 0)) } // 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 @@ -63,7 +63,7 @@ WHERE s.timestamp_ordered <= %s ORDER BY s.userid", 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 @@ -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); - $points = "0"; + $points = 0; } // 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 - $points = "0"; + $points = 0; 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 index 0000000000..7596a8d6d4 --- /dev/null +++ b/inc/check-reset.php @@ -0,0 +1,56 @@ + diff --git a/inc/databases.php b/inc/databases.php index 28f1bb9154..a5f1522c60 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); 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); diff --git a/inc/db/lib-mysql3.php b/inc/db/lib-mysql3.php index dbc6571506..f09301c9b4 100644 --- a/inc/db/lib-mysql3.php +++ b/inc/db/lib-mysql3.php @@ -105,10 +105,10 @@ function SQL_NUMROWS($result) { $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; } diff --git a/inc/doubler_send.php b/inc/doubler_send.php index 71685ced4e..1fe8475e0f 100644 --- a/inc/doubler_send.php +++ b/inc/doubler_send.php @@ -38,7 +38,7 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { } // Initialize variables -$jackpot = "0"; $user = "0"; +$jackpot = 0; $user = 0; // 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', ""); -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); @@ -103,7 +103,7 @@ if (((SQL_NUMROWS($result_total) > 0) && ($_CONFIG['doubler_sent_all'] == "Y")) else { // No referral points found - $ref = "0"; + $ref = 0; } // Exclude webmaster from doubling... diff --git a/inc/functions.php b/inc/functions.php index 6484f86506..8b416e865c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -597,7 +597,7 @@ function FRAMETESTER($URL) { } // function SELECTION_COUNT($array) { - $ret = "0"; + $ret = 0; 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++) { - $OUT .= " \n"; + $OUT .= "\n"; } } else { // Get current year and subtract 16 (for erotic content) - $OUT .= " \n"; + $OUT .= "\n"; $YEAR = date('Y', time()) - 16; for ($idx = 1930; $idx <= $YEAR; $idx++) { - $OUT .= "