* -------------------------------------------------------------------- *
* Kurzbeschreibung : Einstellen der Willkommensgutschrift usw. *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
}
if (IS_FORM_SENT()) {
- $SQLs = array();
+ INIT_SQLS();
switch (REQUEST_GET('sub'))
{
case "points":
- $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_config` SET points_register='".REQUEST_POST('points_register')."', points_ref='".REQUEST_POST('points_ref')."' WHERE config=0 LIMIT 1";
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_config` SET points_register='".REQUEST_POST('points_register')."', points_ref='".REQUEST_POST('points_ref')."' WHERE config=0 LIMIT 1");
break;
case "ref":
switch (REQUEST_GET('do'))
{
case "add":
- $SQLs[] = "INSERT INTO `{!_MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".REQUEST_POST('lvl')."','".REQUEST_POST('perc')."')";
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".REQUEST_POST('lvl')."','".REQUEST_POST('perc')."')");
break;
case "edit": // Change entries
$id = bigintval($id);
// Revert german commata
- REQUEST_POST('perc', $id) = REVERT_COMMA(REQUEST_POST('perc', $id));
+ REQUEST_SET_POST(array('perc', $id), REVERT_COMMA(REQUEST_POST('perc', $id)));
// Update entry
SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_refdepths` SET level='%s', percents='%s' WHERE id=%s LIMIT 1",
array(bigintval($value), REQUEST_POST('perc', $id), $id), __FILE__, __LINE__);
}
- $message = REF_DEPTHS_SAVED;
+ $message = getMessage('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__);
}
- $message = REF_DEPTHS_DELETED;
+ $message = getMessage('REF_DEPTHS_DELETED');
break;
}
case "settings":
$REF = bigintval(REQUEST_POST('ref_payout'));
- $SQLs[] = sprintf("UPDATE `{!_MYSQL_PREFIX!}_config` SET
+ ADD_SQL(sprintf("UPDATE `{!_MYSQL_PREFIX!}_config` SET
allow_direct_pay='%s',
reg_points_mode='%s',
ref_payout='%s'
REQUEST_POST('allow_direct_pay'),
REQUEST_POST('reg_points_mode'),
$REF
- );
+ ));
if ((getConfig('ref_payout') == 0) && (REQUEST_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);
+ ADD_SQL(sprintf("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_payout=(%s - mails_confirmed)
+WHERE mails_confirmed < %s", $REF, $REF));
} elseif ((getConfig('ref_payout') > 0) && (REQUEST_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";
- $SQLs[] = "UPDATE `{!_MYSQL_PREFIX!}_user_points` SET locked_points=0 WHERE locked_points>0";
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET ref_payout=0 WHERE ref_payout > 0");
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET points=points+locked_points WHERE locked_points>0");
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_user_points` SET locked_points=0 WHERE locked_points>0");
}
break;
}
- if ((isset($SQLs)) && (is_array($SQLs)) && (!empty($SQLs[0]))) {
- if (strpos($SQLs[0], "INSERT") > -1) {
+ if ((IS_SQLS_VALID()) && (IS_SQLS_VALID())) {
+ if (strpos($GLOBALS['sqls'][0], "INSERT") > -1) {
$result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level='%s' LIMIT 1",
array(bigintval(REQUEST_POST('lvl'))), __FILE__, __LINE__);
SQL_FREERESULT($result);
} // END - if
- if (count($SQLs) > 0) {
+ if (COUNT_SQLS() > 0) {
// Run all SQL commands
- RUN_FILTER('run_sqls', array('dry_run' => false, 'sqls' => $SQLs));
+ runFilterChain('run_sqls');
// Entry saved...
- $message = SETTINGS_SAVED;
+ $message = getMessage('SETTINGS_SAVED');
// Destroy config cache file here...
- REBUILD_CACHE("config", "config");
+ rebuildCacheFiles("config", "config");
} else {
// Prepare failed-message
$message = "<span class=\"admin_failed\">{--SETTINGS_NOT_SAVED--}</span>";
}
// Remove SQL queries
- unset($SQLs);
+ UNSET_SQLS();
}
// Shall we display a message?
// Load template
LOAD_TEMPLATE("admin_config_point_settings");
} elseif (REQUEST_GET('sub') == "ref") {
- if ((REQUEST_ISSET_POST(('del'))) && (REQUEST_ISSET_POST(('sel'))) && ((SELECTION_COUNT(REQUEST_POST('sel')) > 0) || (REQUEST_ISSET_POST(('sel', 0))))) {
+ // 12 3 32 2 3 32 2 3 4 43 21
+ if ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST('sel')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
// Delete entries
- $SW = 2; $OUT = "";
+ $OUT = ""; $SW = 2;
foreach (REQUEST_POST('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__);
// Load main template
LOAD_TEMPLATE("admin_points_del");
- } elseif ((REQUEST_ISSET_POST(('edit'))) && (REQUEST_ISSET_POST(('sel'))) && ((SELECTION_COUNT(REQUEST_POST('sel')) > 0) || (REQUEST_ISSET_POST(('sel', 0))))) {
+ } elseif ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST('sel')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
// Edit entries
- $SW = 2; $OUT = "";
+ $OUT = ""; $SW = 2;
foreach (REQUEST_POST('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__);
$result = SQL_QUERY("SELECT id, level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Make referal levels editable and deletable
- $SW = 2; $OUT = "";
+ $OUT = ""; $SW = 2;
// List already existing categories for editing
- while (list($id, $lvl, $perc) = SQL_FETCHROW($result)) {
+ while ($content = SQL_FETCHARRAY($result)) {
// Prepare data for the row template
+ // @TODO Rewritings: lvl->level, per->percents in template
$content = array(
'sw' => $SW,
- 'id' => $id,
- 'lvl' => $lvl,
- 'per' => TRANSLATE_COMMA($perc),
+ 'id' => $content['id'],
+ 'lvl' => $content['level'],
+ 'per' => TRANSLATE_COMMA($content['percents']),
);
// Load row template and switch color