require($INC);
} elseif (!IS_MEMBER()) {
// User is not logged in
- LOAD_URL('modules.php?module=index');
+ redirectToUrl('modules.php?module=index');
} elseif ((!EXT_IS_ACTIVE('wernis')) && (!IS_ADMIN())) {
- addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'wernis');
+ addFatalMessage(__FILE__, __LINE__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'wernis'));
return;
}
ADD_DESCR('member', __FILE__);
// Check if the admin has entered the data
-if ((getConfig('wernis_api_id') == "") || (getConfig('wernis_api_md5') == "")) {
+if ((getConfig('wernis_api_id') == '') || (getConfig('wernis_api_md5') == '')) {
// Something important is missing...
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_API_DATA_MISSING'));
return;
while ($data = SQL_FETCHARRAY($result)) {
// Prepare data for output
$rowContent = array(
- 'stamp' => MAKE_DATETIME($data['wernis_timestamp'], "2"),
- 'points' => TRANSLATE_COMMA($data['wernis_amount']),
+ 'stamp' => generateDateTime($data['wernis_timestamp'], '2'),
+ 'points' => translateComma($data['wernis_amount']),
'acc' => bigintval($data['wernis_account']),
'status' => WERNIS_TRANSFER_STATUS($data['wernis_type']),
'raw_type' => strtolower($data['wernis_type']),
// Is this enougth for a payout?
if ($points < getConfig('wernis_min_payout')) {
// No, then abort here
- LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MIN_PAYOUT'), TRANSLATE_COMMA(getConfig('wernis_min_payout'))));
+ LOAD_TEMPLATE('admin_settings_saved', false, sprintf(getMessage('WERNIS_MEMBER_MIN_PAYOUT'), translateComma(getConfig('wernis_min_payout'))));
return;
} // END - if
// No dots here...
- $points = explode(".", $points);
+ $points = explode('.', $points);
$points = bigintval($points[0]);
// Add points to content array
- $content['points'] = TRANSLATE_COMMA($points);
- $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_payout'));
+ $content['points'] = translateComma($points);
+ $content['min_points'] = translateComma(getConfig('wernis_min_payout'));
// Add fees to array
WERNIS_ADD_FEES_TO_ARRAY($content);
$points = GET_TOTAL_DATA(getUserId(), "user_points", "points") - GET_TOTAL_DATA(getUserId(), "user_data", "used_points");
// Prepare data for the template
- $content['points'] = TRANSLATE_COMMA($points);
- $content['min_points'] = TRANSLATE_COMMA(getConfig('wernis_min_withdraw'));
+ $content['points'] = translateComma($points);
+ $content['min_points'] = translateComma(getConfig('wernis_min_withdraw'));
$content['wds66_id'] = '';
// Add fees to array
if ($success) {
// Add it to this amount
unset($GLOBALS['ref_level']);
- ADD_POINTS_REFSYSTEM("wernis_withdraw", getUserId(), bigintval(REQUEST_POST('amount')), false, 0, false, "direct");
+ ADD_POINTS_REFSYSTEM_DIRECT('wernis_withdraw', getUserId(), bigintval(REQUEST_POST('amount')));
// Update the user data as well..
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",