X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-points.php;h=0cb4d3cbcdf8816542e2a57ea4cdc4cd06ce65c7;hp=129fb4026384d3410d18aa52689aeaf7e5cfd6fb;hb=f7f6e55ee0d90558ad773ce6168767c0af816696;hpb=0369c36aaab5af6ed44da1e13a53baef285f79b4 diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 129fb40263..0cb4d3cbcd 100644 --- a/inc/modules/member/what-points.php +++ b/inc/modules/member/what-points.php @@ -32,7 +32,7 @@ ************************************************************************/ // Some security stuff... -if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) { +if (!defined('__SECURITY')) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; require($INC); } elseif (!IS_MEMBER()) { @@ -62,18 +62,19 @@ while (list($lvl, $per) = SQL_FETCHROW($result_depths)) { $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__); + $result_points = SQL_QUERY_ESC("SELECT points, locked_points FROM "._MYSQL_PREFIX."_user_points WHERE userid=%s AND ref_depth=%d LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); if (SQL_NUMROWS($result_points) == 1) { - list($points, $LOCKED) = SQL_FETCHROW($result_points); + list($points, $locked) = SQL_FETCHROW($result_points); SQL_FREERESULT($result_points); // Also count locked points - $TPTS += $points; $TLOCK += $LOCKED; + $TPTS += $points; $TLOCK += $locked; } else { - $points = "0.00000"; $LOCKED = "0.00000"; + $points = "0.00000"; $locked = "0.00000"; } // Load referral counts - $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%s AND level='%s' LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); + $result_refs = SQL_QUERY_ESC("SELECT counter FROM "._MYSQL_PREFIX."_refsystem WHERE userid=%s AND level=%s LIMIT 1", + array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__); if (SQL_NUMROWS($result_refs) == 1) { list($REFS) = SQL_FETCHROW($result_refs); SQL_FREERESULT($result_refs); @@ -136,7 +137,7 @@ define('__TREF_VALUE' , $TREF); define('__TLOCK_VALUE', TRANSLATE_COMMA($TLOCK)); // Fixes a bug when there is no bonus extension installed -if (GET_EXT_VERSION("bonus") < "0.4.4") $_CONFIG['bonus_active'] = "X"; +if (EXT_VERSION_IS_OLDER("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")) { @@ -170,7 +171,7 @@ if ((GET_EXT_VERSION("bonus") >= "0.2.2") && (EXT_IS_ACTIVE("bonus")) && ($_CONF } 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()) && (EXT_VERSION_IS_OLDER("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 {