* -------------------------------------------------------------------- *
* 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 *
// Some security stuff...
if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+ $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
require($INC);
}
// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+ADD_DESCR('admin', __FILE__);
// Init variables
-$message = "";
+$message = '';
// Is the 'sub' parameter set?
-if (REQUEST_ISSET_GET(('sub'))) {
+if (REQUEST_ISSET_GET('sub')) {
// Yes, then do some sanity-checks
switch (REQUEST_GET('sub'))
{
break;
case "ref":
- if (REQUEST_ISSET_GET(('do'))) {
- if (((!REQUEST_ISSET_POST(('lvl'))) || (!REQUEST_ISSET_POST(('perc')))) && (REQUEST_GET('do') == "add")) {
+ if (REQUEST_ISSET_GET('do')) {
+ if (((!REQUEST_ISSET_POST(('lvl'))) || (!REQUEST_ISSET_POST(('perc')))) && (REQUEST_GET('do') == 'add')) {
REQUEST_UNSET_POST('ok');
}
}
case "ref":
switch (REQUEST_GET('do'))
{
- case "add":
+ case 'add':
ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".REQUEST_POST('lvl')."','".REQUEST_POST('perc')."')");
break;
}
// Update cache file
- if (GET_EXT_VERSION("cache") >= "0.1.2") {
+ if (GET_EXT_VERSION('cache') >= '0.1.2') {
if ($GLOBALS['cache_instance']->loadCacheFile("refdepths")) $GLOBALS['cache_instance']->destroyCacheFile();
}
break;
// Shall we display a message?
if (!empty($message)) {
// When do so...
- LOAD_TEMPLATE("admin_settings_saved", false, $message);
+ LOAD_TEMPLATE('admin_settings_saved', false, $message);
}
} elseif (REQUEST_GET('sub') == "settings") {
// Setup some settings like direct pay and so on
// Including new add-mode for one-time referal bonus
switch (getConfig('allow_direct_pay')) {
- case "Y":
- define('__DIRECT_Y', " checked=\"checked\"");
- define('__DIRECT_N', "");
+ case 'Y':
+ define('__DIRECT_Y', ' chkecked="checked"');
+ define('__DIRECT_N', '');
break;
- case "N":
- define('__DIRECT_Y', "");
- define('__DIRECT_N', " checked=\"checked\"");
+ case 'N':
+ define('__DIRECT_Y', '');
+ define('__DIRECT_N', ' chkecked="checked"');
break;
}
// One-time referal bonus add-mode
switch (getConfig('reg_points_mode')) {
- case "ref" : define('__MODE_REF', " checked=\"checked\""); define('__MODE_DIRECT', ""); break;
- case "direct": define('__MODE_REF', ""); define('__MODE_DIRECT', " checked=\"checked\""); break;
+ case "ref" : define('__MODE_REF', ' chkecked="checked"'); define('__MODE_DIRECT', ''); break;
+ case "direct": define('__MODE_REF', ''); define('__MODE_DIRECT', ' chkecked="checked"'); break;
}
// Referal payout value
// Load template
LOAD_TEMPLATE("admin_config_point_settings");
} elseif (REQUEST_GET('sub') == "ref") {
- // 12 3 32 2 3 32 23 4 5 54 3 3 4 4321
- 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