// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'admin';
$GLOBALS['output_mode'] = -1;
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'agb';
$GLOBALS['output_mode'] = -1;
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
+// Init start time
$GLOBALS['startTime'] = microtime(true);
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
// Set module
$GLOBALS['module'] = 'beg';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
// Set module
$GLOBALS['module'] = 'birthday_confirm';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'click';
$GLOBALS['output_mode'] = -1;
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module to confirm
$GLOBALS['module'] = 'confirm';
$GLOBALS['output_mode'] = -1;
// Footer is disabled in CSS mode
$GLOBALS['footer_sent'] = '-1';
-// Init variables
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// This is a CSS file loader!
$GLOBALS['output_mode'] = '1';
$GLOBALS['module'] = 'css';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module and fake "CSS mode"
$GLOBALS['module'] = 'debug';
$GLOBALS['output_mode'] = -1;
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
+// Init start time
$GLOBALS['startTime'] = microtime(true);
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
// Set module
$GLOBALS['module'] = 'doubler';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'img';
$GLOBALS['output_mode'] = -1;
// Handle failed logins here if not in guest
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):type={$data['type']},action={$GLOBALS['action']},what={$GLOBALS['what']},lvl={$data['access_level']}<br />\n";
- if ((($data['type'] == "what") || ($data['type'] == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((GET_EXT_VERSION('sql_patches') >= '0.4.7') || (GET_EXT_VERSION('admins') >= '0.7.0'))) {
+ if ((($data['type'] == 'what') || ($data['type'] == 'action') && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview") || ($GLOBALS['what'] == getConfig('index_home')))) && ($data['access_level'] != 'guest') && ((GET_EXT_VERSION('sql_patches') >= '0.4.7') || (GET_EXT_VERSION('admins') >= '0.7.0'))) {
// Handle failure
$content['content'] .= HANDLE_LOGIN_FAILTURES($data['access_level']);
} // END - if
$GLOBALS['last']['module'] = $mod; $GLOBALS['last']['online'] = $onl;
} // END - if
- // "what" not set?
+ // 'what' not set?
if (empty($GLOBALS['what'])) {
// Fix it to default
$GLOBALS['what'] = "welcome";
clearOutputBuffer();
} // END - if
- // Secure the URL against bad things such als HTML insertions and so on...
- $URL = htmlentities(strip_tags($URL), ENT_QUOTES);
-
// Simple probe for bots/spiders from search engines
if ((strpos(detectUserAgent(), 'spider') !== false) || (strpos(detectUserAgent(), 'bot') !== false)) {
+ // Secure the URL against bad things such als HTML insertions and so on...
+ $URL = htmlentities(strip_tags($URL), ENT_QUOTES);
+
// Output new location link as anchor
OUTPUT_HTML('<a href="' . $URL . '"' . $rel . '>' . $URL . '</a>');
} elseif (!headers_sent()) {
// Create a menu selection box for given menu system
function ADMIN_MENU_SELECTION ($mode, $default = '', $defid = '') {
$wht = "`what` != ''";
- if ($mode == "action") $wht = "(`what`='' OR `what` IS NULL) AND action !='login'";
+ if ($mode == 'action') $wht = "(`what`='' OR `what` IS NULL) AND action !='login'";
$result = SQL_QUERY_ESC("SELECT %s, title FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$wht." ORDER BY `sort`",
array($mode), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
$OUT .= "</select>";
define('__BELOW_SELECTION' , $OUT);
- define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION('admin', "what", "name"));
- define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION('admin', "action", "menu"));
+ define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION('admin', 'what', "name"));
+ define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION('admin', 'action', "menu"));
// Display form
LOAD_TEMPLATE("admin_admin_add");
// Do we edit/delete/change main menus or sub menus?
$AND = "(`what` = '' OR `what` IS NULL)"; $SUB = '';
-if (REQUEST_ISSET_GET('sub'))
-{
+if (REQUEST_ISSET_GET('sub')) {
$AND = sprintf("`action`='%s' AND `what` IS NOT NULL", REQUEST_GET('sub'));
$SUB = REQUEST_GET('sub');
-}
+} // END - if
// Get count of (maybe) selected menu points
$chk = 0;
// List all menu points and make them editable
if ((REQUEST_ISSET_POST('edit')) && ($chk > 0) && (!IS_DEMO())) {
// Edit menu entries
+ // @TODO Kill all constants in this file
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
$cnt = 0; $SW = 2;
- foreach (REQUEST_POST('sel') as $sel => $confirm)
- {
- if ($confirm == 1)
- {
+ foreach (REQUEST_POST('sel') as $sel => $confirm) {
+ if ($confirm == 1) {
$cnt++;
$result = SQL_QUERY_ESC("SELECT title, action, what, descr FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1",
array(bigintval($sel)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu, $act, $wht, $descr) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
// Prepare data for the row template
$content = array(
- 'action' => ADMIN_MAKE_MENU_SELECTION('admin', "action", "sel_action[".$sel."]", $act),
- 'what' => ADMIN_MAKE_MENU_SELECTION('admin', "what", "sel_what[".$sel."]", $wht),
+ 'action' => ADMIN_MAKE_MENU_SELECTION('admin', 'action', 'sel_action[' . $sel . ']', $act),
+ 'what' => ADMIN_MAKE_MENU_SELECTION('admin', 'what', 'sel_what[' . $sel . ']', $wht),
'sw' => $SW,
'sel' => $sel,
'menu' => $menu,
'descr' => $descr,
'cnt' => $cnt,
);
- $OUT .= LOAD_TEMPLATE("admin_amenu_edit_row", true, $content);
- }
- else
- {
+ $OUT .= LOAD_TEMPLATE('admin_amenu_edit_row', true, $content);
+ } else {
// Entry not found?
$content = array(
'sw' => $SW,
'sel' => $sel
);
- $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_menu_404_row', true, $content);
}
$SW = 3 - $SW;
- }
- }
+ } // END - if
+ } // END - foreach
+
define('__MENU_ROWS', $OUT);
define('__CNT_VALUE', $cnt);
// Load template
- LOAD_TEMPLATE("admin_amenu_edit_form");
-}
-elseif ((REQUEST_ISSET_POST('del')) && (!IS_DEMO()))
-{
+ LOAD_TEMPLATE('admin_amenu_edit_form');
+} elseif ((REQUEST_ISSET_POST('del')) && (!IS_DEMO())) {
define('__SUB_VALUE', $SUB);
define('__CHK_VALUE', $chk);
// Del menu entries with or without confirmation
$SW = 2; $cnt = 0; $OUT = '';
- foreach (REQUEST_POST('sel') as $sel => $confirm)
- {
- if ($confirm == 1)
- {
+ foreach (REQUEST_POST('sel') as $sel => $confirm) {
+ if ($confirm == 1) {
$cnt++;
$result = SQL_QUERY_ESC("SELECT title FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE ".$AND." AND id=%s LIMIT 1",
array(bigintval($sel)), __FILE__, __LINE__);
- if (SQL_NUMROWS($result) == 1)
- {
+ if (SQL_NUMROWS($result) == 1) {
// Entry found so we load the stuff...
list($menu) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
'sel' => $sel,
'sw' => $SW
);
- $OUT .= LOAD_TEMPLATE("admin_amenu_delete_row", true, $content);
- }
- else
- {
+ $OUT .= LOAD_TEMPLATE('admin_amenu_delete_row', true, $content);
+ } else {
// Entry not found?
$content = array(
'sw' => $SW,
'sel' => $sel
);
- $OUT .= LOAD_TEMPLATE("admin_menu_404_row", true, $content);
+ $OUT .= LOAD_TEMPLATE('admin_menu_404_row', true, $content);
}
$SW = 3 - $SW;
}
define('__CNT_VALUE', $cnt);
// Load template
- LOAD_TEMPLATE("admin_amenu_delete");
+ LOAD_TEMPLATE('admin_amenu_delete');
} elseif ((isFormSent()) && (!IS_DEMO())) {
// An action is done...
- switch (REQUEST_POST('ok'))
- {
+ switch (REQUEST_POST('ok')) {
case 'edit': // Edit menu
foreach (REQUEST_POST('sel') as $sel => $menu) {
// Secure ID
$OUT .= "</select>";
define('__BELOW_SELECTION' , $OUT);
- define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION('guest', "what", "name"));
- define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION('guest', "action", "menu"));
+ define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION('guest', 'what', "name"));
+ define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION('guest', 'action', "menu"));
// Display form
LOAD_TEMPLATE("admin_guest_add");
$DATA = array(
'cnt' => $cnt,
'sel' => $sel,
- 'action' => ADMIN_MAKE_MENU_SELECTION('guest', "action", "sel_action[".$sel."]", $act),
- 'what' => ADMIN_MAKE_MENU_SELECTION('guest', "what", "sel_what[".$sel."]", $wht),
+ 'action' => ADMIN_MAKE_MENU_SELECTION('guest', 'action', 'sel_action[' . $sel . ']', $act),
+ 'what' => ADMIN_MAKE_MENU_SELECTION('guest', 'what', 'sel_what[' . $sel . ']', $wht),
'menu' => $menu,
'sw' => $SW,
);
$OUT .= "</select>";
define('__BELOW_SELECTION' , $OUT);
- define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION('member', "what", "name"));
- define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION('member', "action", "menu"));
+ define('__WHAT_SELECTION' , ADMIN_MAKE_MENU_SELECTION('member', 'what', "name"));
+ define('__ACTION_SELECTION', ADMIN_MAKE_MENU_SELECTION('member', 'action', "menu"));
// Display form
LOAD_TEMPLATE("admin_member_add");
'menu' => $menu,
'sw' => $SW,
'act' => ADMIN_MAKE_MENU_SELECTION('member', "act", "sel_act[".$sel."]", $act),
- 'what' => ADMIN_MAKE_MENU_SELECTION('member', "what", "sel_what[".$sel."]", $wht),
+ 'what' => ADMIN_MAKE_MENU_SELECTION('member', 'what', 'sel_what[' . $sel . ']', $wht),
);
// Load template
$OUT .= LOAD_TEMPLATE("admin_mmenu_edit_row", true, $content);
// "Getter" for module description
function getModuleDescription ($mode, $wht, $column = 'what') {
- // Fix empty "what"
+ // Fix empty 'what'
if (empty($wht)) {
$wht = "welcome";
if (getConfig('index_home') != '') $wht = getConfig('index_home');
// First we have to do some analysis...
if (substr($file, 0, 7) == "action-") {
// This is an action file!
- $type = "action";
+ $type = 'action';
$search = substr($file, 7);
switch ($ACC_LVL) {
case 'admin':
$AND = " AND (`what`='' OR `what` IS NULL)";
} elseif (substr($file, 0, 5) == "what-") {
// This is an admin what file!
- $type = "what";
+ $type = 'what';
$search = substr($file, 5);
$AND = '';
switch ($ACC_LVL) {
$AND .= " AND `action`='".getModeAction($ACC_LVL, $dummy)."'";
} elseif (($ACC_LVL == 'sponsor') || ($ACC_LVL == "engine")) {
// Sponsor / engine menu
- $type = "what";
+ $type = 'what';
$search = $file;
$modCheck = $GLOBALS['module'];
$AND = '';
// Can we close the you-are-here navigation?
//* DEBUG: */ echo __LINE__."*".$type.'/'.$GLOBALS['what']."*<br />\n";
- if (($type == "what") || (($type == "action") && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) {
+ if (($type == 'what') || (($type == 'action') && ((!isset($GLOBALS['what'])) || ($GLOBALS['what'] == "overview")))) {
//* DEBUG: */ echo __LINE__.'+'.$type."+<br />\n";
// Add closing div and br-tag
$OUT .= "</div><br />\n";
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
// Set module
$GLOBALS['module'] = 'index';
// Load security system
require('inc/libs/security_functions.php');
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
+
// Tell every module / include file we are installing
$GLOBALS['mxchange_installing'] = true;
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set CSS variable for "normal mode"
$GLOBALS['output_mode'] = 0;
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// This is a fake-CSS file loader, more a JavaScript loader...
// This is in one way good and in one not. The whole reset part will be
// by-passed even in this "faked" CSS mode. The bad news is that this makes all
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
+// Init start time
$GLOBALS['startTime'] = microtime(true);
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
// Set module
$GLOBALS['module'] = 'lead-confirm';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'login';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
// Tell everyone we are in this module
$GLOBALS['module'] = 'mailid';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
+// Init start time
+$GLOBALS['startTime'] = microtime(true);
// Tell everyone we are in this module
$GLOBALS['module'] = 'mailid';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
+// Init start time
$GLOBALS['startTime'] = microtime(true);
+
+// Init output mode and module
$GLOBALS['output_mode'] = 0;
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
$GLOBALS['module'] = '';
// Needed include files
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'ref';
$GLOBALS['output_mode'] = -1;
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
+// Init start time
$GLOBALS['startTime'] = microtime(true);
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
// Set this because we have no module in URI
$GLOBALS['module'] = 'show_bonus';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'sponsor_confirm';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'sponsor_ref';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
+// Init surfbar cache and start time
$GLOBALS['cache_array']['surfbar'] = array();
$GLOBALS['startTime'] = microtime(true);
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
// Set module
$GLOBALS['module'] = 'surfbar';
// Load security stuff here
require('inc/libs/security_functions.php');
-// Init "action" and "what"
-$GLOBALS['what'] = '';
-$GLOBALS['action'] = '';
-
// Set module
$GLOBALS['module'] = 'view';
$GLOBALS['output_mode'] = -1;