X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_points.php;h=73e80fc3c6306599a465506e90b57fb3bb700008;hb=d9f35786166902b9bc3f402d4f2abeed5ae0528d;hp=53cbc18472f81738df2793b05152e057a2391392;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e;p=mailer.git
diff --git a/inc/modules/admin/what-config_points.php b/inc/modules/admin/what-config_points.php
index 53cbc18472..73e80fc3c6 100644
--- a/inc/modules/admin/what-config_points.php
+++ b/inc/modules/admin/what-config_points.php
@@ -1,7 +1,7 @@
$value) {
- // Secure ID
+ foreach (postRequestParameter('level') as $id => $value) {
+ // Secure id
$id = bigintval($id);
// Revert german commata
- setRequestPostElement('perc', array($id => convertCommaToDot(postRequestElement('perc', $id))));
+ setPostRequestParameter('percents', array($id => convertCommaToDot(postRequestParameter('percents', $id))));
// Update entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_refdepths` SET level='%s', percents='%s' WHERE `id`=%s LIMIT 1",
- array(bigintval($value), postRequestElement('perc', $id), $id), __FILE__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_refdepths` SET `level`='%s', `percents`='%s' WHERE `id`=%s LIMIT 1",
+ array(bigintval($value), postRequestParameter('percents', $id), $id), __FILE__, __LINE__);
}
$message = getMessage('REF_DEPTHS_SAVED');
break;
case 'del':
- foreach (postRequestElement('id') as $id => $value) {
+ foreach (postRequestParameter('id') as $id => $value) {
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
}
@@ -109,22 +110,23 @@ if (isFormSent()) {
}
// Update cache file
- if (getExtensionVersion('cache') >= '0.1.2') {
+ // @TODO Rewrite this to a filter
+ if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
if ($GLOBALS['cache_instance']->loadCacheFile('refdepths')) $GLOBALS['cache_instance']->removeCacheFile();
- }
+ } // END - if
break;
case 'settings':
- $REF = bigintval(postRequestElement('ref_payout'));
+ $REF = bigintval(postRequestParameter('ref_payout'));
updateConfiguration(
array('allow_direct_pay', 'reg_points_mode', 'ref_payout'),
- array(postRequestElement('allow_direct_pay'), postRequestElement('reg_points_mode'), $REF)
+ array(postRequestParameter('allow_direct_pay'), postRequestParameter('reg_points_mode'), $REF)
);
- if ((getConfig('ref_payout') == 0) && (postRequestElement('ref_payout') > 0)) {
+ if ((getConfig('ref_payout') == '0') && (postRequestParameter('ref_payout') > 0)) {
// Update account's ref_payout for "must-confirm"
addSql(sprintf("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=(%s - `mails_confirmed`)
WHERE `mails_confirmed` < %s", $REF, $REF));
- } elseif ((getConfig('ref_payout') > 0) && (postRequestElement('ref_payout') == 0)) {
+ } elseif ((getConfig('ref_payout') > 0) && (postRequestParameter('ref_payout') == '0')) {
// Update account's ref_payout for "not-must-confirm"
addSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0");
addSql("UPDATE `{?_MYSQL_PREFIX?}_user_points` SET `points`=`points`+`locked_points` WHERE `locked_points` > 0");
@@ -135,8 +137,8 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
if ((isSqlsValid()) && (isSqlsValid())) {
if (strpos($GLOBALS['sqls'][0], 'INSERT') > -1) {
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE level='%s' LIMIT 1",
- array(bigintval(postRequestElement('level'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `level`='%s' LIMIT 1",
+ array(bigintval(postRequestParameter('level'))), __FILE__, __LINE__);
SQL_FREERESULT($result);
} // END - if
@@ -148,10 +150,10 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
$message = getMessage('SETTINGS_SAVED');
// Destroy config cache file here...
- rebuildCacheFile('config', 'config');
+ rebuildCache('config', 'config');
} else {
// Prepare failed-message
- $message = "{--SETTINGS_NOT_SAVED--}";
+ $message = '{--SETTINGS_NOT_SAVED--}';
}
// Remove SQL queries
@@ -163,7 +165,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
// When do so...
loadTemplate('admin_settings_saved', false, $message);
}
-} elseif (getRequestElement('sub') == 'settings') {
+} elseif (getRequestParameter('sub') == 'settings') {
// Setup some settings like direct pay and so on
// Including new add-mode for one-time referal bonus
foreach (array('allow_direct_pay') as $entry) {
@@ -180,12 +182,12 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
// Load template
loadTemplate('admin_config_point_settings', false, $content);
-} elseif (getRequestElement('sub') == 'ref') {
+} elseif (getRequestParameter('sub') == 'ref') {
// 12 3 32 2 3 32 2 3 4 43 21
- if ((isPostRequestElementSet('del')) && (isPostRequestElementSet('sel')) && (countPostSelection() > 0)) {
+ if ((isPostRequestParameterSet('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
// Delete entries
$OUT = ''; $SW = 2;
- foreach (postRequestElement('sel') as $id => $value) {
+ foreach (postRequestParameter('sel') as $id => $value) {
$result = SQL_QUERY_ESC("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
$content = SQL_FETCHARRAY($result);
@@ -206,10 +208,10 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
// Load main template
loadTemplate('admin_points_del', false, $OUT);
- } elseif ((isPostRequestElementSet('edit')) && (isPostRequestElementSet('sel')) && (countPostSelection() > 0)) {
+ } elseif ((isPostRequestParameterSet('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
// Edit entries
$OUT = ''; $SW = 2;
- foreach (postRequestElement('sel') as $id => $value) {
+ foreach (postRequestParameter('sel') as $id => $value) {
$result = SQL_QUERY_ESC("SELECT `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` WHERE `id`=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
$content = SQL_FETCHARRAY($result);
@@ -220,7 +222,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
'sw' => $SW,
'id' => $id,
'level' => $content['level'],
- 'percents' => translateComma($contentp['percents']),
+ 'percents' => translateComma($content['percents']),
);
// Load row template and switch color
@@ -258,7 +260,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
// Form for adding new referal levels
loadTemplate('admin_add_reflevel');
}
-} elseif (getRequestElement('sub') == 'points') {
+} elseif (getRequestParameter('sub') == 'points') {
// Load template
loadTemplate('admin_config_sub_points');
} else {