}
// Add description as navigation point
-ADD_DESCR("member", basename(__FILE__));
+ADD_DESCR("member", __FILE__);
-$result_depths = SQL_QUERY("SELECT level, percents FROM "._MYSQL_PREFIX."_refdepths ORDER BY level", __FILE__, __LINE__);
+$result_depths = SQL_QUERY("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
$depths = SQL_NUMROWS($result_depths);
// Add many more rows for the login/turbo/ref/order bonus
// Initialize ref-count
$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=%d LIMIT 1", array($GLOBALS['userid'], bigintval($lvl)), __FILE__, __LINE__);
+ // Load referal points
+ $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__);
+ // Load referal 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__);
if (SQL_NUMROWS($result_refs) == 1) {
list($REFS) = SQL_FETCHROW($result_refs);
SQL_FREERESULT($result_refs);
// 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
// Put rows to constant for the main template
define('__REF_LEVEL_ROWS', $OUT);
-$result = SQL_QUERY_ESC("SELECT used_points, ref_payout FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
- array($GLOBALS['userid']), __FILE__, __LINE__);
+$result = SQL_QUERY_ESC("SELECT used_points, ref_payout FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
list($USED, $PAY) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
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=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT mails_confirmed".$ADD." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__);
list($CONFIRMED, $SENT, $RECEIVED) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
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")) setConfigEntry('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")) && (getConfig('bonus_active') == "Y")) {
$ADD = ", 0, 0, 0";
if (GET_EXT_VERSION("bonus") >= "0.4.4") $ADD = ", bonus_ref, bonus_order, bonus_stats";
// Load data
- $result = SQL_QUERY_ESC("SELECT login_bonus, turbo_bonus".$ADD." FROM "._MYSQL_PREFIX."_user_data WHERE userid=%s LIMIT 1",
- array($GLOBALS['userid']), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT login_bonus, turbo_bonus".$ADD." FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
+ array($GLOBALS['userid']), __FILE__, __LINE__);
// We don't add this points now. This will be done after each month
list($login, $turbo, $ref, $order, $stats) = SQL_FETCHROW($result);
define('__LOGIN_VALUE', TRANSLATE_COMMA($login));
if (GET_EXT_VERSION("bonus") >= "0.4.4") {
- // Add referral, stats and order bonys
+ // Add referal, stats and order bonys
define('__REF_VALUE' , TRANSLATE_COMMA($ref));
define('__ORDER_VALUE', TRANSLATE_COMMA($order));
define('__STATS_VALUE', TRANSLATE_COMMA($stats));
// Output rows
define('__SPECIAL_ROWS', LOAD_TEMPLATE("member_points_bonus_rows", true));
-} elseif ($_CONFIG['bonus_active'] == "N") {
+} elseif (getConfig('bonus_active') != "Y") {
// 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 {
LOAD_TEMPLATE("member_points");
} elseif (IS_ADMIN()) {
// Missing extension
- ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "user"));
+ addFatalMessage(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "user");
} else {
// Message for user
- LOAD_TEMPLATE("admin_settings_saved", false, PROBLEM_POINTS_OVERVIEW_UNAVAILABLE);
+ LOAD_TEMPLATE("admin_settings_saved", false, getMessage('PROBLEM_POINTS_OVERVIEW_UNAVAILABLE'));
}
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)));
}
//