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__, sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), 'wernis'));
+ addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('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;
// Get WDS66 id
$result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ array(getUserId()), __FILE__, __LINE__);
// Are there some entries?
if (SQL_NUMROWS($result) == 1) {
// And load all rows!
$result = SQL_QUERY_ESC("SELECT `id`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type` FROM `{!_MYSQL_PREFIX!}_user_wernis` WHERE `userid` = %s ORDER BY `wernis_timestamp` DESC",
- array(getUserId()), __FILE__, __LINE__);
+ array(getUserId()), __FILE__, __LINE__);
// Load all rows
$content['rows'] = ''; $SW = 2;
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);
// Get WDS66 id
$content['wds66_id'] = '';
$result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ array(getUserId()), __FILE__, __LINE__);
// Are there some entries?
if (SQL_NUMROWS($result) == 1) {
$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
// Get WDS66 id
$result = SQL_QUERY_ESC("SELECT wernis_userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s LIMIT 1",
- array(getUserId()), __FILE__, __LINE__);
+ array(getUserId()), __FILE__, __LINE__);
// Are there some entries?
if (SQL_NUMROWS($result) == 1) {
}
// Is the formular sent?
-if ((IS_FORM_SENT()) && (REQUEST_ISSET_GET(('mode')))) {
+if ((isFormSent()) && (REQUEST_ISSET_GET(('mode')))) {
// Is the user ID and password set?
if (!REQUEST_ISSET_POST(('wds66_id'))) {
// Nothing entered in WDS66 user ID
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",
- array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
+ array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
// All done!
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_WITHDRAW_DONE'));
// Update WDS66 id
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `wernis_userid`=%s WHERE userid=%s LIMIT 1",
- array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
+ array(bigintval(REQUEST_POST('wds66_id')), getUserId()), __FILE__, __LINE__);
// All done!
LOAD_TEMPLATE('admin_settings_saved', false, getMessage('WERNIS_MEMBER_PAYOUT_DONE'));