X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fmember%2Fwhat-points.php;h=e4935abd61b1135030065fb83c054b119901e602;hp=87f17ee8ed16cff002a458fd6df5c98a883b72d4;hb=b3f82be7e5ecc294acfe9c00ef75e3dc0c8b43d1;hpb=6032b7018b83778f1592383238f4e0d28f718622 diff --git a/inc/modules/member/what-points.php b/inc/modules/member/what-points.php index 87f17ee8ed..e4935abd61 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()) { @@ -54,40 +54,41 @@ if (GET_EXT_VERSION("bonus") >= "0.4.4") $depths += 4; 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__); + $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); $TREF += $REFS; } else { - $REFS = "0"; + $REFS = 0; } // Transfer data to array for template $content = array( 'lvl' => $lvl, - 'per' => $per, + 'per' => TRANSLATE_COMMA($per), 'points' => TRANSLATE_COMMA($points), - 'refs' => $REFS, + 'refs' => TRANSLATE_COMMA($REFS), ); // Output row @@ -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 { @@ -198,7 +199,7 @@ if (EXT_IS_ACTIVE("user")) { 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))); + PAYOUT_OUTPUT_PAYOUT_LIST(REVERT_COMMA(($TPTS - $USED))); } //