// Add description as navigation point
ADD_DESCR("admin", __FILE__);
+// Init variables
+$message = "";
+
+// Is the 'sub' parameter set?
if (!empty($_GET['sub'])) {
+ // Yes, then do some sanity-checks
switch ($_GET['sub'])
{
case "points":
SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_refdepths SET level='%s', percents='%s' WHERE id=%s LIMIT 1",
array(bigintval($value), $_POST['perc'][$id], $id), __FILE__, __LINE__);
}
- $TEXT = REF_DEPTHS_SAVED;
+ $message = REF_DEPTHS_SAVED;
break;
case "del":
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_refdepths WHERE id=%s LIMIT 1",
array(bigintval($id)), __FILE__, __LINE__);
}
- $TEXT = REF_DEPTHS_DELETED;
+ $message = REF_DEPTHS_DELETED;
break;
}
reg_points_mode='%s',
ref_payout='%s'
WHERE config=0 LIMIT 1",
- $_POST['allow_direct_pay'],
- $_POST['reg_points_mode'],
- $REF
+ $_POST['allow_direct_pay'],
+ $_POST['reg_points_mode'],
+ $REF
);
- if ((getConfig('ref_payout') == 0) && ($_POST['ref_payout'] > 0))
- {
+ if ((getConfig('ref_payout') == 0) && ($_POST['ref_payout'] > 0)) {
// Update account's ref_payout for "must-confirm"
$SQLs[] = sprintf("UPDATE `"._MYSQL_PREFIX."_user_data` SET ref_payout=(%s - mails_confirmed)
WHERE mails_confirmed < %s", $REF, $REF);
- }
- elseif ((getConfig('ref_payout') > 0) && ($_POST['ref_payout'] == 0))
- {
+ } elseif ((getConfig('ref_payout') > 0) && ($_POST['ref_payout'] == 0)) {
// Update account's ref_payout for "not-must-confirm"
$SQLs[] = "UPDATE `"._MYSQL_PREFIX."_user_data` SET ref_payout=0 WHERE ref_payout > 0";
$SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_points SET points=points+locked_points WHERE locked_points>0";
}
if ((isset($SQLs)) && (is_array($SQLs)) && (!empty($SQLs[0]))) {
- if (strpos($SQLs[0], "INSERT") > -1)
- {
+ if (strpos($SQLs[0], "INSERT") > -1) {
$result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_refdepths WHERE level='%s' LIMIT 1",
array(bigintval($_POST['lvl'])), __FILE__, __LINE__);
SQL_FREERESULT($result);
- }
+ } // END - if
+
if (count($SQLs) > 0) {
// Run all SQL commands
RUN_FILTER('run_sqls', array('dry_run' => false, 'sqls' => $SQLs));
- $content = "<SPAN class=\"admin_done\">".SETTINGS_SAVED."</SPAN>";
+ // Entry saved...
+ $message = SETTINGS_SAVED;
// Destroy config cache file here...
REBUILD_CACHE("config", "config");
} else {
- $content = "<SPAN class=\"admin_failed\">".SETTINGS_NOT_SAVED."</SPAN>";
+ // Prepare failed-message
+ $message = "<SPAN class=\"admin_failed\">".SETTINGS_NOT_SAVED."</SPAN>";
}
+
+ // Remove SQL queries
unset($SQLs);
- LOAD_TEMPLATE("admin_settings_saved", false, $content);
- } elseif (isset($TEXT)) {
- LOAD_TEMPLATE("admin_settings_saved", false, $TEXT);
+ }
+
+ // Shall we display a message?
+ if (!empty($message)) {
+ // When do so...
+ LOAD_TEMPLATE("admin_settings_saved", false, $message);
}
} elseif ($_GET['sub'] == "settings") {
// Setup some settings like direct pay and so on