From 63ca4d88dd8bfe31b966f6cbe1f8283f888639cf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 17 Mar 2008 13:53:24 +0000 Subject: [PATCH] Wernis extension fixed (2) --- inc/modules/member/what-points.php | 61 +++++++++--------------------- 1 file changed, 17 insertions(+), 44 deletions(-) diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index bebd685edf..777498bb77 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -32,13 +32,10 @@ ************************************************************************/ // 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); -} - elseif (!IS_LOGGED_IN()) -{ +} elseif (!IS_LOGGED_IN()) { LOAD_URL("modules.php?module=index"); } @@ -61,35 +58,28 @@ define('__ROWS_VALUE', ($depths*2+15)); $TPTS = "0"; $TREF = "0"; $TLOCK = "0"; $OUT = ""; // Load ref levels -while (list($lvl, $per) = SQL_FETCHROW($result_depths)) -{ +while (list($lvl, $per) = SQL_FETCHROW($result_depths)) { // Initialize ref-count $REFS = "0"; // Load referral points $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%d AND ref_depth=%d LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); - if (SQL_NUMROWS($result_points) == 1) - { + if (SQL_NUMROWS($result_points) == 1) { list($points, $LOCKED) = SQL_FETCHROW($result_points); SQL_FREERESULT($result_points); // Also count locked points $TPTS += $points; $TLOCK += $LOCKED; - } - else - { + } else { $points = "0.00000"; $LOCKED = "0.00000"; } // Load referral counts $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%d AND level='%s' LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); - if (SQL_NUMROWS($result_refs) == 1) - { + if (SQL_NUMROWS($result_refs) == 1) { list($REFS) = SQL_FETCHROW($result_refs); SQL_FREERESULT($result_refs); $TREF += $REFS; - } - else - { + } else { $REFS = "0"; } @@ -120,11 +110,9 @@ SQL_FREERESULT($result); $CONFIRMED = "---"; $SENT = "---"; $RECEIVED = "---"; // Only user >= v0.1.2: Fetch confirmed mails counter -if (GET_EXT_VERSION("user") >= "0.1.2") -{ +if (GET_EXT_VERSION("user") >= "0.1.2") { $ADD = ""; - if (GET_EXT_VERSION("user") >= "0.1.4") - { + if (GET_EXT_VERSION("user") >= "0.1.4") { $ADD = ", emails_sent, emails_received"; } $result = SQL_QUERY_ESC("SELECT mails_confirmed".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%d LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); @@ -134,9 +122,7 @@ if (GET_EXT_VERSION("user") >= "0.1.2") // Please update the user extension if you see 3 dashes if (empty($SENT)) $SENT = "---"; if (empty($RECEIVED)) $RECEIVED = "---"; -} - else -{ +} else { // Please update! $CONFIRMED = "---"; } @@ -154,8 +140,7 @@ define('__TLOCK_VALUE', TRANSLATE_COMMA($TLOCK)); if (GET_EXT_VERSION("bonus") < "0.4.4") $_CONFIG['bonus_active'] = "X"; // Display login bonus and turbo-click bonus -if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONFIG['bonus_active'] == 'Y')) -{ +if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONFIG['bonus_active'] == 'Y')) { $ADD = ", 0, 0, 0"; if (GET_EXT_VERSION("bonus") >= "0.4.4") $ADD = ", bonus_ref, bonus_order, bonus_stats"; @@ -171,8 +156,7 @@ if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONF define('__TURBO_VALUE', TRANSLATE_COMMA($turbo)); define('__LOGIN_VALUE', TRANSLATE_COMMA($login)); - if (GET_EXT_VERSION("bonus") >= "0.4.4") - { + if (GET_EXT_VERSION("bonus") >= "0.4.4") { // Add referral, stats and order bonys define('__REF_VALUE' , TRANSLATE_COMMA($ref)); define('__ORDER_VALUE', TRANSLATE_COMMA($order)); @@ -184,19 +168,13 @@ if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONF // Output rows define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_rows", true)); -} - elseif ($_CONFIG['bonus_active'] == 'N') -{ +} elseif ($_CONFIG['bonus_active'] == 'N') { // Bonus active rallye deactivated define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_disabled", true)); -} - elseif ((IS_ADMIN()) && (GET_EXT_VERSION("bonus") < "0.2.2") && (EXT_IS_ACTIVE("bonus"))) -{ +} elseif ((IS_ADMIN()) && (GET_EXT_VERSION("bonus") < "0.2.2") && (EXT_IS_ACTIVE("bonus"))) { // Please upgrade your bonus extension to v0.2.2 or newer! define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_upgrade")); -} - else -{ +} else { // Members shall see no special rows here define('__SPECIAL_ROWS', ""); } @@ -219,16 +197,11 @@ if (EXT_IS_ACTIVE("user")) { LOAD_TEMPLATE("admin_settings_saved", false, PROBLEM_POINTS_OVERVIEW_UNAVAILABLE); } -if (EXT_IS_ACTIVE("payout")) -{ +if (EXT_IS_ACTIVE("payout")) { // Payput extension is installed and active so we can check if the user has enougth points PAYOUT_OUTPUT_PAYOUT_LIST(str_replace(",", ".", ($TPTS - $USED))); } -if (EXT_IS_ACTIVE("wernis")) -{ - // Payput extension is installed and active so we can check if the user has enougth points - WERNIS_OUTPUT_WERNIS_LIST(str_replace(",", ".", ($TPTS - $USED))); -} + CLOSE_TABLE(); // ?> -- 2.39.5