templates/de/html/index_forward.tpl -text
templates/de/html/infos.tpl -text
templates/de/html/install/.htaccess -text
+templates/de/html/install/install_fatal_errors.tpl -text
templates/de/html/install/install_fatal_row.tpl -text
templates/de/html/install/install_fatal_table.tpl -text
templates/de/html/install/install_finished.tpl -text
$CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the script installed?
if (isBooleanConstantAndTrue('mxchange_installed')) {
$GLOBALS['module'] = "agb"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the script installed?
if (isBooleanConstantAndTrue('mxchange_installed')) {
$msg = null;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the "beg" extension active?
if (!EXT_IS_ACTIVE("beg")) {
SQL_FREERESULT($result);
// Include header
- require_once(PATH."inc/header.php");
+ LOAD_INC_ONCE("inc/header.php");
// Load final template
LOAD_TEMPLATE("beg_link");
}
// Include footer
- require_once(PATH."inc/footer.php");
+ LOAD_INC_ONCE("inc/footer.php");
} elseif (($status != "CONFIRMED") && ($status != "failed")) {
// Maybe locked/unconfirmed account?
$msg = GEN_ERROR_CODE_FROM_ACCOUNT_STATUS($status);
$GLOBALS['module'] = "birthday_confirm"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the "birthday" extension active?
if (!EXT_IS_ACTIVE("birthday")) {
$GLOBALS['module'] = "birthday_confirm";
// Include header
- require(PATH."inc/header.php");
+ LOAD_INC("inc/header.php");
// Load birthday header template (for your banners, e.g.?)
define('__BIRTHDAY_HEADER', LOAD_TEMPLATE("birthday_header", true));
LOAD_TEMPLATE("birthday_confirm");
// Include footer
- require(PATH."inc/footer.php");
+ LOAD_INC("inc/footer.php");
} else {
// You have to install first!
LOAD_URL("install.php");
$GLOBALS['module'] = "click"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
if (((!empty($_GET['user'])) || (!empty($_GET['reseller']))) && (!empty($_GET['banner']))) {
// Update clicks counter...
$GLOBALS['module'] = "confirm"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the script installed?
if (defined('mxchange_installed') && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered'))) {
header("Content-type: text/css");
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Load header
-require_once(PATH."inc/header.php");
+LOAD_INC_ONCE("inc/header.php");
// Load CSS code
-require_once(PATH."inc/stylesheet.php");
+LOAD_INC_ONCE("inc/stylesheet.php");
// Load footer
-require_once(PATH."inc/footer.php");
+LOAD_INC_ONCE("inc/footer.php");
//
?>
$GLOBALS['module'] = "debug"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Redirect only to registration page when this script is installed
if ((isBooleanConstantAndTrue('mxchange_installed')) && (getTotalFatalErrors() == 0)) {
// Handle the request
if (DEBUG_HANDLE_REQUEST($_POST['request'])) {
// Construct FQFN for the module
- $fqfn = sprintf("%sinc/debug/%s/request_%s",
- PATH,
+ $INC = sprintf("inc/debug/%s/request_%s",
getConfig('debug_mode'),
SQL_ESCAPE($_POST['request'])
);
// Is the module there? Else we log it!
- if (FILE_READABLE($fqfn)) {
+ if (FILE_READABLE($INC)) {
// Load the request module
- require($fqfn);
+ LOAD_INC($INC);
} else {
// Missing request file, may happen while development
DEBUG_ABUSE_LOG(__FILE__, __LINE__, "request_404", $_POST['request']);
$CSS = 0;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the "doubler" extension active?
if (!EXT_IS_ACTIVE("doubler")) {
if (!defined('__ERROR_MSG')) define('__ERROR_MSG' , "");
// Shall I check for points immediately?
- if (getConfig('doubler_send_mode') == "DIRECT") require(PATH."inc/doubler_send.php");
+ if (getConfig('doubler_send_mode') == "DIRECT") LOAD_INC("inc/doubler_send.php");
// Output header
- require(PATH."inc/header.php");
+ LOAD_INC("inc/header.php");
// Banner in text
define('__DOUBLER_BANNER', LOAD_TEMPLATE("doubler_banner", true));
LOAD_TEMPLATE("doubler_index");
// Output footer
- require(PATH."inc/footer.php");
+ LOAD_INC("inc/footer.php");
} else {
// You have to install first!
LOAD_URL("install.php");
$GLOBALS['module'] = "img"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Script installed?
if (isBooleanConstantAndTrue('mxchange_installed')) {
// Load header
- require_once(PATH."inc/header.php");
+ LOAD_INC_ONCE("inc/header.php");
// Code set?
if (!empty($_GET['code'])) {
// Generate image
GENERATE_IMAGE(bigintval($_GET['code']));
} elseif (!empty($_GET['tag'])) {
- // Tag set so create FQFN
- $fqfn = sprintf("%sinc/img/tag-%s.php",
- PATH,
+ // Tag set so create the IFN (Include-FileName)
+ $INC = sprintf("inc/img/tag-%s.php",
SQL_ESCAPE($_GET['tag'])
);
// Include is readable?
- if (FILE_READABLE($fqfn)) {
+ if (FILE_READABLE($INC)) {
// Include it
- require($fqfn);
+ LOAD_INC($INC);
} // END - if
}
// Finish generation here
- require_once(PATH."inc/footer.php");
+ LOAD_INC_ONCE("inc/footer.php");
} else {
// You have to install first!
LOAD_URL("install.php");
define('ENABLE_BACKLINK', true);
// Connect to the MySQL database...
-require_once(PATH."inc/mysql-connect.php");
+LOAD_INC_ONCE("inc/mysql-connect.php");
//
?>
}
// Select MySQL 3 as default database type
-if (_DB_TYPE == "_DB_TYPE") define('_DB_TYPE', "mysql3");
+if (!defined('_DB_TYPE')) define('_DB_TYPE', "mysql3");
// Create include file name
-$FQFN = sprintf("%sinc/db/lib-%s.php", PATH, _DB_TYPE);
+$INC = sprintf("inc/db/lib-%s.php", constant('_DB_TYPE'));
-if (FILE_READABLE($FQFN)) {
+if (FILE_READABLE($INC)) {
// Include abstraction layer
- require_once($FQFN);
+ LOAD_INC_ONCE($INC);
} else {
// Bye, bye...
- die("Cannot load database abstraction layer "._DB_TYPE." -> R.I.P.");
+ die("Cannot load database abstraction layer ".constant('_DB_TYPE')." -> R.I.P.");
}
-// Remove this globally used variable
-unset($FQFN);
-
//
?>
} // END - if
// Construct FQFN for extension file
- $extInclude = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
+ $extInclude = sprintf("inc/extensions/ext-%s.php", $ext_name);
// Is the extension file NOT there?
if (!FILE_READABLE($extInclude)) {
} // END - if
// Construct FQFN for language file
- $langInclude = sprintf("%sinc/language/%s_%s.php", PATH, $ext_name, GET_LANGUAGE());
+ $langInclude = sprintf("inc/language/%s_%s.php", $ext_name, GET_LANGUAGE());
// Is this include there?
if ((FILE_READABLE($langInclude)) && (!isset($EXT_LOADED['lang'][$ext_name]))) {
// Then load it
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Language loaded.");
$EXT_LOADED['lang'][$ext_name] = true;
- require($langInclude);
+ LOAD_INC_ONCE($langInclude);
} // END - if
// Construct FQFN for functions file
- $funcsInclude = sprintf("%sinc/libs/%s_functions.php", PATH, $ext_name);
+ $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
// Is this include there?
if ((FILE_READABLE($funcsInclude)) && (!isset($EXT_LOADED['funcs'][$ext_name]))) {
// Then load it
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Functions loaded.");
$EXT_LOADED['funcs'][$ext_name] = true;
- require($funcsInclude);
+ LOAD_INC_ONCE($funcsInclude);
} // END - if
// Extensions are not deprecated by default
// Include the extension file
//* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Extension loaded.");
- require($extInclude);
+ LOAD_INC($extInclude);
// Is this extension deprecated?
if ($EXT_DEPRECATED == "Y") {
if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) == "")) {
// Template file
$tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
- PATH,
+ constant('PATH'),
GET_LANGUAGE(),
$ext
);
if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1))
{
// Yes, we have. So let's auto-purge some campaigns, inactive users and unconfirmed accounts
- $INC_POOL[] = sprintf("%sinc/autopurge.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/autopurge.php", constant('PATH'));
}
break;
}
// Check for beg rallye is active and send mails out
if ((getConfig('beg_rallye') == "Y") && (getConfig('beg_new_mem_notify') == "Y")) {
// Include file for sending out mails
- $INC_POOL[] = sprintf("%sinc/mails/beg_mails.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/mails/beg_mails.php", constant('PATH'));
} // END - if
break;
}
if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (getConfig('birthday_points') > 0)) {
// Daily reset was run and we shall pay points so we start checking for members who
// has a birthday for today
- $INC_POOL[] = sprintf("%sinc/mails/birthday_mails.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/mails/birthday_mails.php", constant('PATH'));
}
break;
}
// Daily reset was run so let's check if active rallye is activated
if (getConfig('bonus_active') == "Y") {
// Run active rallye
- if (getConfig('bonus_stats') > 0) $INC_POOL[] = sprintf("%sinc/stats_bonus.php", PATH);
- $INC_POOL[] = sprintf("%sinc/monthly/monthly_bonus.php", PATH);
+ if (getConfig('bonus_stats') > 0) $INC_POOL[] = sprintf("%sinc/stats_bonus.php", constant('PATH'));
+ $INC_POOL[] = sprintf("%sinc/monthly/monthly_bonus.php", constant('PATH'));
} else {
// Reset points
- $INC_POOL[] = sprintf("%sinc/reset/reset_bonus.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/reset/reset_bonus.php", constant('PATH'));
}
}
// Check for bonus rallye is active and send mails out
if ((getConfig('bonus_active') == "Y") && (getConfig('bonus_new_mem_notify') == "Y")) {
// Include file for sending out mails
- $INC_POOL[] = sprintf("%sinc/mails/bonus_mails.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/mails/bonus_mails.php", constant('PATH'));
}
break;
}
global $cacheInstance;
// Initialize cache system only when it's needed
- $cacheInstance = new CacheSystem(getConfig('cache_update'), PATH."inc/".getConfig('cache_path'), getConfig('cache_tested'));
+ $cacheInstance = new CacheSystem(getConfig('cache_update'), constant('PATH')."inc/".getConfig('cache_path'), getConfig('cache_tested'));
if ($cacheInstance->getStatus() != "done") {
// Failed to initialize cache sustem
addFatalMessage(__FILE__."(<font color=\"#0000aa\">".__LINE__."</font>): ".CACHE_CANNOT_INITIALIZE);
default: // Do stuff when extension is loaded
if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (getConfig('doubler_send_mode') == "RESET")) {
// So let's check for points
- $INC_POOL[] = sprintf("%sinc/doubler_send.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/doubler_send.php", constant('PATH'));
}
break;
}
if ((isset($dry_run)) && (isset($EXT_LOAD_MODE))) {
if ((!$dry_run) && ($EXT_LOAD_MODE == "update") && ($EXT_VER == "0.0.4")) {
// Add auto-check file
- $INC_POOL[] = sprintf("%sinc/gen_mediadata.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/gen_mediadata.php", constant('PATH'));
} // END - if
} // END - if
if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1)) {
// Daily reset was run so let's check out for expired newsletter orders
- $INC_POOL[] = sprintf("%sinc/monthly/monthly_newsletter.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/monthly/monthly_newsletter.php", constant('PATH'));
}
break;
}
// Do we have a daily-reset-run?
if (isBooleanConstantAndTrue('__DAILY_RESET') && (!DEBUG_MODE) && ($CSS != 1)) {
// So let's check for profiles which needs an update
- $INC_POOL[] = sprintf("%sinc/profile-updte.php", PATH);
+ $INC_POOL[] = sprintf("%sinc/profile-updte.php", constant('PATH'));
}
break;
}
// Shall we include special files?
if ($EXT_LOAD_MODE == "register") {
// Execute this special file on this update
- $INC_POOL[] = PATH."inc/gen_refback.php";
+ $INC_POOL[] = sprintf("%sinc/gen_refback.php",
+ constant('PATH')
+ );
} // END - if
// Keep this extension always active!
global $cacheInstance;
// Maybe need setup of secret key!
- require_once(PATH."inc/gen_sql_patches.php");
+ LOAD_INC_ONCE("inc/gen_sql_patches.php");
// @TODO Rewrite this to a filter!
if ((GET_EXT_VERSION("cache") >= "0.1.2") && (isset($cacheInstance)) && (is_object($cacheInstance))) {
// Remove extensions and mod_reg cache file
- require_once(PATH."inc/libs/cache_functions.php");
- require_once(PATH."inc/extensions/ext-cache.php");
+ LOAD_INC_ONCE("inc/libs/cache_functions.php");
+ LOAD_INC_ONCE("inc/extensions/ext-cache.php");
if ($cacheInstance->loadCacheFile("extensions", true)) $cacheInstance->destroyCacheFile();
if ($cacheInstance->loadCacheFile("mod_reg")) $cacheInstance->destroyCacheFile();
} // END - if
// Test again
if ((getConfig('file_hash') != "") && (getConfig('master_salt') != "") && (getConfig('pass_scramble') != "")) {
// File hash fas generated so we can also file the secret file... hopefully.
- $hashFile = sprintf("%sinc/.secret/.%s", PATH, getConfig('file_hash'));
+ $hashFile = sprintf("%sinc/.secret/.%s", constant('PATH'), getConfig('file_hash'));
if (FILE_READABLE($hashFile)) {
// Read file
$_CONFIG['secret_key'] = READ_FILE($hashFile);
if (count($INC_POOL) > 0) {
// Loads every include file
foreach ($INC_POOL as $FQFN) {
- require_once($FQFN);
+ LOAD_INC_ONCE($FQFN);
} // END - foreach
// Reset array
// Output the generated HTML code or do nothing in direct-mode
if (getTotalFatalErrors() > 0) {
// Output fatal error messages
- require_once(PATH."inc/fatal_errors.php");
+ LOAD_INC_ONCE("inc/fatal_errors.php");
} // END - if
// Shall we display the copyright notice?
// Check if our config file is writeable or not
function IS_INC_WRITEABLE($inc) {
// Generate FQFN
- $fqfn = sprintf("%sinc/%s.php", PATH, $inc);
+ $fqfn = sprintf("%sinc/%s.php", constant('PATH'), $inc);
// Abort by simple test
if ((FILE_READABLE($fqfn)) && (!is_writeable($fqfn))) {
$date_time = MAKE_DATETIME(time(), "1");
// Base directory
- $BASE = sprintf("%stemplates/%s/html/", PATH, GET_LANGUAGE());
+ $BASE = sprintf("%stemplates/%s/html/", constant('PATH'), GET_LANGUAGE());
$MODE = "";
// Check for admin/guest/member templates
// Shall we use PHPMailer class or legacy mode?
if (CHECK_PHPMAILER_USAGE()) {
// Use PHPMailer class with SMTP enabled
- require_once(PATH."inc/phpmailer/class.phpmailer.php");
- require_once(PATH."inc/phpmailer/class.smtp.php");
+ LOAD_INC_ONCE("inc/phpmailer/class.phpmailer.php");
+ LOAD_INC_ONCE("inc/phpmailer/class.smtp.php");
// get new instance
$mail = new PHPMailer();
- $mail->PluginDir = sprintf("%sinc/phpmailer/", PATH);
+ $mail->PluginDir = sprintf("%sinc/phpmailer/", constant('PATH'));
$mail->IsSMTP();
$mail->SMTPAuth = true;
global $cacheArray;
// Set default return value to default language from config
- $ret = DEFAULT_LANG;
+ $ret = constant('DEFAULT_LANG');
// Init variable
$lang = "";
$ret = get_session('mx_lang');
// Fixes a warning before the session has the mx_lang constant
- if (empty($ret)) $ret = DEFAULT_LANG;
+ if (empty($ret)) $ret = constant('DEFAULT_LANG');
}
// Cache entry
$DATA['email'] = $email;
// Base directory
- $BASE = sprintf("%stemplates/%s/emails/", PATH, GET_LANGUAGE());
+ $BASE = sprintf("%stemplates/%s/emails/", constant('PATH'), GET_LANGUAGE());
// Check for admin/guest/member templates
if (strpos($template, "admin_") > -1) {
header ("Location: ".str_replace("&", "&", $URL));
} else {
// Output error message
- require(PATH."inc/header.php");
+ LOAD_INC("inc/header.php");
LOAD_TEMPLATE("redirect_url", false, str_replace("&", "&", $URL));
- require(PATH."inc/footer.php");
+ LOAD_INC("inc/footer.php");
}
exit();
}
}
// Load image
- $img = sprintf("%s/theme/%s/images/code_bg.%s", PATH, GET_CURR_THEME(), getConfig('img_type'));
+ $img = sprintf("%s/theme/%s/images/code_bg.%s", constant('PATH'), GET_CURR_THEME(), getConfig('img_type'));
if (FILE_READABLE($img)) {
// Switch image type
switch (getConfig('img_type'))
// Output error messages in a fasioned way and die...
function mxchange_die ($msg) {
// Load header
- require_once(PATH."inc/header.php");
+ LOAD_INC_ONCE("inc/header.php");
// Load the message template
LOAD_TEMPLATE("admin_settings_saved", false, $msg);
// Load footer
- require(PATH."inc/footer.php");
+ LOAD_INC("inc/footer.php");
// Exit explicitly
exit;
// Include file given?
if (!empty($inc)) {
// Construct FQFN
- $fqfn = sprintf("%sinc/loader/load_cache-%s.php", PATH, $inc);
+ $INC = sprintf("inc/loader/load_cache-%s.php", $inc);
// Is the include there?
- if (FILE_READABLE($fqfn)) {
+ if (FILE_READABLE($INC)) {
// And rebuild it from scratch
//* DEBUG: */ print __FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): inc={$inc} - LOADED!<br />\n";
- require($fqfn);
+ LOAD_INC($INC);
} else {
// Include not found!
DEBUG_LOG(__FUNCTION__, __LINE__, "Include {$inc} not found. cache={$cache}");
} // END - if
} elseif ((!isBooleanConstantAndTrue('mxchange_installed')) && ((isBooleanConstantAndTrue('mxchange_installing')) || ($CSS == true)) && ((!empty($_GET['theme'])) || (!empty($_POST['theme'])))) {
// Prepare FQFN for checking
- $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_GET['theme']));
+ $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), SQL_ESCAPE($_GET['theme']));
// Installation mode active
if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) {
// Set cookie from URL data
set_session('mxchange_theme', SQL_ESCAPE($_GET['theme']));
- } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme'])))) {
+ } elseif (FILE_READABLE(sprintf("%stheme/%s/theme.php", constant('PATH'), SQL_ESCAPE($_POST['theme'])))) {
// Set cookie from posted data
set_session('mxchange_theme', SQL_ESCAPE($_POST['theme']));
}
}
// Add (maybe) found theme.php file to inclusion list
- $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($ret));
+ $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), SQL_ESCAPE($ret));
// Try to load the requested include file
if (FILE_READABLE($theme)) $INC_POOL[] = $theme;
$new = false;
// FQFN of revision file
- $FQFN = sprintf("%sinc/cache/.revision", PATH);
+ $FQFN = sprintf("%sinc/cache/.revision", constant('PATH'));
// Check for revision file
if (!FILE_READABLE($FQFN)) {
return trim($akt_vers[$type]);
}
}
+
+// Loads an include file and logs any missing files for debug purposes
+function LOAD_INC ($INC) {
+ // Get constant path
+ $PATH = constant('PATH');
+
+ // Use the include file name directly
+ // @TODO Try to find all locations where an FQFN is given to these two
+ // @TODO functions and avoid it.
+ $FQFN = $INC;
+
+ // Check if PATH is in $INC
+ if (substr($INC, 0, $PATH) != $PATH) {
+ // Add it. This is why we need a trailing slash in config.php
+ $FQFN = $PATH . $INC;
+ } // END - if
+
+ // Is the include file there?
+ if (!FILE_READABLE($FQFN)) {
+ // Not there so log it
+ DEBUG_LOG(__FUNCTION__, __LINE__, sprintf("Include file %s not found.", basename($INC)));
+ return false;
+ } // END - if
+
+ // Try to load it
+ require($FQFN);
+}
+
+// Loads an include file once
+function LOAD_INC_ONCE ($INC) {
+ global $cacheArray;
+
+ // Is it not loaded?
+ if (!isset($cacheArray['load_once'][$INC])) {
+ // Then try to load it
+ LOAD_INC($INC);
+
+ // And mark it as loaded
+ $cacheArray['load_once'][$INC] = true;
+ } // END - if
+}
+
//////////////////////////////////////////////////
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
//////////////////////////////////////////////////
} // END - if
// Load (maybe) missing file
-require_once(PATH."inc/libs/mediadata_functions.php");
+LOAD_INC_ONCE("inc/libs/mediadata_functions.php");
// Insert info to database
MEDIA_UPDATE_ENTRY(array("total_send" , "normal_send") , "init", $nsent);
}
// Make sure our functions are there
-require_once(PATH."inc/libs/refback_functions.php");
+LOAD_INC_ONCE("inc/libs/refback_functions.php");
// Sanity-check: Do we have ref level 0?
$result = SQL_QUERY("SELECT id FROM `{!_MYSQL_PREFIX!}_refsystem` WHERE level=0", __FILE__, __LINE__);
if (getConfig('file_hash') == "") {
// Create filename from hashed random string
$file_hash = sha1(GEN_PASS(mt_rand(128, 256)));
- $file = PATH."inc/.secret/.".$file_hash;
+ $file = sprintf("%sinc/.secret/.%s",
+ constant('PATH'),
+ $file_hash
+ );
// Count of chars to be taken from back of the string
$nums = mt_rand(40, 45);
array($file_hash), __FILE__, __LINE__);
// Generate FQFN for .htaccess file
- $FQFN = PATH."inc/.secret/.htaccess";
+ $FQFN = sprintf("%sinc/.secret/.htaccess",
+ constant('PATH')
+ );
// Is the .htaccess file there?
if (!FILE_READABLE($FQFN)) {
define('__PAGE_TITLE', html_entity_decode($TITLE));
} elseif ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndTrue('admin_registered'))) {
// Load language file because it was missing in installation finalizer step... *sigh*
- require_once(sprintf("%sinc/language/install_%s.php",
- PATH,
+ $FQFN = sprintf("inc/language/install_%s.php",
GET_LANGUAGE()
- ));
+ );
+ LOAD_INC_ONCE($FQFN);
// Installation mode
define('__PAGE_TITLE', getMessage('INSTALLATION_OF_MXCHANGE'));
LOAD_TEMPLATE("header");
// Include stylesheet
- require_once(PATH."inc/stylesheet.php");
+ LOAD_INC_ONCE("inc/stylesheet.php");
} // END - if
// Closing HEAD tag
define('__SMTP_USER' , $_POST['smtp_user']);
define('__SMTP_PASS' , $_POST['smtp_pass']);
- OUTPUT_HTML("<form action=\"".__BURL_ACTION."/install.php?page=2\" method=\"POST\">
-<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"install_content\">
-<tr>
- <td align=\"center\">
- <div class=\"install\">".HEADER_MYSQL_ERRORS."</strong>
- </td>
-</tr>
-<tr><td colspan=\"2\" height=\"21\" class=\"seperator\"> </td></tr>
-<tr>
- <td><span class=\"install_intro\">
- ".TEXT_MYSQL_ERRORS."
- </span></td>
-</tr>
-<tr>
- <td align=\"center\"><strong>
- <ol>
-".__FATAL_ERROR_LI."
- </ol>
-".__MYSQL_DATA."
- <input type=\"hidden\" name=\"spath\" value=\"".__SPATH_VALUE."\">
- <input type=\"hidden\" name=\"burl\" value=\"".__BURL_VALUE."\">
- <input type=\"hidden\" name=\"title\" value=\"".__TITLE_VALUE."\">
- <input type=\"submit\" class=\"admin_submit\" name=\"ok\" value=\"".RETURN_MYSQL_PAGE."\">
- </strong></td>
-</tr>
-</table>
-</form>");
+ // Load template
+ LOAD_TEMPLATE("install_fatal_errors");
} else {
// Installation is done!
LOAD_URL($burl."/install.php?page=finalize");
} else {
// Something goes wrong during installation! :-(
addFatalMessage(INSTALL_FINALIZER_FAILED);
- include ("inc/fatal_errors.php");
+ LOAD_INC("inc/fatal_errors.php");
}
break;
default:
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Wrong page %s detected.", $_GET['page']));
- OUTPUT_HTML(" <div class=\"install_error\">".WRONG_PAGE."</strong>");
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Wrong page %s detected!}, $_GET['page']));
+ OUTPUT_HTML(" <div class=\"install_error\">{!WRONG_PAGE!}</strong>");
break;
}
} else {
}
// Set default language
-if (empty($mx_lang)) $mx_lang = DEFAULT_LANG;
+if (empty($mx_lang)) $mx_lang = constant('DEFAULT_LANG');
// Generate FQFN
-$FQFN = sprintf("%sinc/language/%s.php", PATH, $mx_lang);
+$FQFN = sprintf("%sinc/language/%s.php", constant('PATH'), $mx_lang);
// Look for file
if (!FILE_READABLE($FQFN)) {
// Switch to default (DO NOT CHANGE!!!)
- set_session('mx_lang', 'de');
+ set_session('mx_lang', constant('DEFAULT_LANG'));
$mx_lang = "de";
- $FQFN = sprintf("%sinc/language/%s.php", PATH, "de");
+ $INC = sprintf("inc/language/%s.php", constant('DEFAULT_LANG'));
} // END - if
// Load language file
-require($FQFN);
-unset($FQFN);
+LOAD_INC($INC);
// Check for installation mode
if (isBooleanConstantAndTrue('mxchange_installing')) {
// Load matching language file
- require(PATH."inc/language/install_".$mx_lang.".php");
+ LOAD_INC("inc/language/install_".$mx_lang.".php");
}
//
$cache_version = null;
// Load cache file
- require_once($this->inc);
+ LOAD_INC_ONCE($this->inc);
// Is there an array?
if (is_array($data)) {
{
// Check templates directory
$OUT = ""; $ral = array();
- $BASE = sprintf("%stemplates/%s/html/rallye/", PATH, GET_LANGUAGE());
+ $BASE = sprintf("%stemplates/%s/html/rallye/", constant('PATH'), GET_LANGUAGE());
$dir = opendir($BASE);
while ($read = readdir($dir))
{
"{CLOSE_ANCHOR2}",
"{SLASH}",
"{DOT}",
- '{QUOT}',
+ "{QUOT}",
"{DOLLAR}",
"{OPEN_ANCHOR}",
"{CLOSE_ANCHOR}",
{
global $_CONFIG;
$OUT = "";
- $FILE = sprintf("%sinc/modules/sponsor/%s.php", PATH, $what);
- if (FILE_READABLE($FILE)) {
+ $INC = sprintf("inc/modules/sponsor/%s.php", $what);
+ if (FILE_READABLE($INC)) {
// Every sponsor action will output nothing directly. It will be written into $OUT!
- require_once($FILE);
+ LOAD_INC_ONCE($INC);
} else {
// File not found!
$OUT .= LOAD_TEMPLATE("admin_settings_saved", true, SPONSOR_CONTENT_404_1.$what.SPONSOR_CONTENT_404_2);
// Load all themes
while (list($theme) = SQL_FETCHROW($result)) {
// Load it's theme.php file
- $INC = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($theme));
+ $INC = sprintf("theme/%s/theme.php", SQL_ESCAPE($theme));
if (FILE_READABLE($INC)) {
// And save all data in array
- require($INC);
+ LOAD_INC($INC);
$THEMES['theme_unix'][] = $theme;
$THEMES['theme_name'][] = $THEME_NAME;
} // END - if
set_session('mxchange_theme', $newTheme);
// Remove current from array and set new
- $theme = sprintf("%stheme/%s/theme.php", PATH, $currTheme);
+ $theme = sprintf("%stheme/%s/theme.php", constant('PATH'), $currTheme);
unset($INC_POOL[array_search($theme, $INC_POOL)]);
- $INC_POOL[] = sprintf("%stheme/%s/theme.php", PATH, $newTheme);
+ $INC_POOL[] = sprintf("%stheme/%s/theme.php", constant('PATH'), $newTheme);
} // END - if
//
$cacheInstance->destroyCacheFile();
// Retry it
- require(__FILE__);
+ LOAD_INC(__FILE__);
return;
} // END - if
INIT_FILTER_SYSTEM();
// Load more cache files (like admins)
- require_once(PATH."inc/load_cache.php");
+ LOAD_INC_ONCE("inc/load_cache.php");
// Remove array
unset($EXT_POOL);
// At least one found?
if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1") && ($CSS != "-1")) || ($cacheMode == "no"))) {
// Load session management
- require_once(PATH."inc/session.php");
+ LOAD_INC_ONCE("inc/session.php");
// Extensions are registered so we load them
while ($content = SQL_FETCHARRAY($res_ext_crt)) {
} // END - if
// Load extensions
- $file1 = sprintf("%sinc/extensions/ext-%s.php", PATH, $content['ext_name']);
+ $file1 = sprintf("%sinc/extensions/ext-%s.php", constant('PATH'), $content['ext_name']);
// Does the extension file exists?
if (FILE_READABLE($file1)) {
// CSS file handling:
if ((!isset($content['ext_css'])) || ($content['ext_css'] == "Y")) {
// Create FQFN for the CSS file
- $CSS_FILE = sprintf("%stheme/%s/css/%s.css", PATH, GET_CURR_THEME(), $content['ext_name']);
+ $CSS_FILE = sprintf("%stheme/%s/css/%s.css", constant('PATH'), GET_CURR_THEME(), $content['ext_name']);
// Is the file there?
if (FILE_READABLE($CSS_FILE)) {
$cacheInstance->finalize();
// Load more cache files (like admins)
- require_once(PATH."inc/load_cache.php");
+ LOAD_INC_ONCE("inc/load_cache.php");
} // END - if
// Free memory
$cacheInstance->finalize();
// Reload the cache
- require(__FILE__);
+ LOAD_INC(__FILE__);
}
// Next cached table are the admins_acls...
$cacheInstance->finalize();
// Reload the cache
- require(__FILE__);
+ LOAD_INC(__FILE__);
}
} // END - if
$cacheInstance->finalize();
// Reload the cache
- require(__FILE__);
+ LOAD_INC(__FILE__);
}
//
$cacheInstance->finalize();
// Reload the cache
- require(__FILE__);
+ LOAD_INC(__FILE__);
}
//
$cacheInstance->finalize();
// Reload the cache
- require(__FILE__);
+ LOAD_INC(__FILE__);
}
//
$cacheInstance->finalize();
// Reload the cache
- require(__FILE__);
+ LOAD_INC(__FILE__);
}
//
$cacheInstance->finalize();
// Reload the cache
- require(__FILE__);
+ LOAD_INC(__FILE__);
}
//
} // END - if
// Load include file
-require_once(PATH."inc/modules/admin/admin-inc.php");
+LOAD_INC_ONCE("inc/modules/admin/admin-inc.php");
// Fix "deleted" cookies in PHP4 (PHP5 does remove them, PHP4 sets them to deleted!)
FIX_DELETED_COOKIES(array('admin_login', 'admin_md5', 'admin_last', 'admin_to'));
if (!empty($_GET['area'])) $area = SQL_ESCAPE($_GET['area']);
// Load "logical-area menu-system" file
- require_once(PATH."inc/modules/admin/lasys-inc.php");
+ LOAD_INC_ONCE("inc/modules/admin/lasys-inc.php");
// Create new-style menu system will "logical areas"
ADMIN_LOGICAL_AREA_SYSTEM($area, $act, $GLOBALS['what']);
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
// "what file" not found
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
ADD_DESCR("admin", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/admin/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} else {
addFatalMessage(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
}
if (SQL_NUMROWS($result_action) == 1) {
// Is valid but does the inlcude file exists?
- $INC = sprintf("%sinc/modules/admin/action-%s.php", PATH, $act);
+ $INC = sprintf("inc/modules/admin/action-%s.php", $act);
if ((FILE_READABLE($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && (__ACL_ALLOW == true)) {
// Ok, we finally load the admin action module
- require($INC);
+ LOAD_INC($INC);
} elseif (__ACL_ALLOW == false) {
// Access denied
LOAD_TEMPLATE("admin_menu_failed", false, getMessage('ADMIN_ACCESS_DENIED'));
<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_menu_sub\">\n";
while (list($wht_sub, $title_what, $desc_what) = SQL_FETCHROW($result_what)) {
// Filename
- $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $wht_sub);
+ $INC = sprintf("%sinc/modules/admin/what-%s.php", constant('PATH'), $wht_sub);
if ((EXT_IS_ACTIVE("admins")) && (GET_EXT_VERSION("admins") > "0.2")) {
$ACL = ADMINS_CHECK_ACL("", $wht_sub);
} else {
// Generate a selection box
function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
// Open the requested menu directory
- $handle = opendir(sprintf("%sinc/modules/%s/", PATH, $menu)) or mxchange_die("Cannot load menu ".$menu."!");
+ $handle = opendir(sprintf("%sinc/modules/%s/", constant('PATH'), $menu)) or mxchange_die("Cannot load menu ".$menu."!");
// Init the selection box
$OUT = "<select name=\"".$name."\" class=\"admin_select\" size=\"1\">\n <option value=\"\">".IS_TOP_MENU."</option>\n";
// Is this a PHP script?
if (($file != ".") && ($file != "..") && ($file != "lost+found") && (strpos($file, "".$type."-") > -1) && (strpos($file, ".php") > 0)) {
// Then test if the file is readable
- $test = sprintf("%sinc/modules/%s/%s", PATH, $menu, $file);
+ $test = sprintf("%sinc/modules/%s/%s", constant('PATH'), $menu, $file);
// Is the file there?
if (FILE_READABLE($test)) {
} // END - if
} else {
// Test-drive extension in update mode
- require(sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name));
+ LOAD_INC(sprintf("inc/extensions/ext-%s.php", $ext_name));
// Update extension if extension is installed and outdated
//* DEBUG: */ print "ext={$ext_name},ver={$EXT_VERSION}/".GET_EXT_VERSION($ext_name)."<br />\n";
// If salt length is empty or null then we shall generate new passwords
if (empty($_POST['salt_length']) || ($_POST['salt_length'] == "0")) {
// Generate new passwords for all!
- require(PATH."/inc/gen_sql_patches.php");
+ LOAD_INC("inc/gen_sql_patches.php");
// Forget the wrong number!
unset($_POST['salt_length']);
// Output message
LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
} // END - if
- } elseif (FILE_READABLE(sprintf("%stemplates/%s/html/admin/%s.tpl", PATH, GET_LANGUAGE(), $TPL))) {
+ } elseif (FILE_READABLE(sprintf("%stemplates/%s/html/admin/%s.tpl", constant('PATH'), GET_LANGUAGE(), $TPL))) {
// Create mailto link
define('__SPONSOR_VALUE', "<a href=\"mailto:{!__EMAIL!}\">{!__SURNAME!} {!__FAMILY!}</a>");
if (isset($_POST['task'])) $SEL = SELECTION_COUNT($_POST['task']);
if ((isset($_POST['assign'])) && ($SEL > 0)) {
// Assign / do tasks
- require_once(PATH."inc/modules/admin/overview-inc.php");
+ LOAD_INC_ONCE("inc/modules/admin/overview-inc.php");
if (empty($dmy)) $dmy = "";
OUTPUT_SELECTED_TASKS($_POST, $dmy);
} else {
} elseif (isset($_POST['del'])) {
// Delete the account
$ACT = true;
- require_once(PATH."inc/modules/admin/what-del_user.php");
+ LOAD_INC_ONCE("inc/modules/admin/what-del_user.php");
} elseif (!empty($_POST['no'])) {
// Do not lock him...
$URL = "modules.php?module=admin&what=list_user&u_id=".bigintval($_GET['u_id']);
if (!empty($_GET['access'])) {
// Secure input and construct FQFN
$access = SQL_ESCAPE(strip_tags($_GET['access']));
- $target = sprintf("%slogs/%s", PATH, $access);
+ $target = sprintf("%slogs/%s", constant('PATH'), $access);
// Is the file valid and readable?
if (FILE_READABLE($target)) {
// In Opera browsers the menu is being displayed double: ADD_DESCR("admin", __FILE__);
// Otherwise load include file 'overview-inc' (old standard overview page)
-require_once(PATH."inc/modules/admin/overview-inc.php");
+LOAD_INC_ONCE("inc/modules/admin/overview-inc.php");
$JOBS_DONE = true;
$taskExt = false; // Default is that "task" is not installed
// Leave loop when data is invalid or EOF?
if ((substr($value, 0, 6) == "theme-") && (substr($value, -4) == ".zip")) {
$name = substr($value, 6, -4);
- $file = sprintf("%sthemes/%s/theme.php", PATH, $name);
+ $file = sprintf("%sthemes/%s/theme.php", constant('PATH'), $name);
$ver = trim(substr($response[$idx + 3], 4));
// Load version
$result = SQL_QUERY("SELECT id, theme_path, theme_active, theme_ver, theme_name FROM `{!_MYSQL_PREFIX!}_themes` ORDER BY theme_path", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
while (list($id, $unix, $active, $ver, $name) = SQL_FETCHROW($result)) {
+ // Construct IFN
+ $INC = sprintf("theme/%s/theme.php",
+ $unix
+ );
+
// Load theme in test mode
- require(PATH."theme/".$unix."/theme.php");
+ LOAD_INC($INC);
// Is the loaded theme name != current theme name?
$LINK = $unix;
// Check if theme is there
if (!THEME_CHECK_EXIST($_POST['theme'])) {
// Import theme
- $file = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme']));
- if (FILE_READABLE($file)) {
+ $INC = sprintf("theme/%s/theme.php", SQL_ESCAPE($_POST['theme']));
+ if (FILE_READABLE($INC)) {
// Load the theme header file
- require($file);
+ LOAD_INC($INC);
// Register it ith the exchange
SQL_QUERY_ESC("INSERT INTO `{!_MYSQL_PREFIX!}_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`)
$handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
while ($dir = readdir($handle)) {
// Construct absolute theme.php file name
- $theme = sprintf("%stheme/%s/theme.php", PATH, $dir);
+ $INC = sprintf("theme/%s/theme.php", $dir);
// Test it...
- if (($dir != ".") && ($dir != "..") && (FILE_READABLE($theme))) {
+ if (($dir != ".") && ($dir != "..") && (FILE_READABLE($INC))) {
// Found a valid directory so let's load it's theme.php file
- require($theme);
+ LOAD_INC($INC);
// Add found theme to array
$THEMES['theme_unix'][] = $dir;
if (!empty($_GET['image'])) {
if ($_GET['type'] == "usage") {
- $file = sprintf("%s%s/usage.png", PATH, getConfig('usage_base'));
+ $FQFN = sprintf("%s%s/usage.png",
+ constant('PATH'),
+ getConfig('usage_base')
+ );
} else {
if (strpos($_GET['image'], "\\") > 0) $_GET['image'] = substr($_GET['image'], 0, strpos($_GET['image'], "\\"));
- $file = sprintf("%s%s/%s_usage_%s.png",
- PATH,
+ $FQFN = sprintf("%s%s/%s_usage_%s.png",
+ constant('PATH'),
getConfig('usage_base'),
SQL_ESCAPE($_GET['type']),
SQL_ESCAPE($_GET['image'])
);
}
- if (FILE_READABLE($file)) {
- $image = imagecreatefrompng($file);
+ if (FILE_READABLE($FQFN)) {
+ $image = imagecreatefrompng($FQFN);
header("Content-type: image/png");
imagepng($image);
imagedestroy($image);
}
exit();
} elseif (empty($_GET['usage'])) {
- $file = sprintf("%s%s/index.html", PATH, getConfig('usage_base'));
+ $FQFN = sprintf("%s%s/index.html",
+ constant('PATH'),
+ getConfig('usage_base')
+ );
} else {
- $file = sprintf("%s%s/usage_%s.html",
- PATH,
+ $FQFN = sprintf("%s%s/usage_%s.html",
+ constant('PATH'),
getConfig('usage_base'),
SQL_ESCAPE($_GET['usage'])
);
}
-if ((!empty($file)) && (FILE_READABLE($file) {
+if ((!empty($FQFN)) && (FILE_READABLE($FQFN) {
// @TODO This code is double, see LOAD_TEMPLATE and LOAD_EMAIL_TEMPLATE in functions.php
- $tmpl_file = READ_FILE($file);
+ $tmpl_file = READ_FILE($FQFN);
$tmpl_file = addslashes($tmpl_file);
$tmpl_file = "\$content=\"".$tmpl_file."\";";
eval($tmpl_file);
ADD_DESCR("guest", __FILE__);
// Load the include file
-$INC = sprintf(PATH."inc/modules/guest/what-%s.php", $GLOBALS['what']);
+$INC = sprintf("inc/modules/guest/what-%s.php", $GLOBALS['what']);
if (FILE_READABLE($INC)) {
// Ok, we finally load the guest action module
- require($INC);
+ LOAD_INC($INC);
} elseif ($IS_VALID) {
addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
} else {
}
// Only when one admin link is clicked...
-$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the guest action module
- require($INC);
+ LOAD_INC($INC);
} elseif ($IS_VALID) {
addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
} else {
ADD_DESCR("guest", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
$IS_VALID = WHAT_IS_VALID($GLOBALS['action'], $GLOBALS['what'], "guest");
if ((FILE_READABLE($INC)) && ($IS_VALID)) {
// Ok, we finally load the guest action module
- require_once($INC);
+ LOAD_INC($INC);
} elseif ($IS_VALID) {
addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
} else {
ADD_DESCR("guest", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the guest action module
- require($INC);
+ LOAD_INC($INC);
} elseif ($IS_VALID) {
addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
} else {
ADD_DESCR("guest", __FILE__);
// Load the include file
-$INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
+$INC = sprintf("inc/modules/guest/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
if (FILE_READABLE($INC)) {
// Ok, we finally load the guest action module
- require($INC);
+ LOAD_INC($INC);
} elseif ($IS_VALID) {
addFatalMessage(sprintf(getMessage('GUEST_404_ACTION'), SQL_ESCAPE($GLOBALS['what'])));
} else {
// URL was constructed
if (getTotalFatalErrors()) {
// Fatal errors!
- require_once(PATH."inc/fatal_errors.php");
+ LOAD_INC_ONCE("inc/fatal_errors.php");
} else {
// Load URL
LOAD_URL($URL);
}
// Special file
-require_once(PATH."inc/rdf.class.php");
+LOAD_INC_ONCE("inc/rdf.class.php");
// Add description as navigation point
ADD_DESCR("guest", __FILE__);
$BLOCK_MODE = false;
// Construct FQFN
-$INC_ACTION = sprintf("%sinc/modules/guest/action-%s.php", PATH, $GLOBALS['action']);
+$INC = sprintf("inc/modules/guest/action-%s.php", $GLOBALS['action']);
// Is the file there?
-if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("guest", $GLOBALS['action'], $GLOBALS['what']))) {
+if ((FILE_READABLE($INC)) && (VALIDATE_MENU_ACTION("guest", $GLOBALS['action'], $GLOBALS['what']))) {
// Requested module is available so we load it
- require_once($INC_ACTION);
+ LOAD_INC_ONCE($INC);
} else {
// Invalid module specified or not found...
LOAD_URL("modules.php?module=index");
OUTPUT_HTML(" </td>
<td valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");
-$INC_ACTION = sprintf("%sinc/modules/member/action-%s.php", PATH, $act);
+$INC_ACTION = sprintf("inc/modules/member/action-%s.php", $act);
if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what']))) {
// Requested module is available so we load it
- include ($INC_ACTION);
+ LOAD_INC($INC_ACTION);
} else {
// Invalid module specified or not found...
LOAD_URL("modules.php?module=login");
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
ADD_DESCR("member", __FILE__);
// Load the include file
-$INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, SQL_ESCAPE($GLOBALS['what']));
-if (FILE_READABLE($INC_WHAT)) {
+$INC = sprintf("inc/modules/member/what-%s.php", SQL_ESCAPE($GLOBALS['what']));
+if (FILE_READABLE($INC)) {
// Ok, we finally load the member action module
- require($INC_WHAT);
+ LOAD_INC($INC);
} else {
addFatalMessage(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
}
// List available ref banners
$SW = 2; $OUT = "";
while (list($id, $url, $alt, $count, $clks) = SQL_FETCHROW($result)) {
- $test = str_replace(URL, PATH, $url); $size = 0;
+ $test = str_replace(URL, constant('PATH'), $url); $size = 0;
if ($test == $url) {
// Download banner (I hope you keep the banner on same server???)
$fp = GET_URL($url); $file = "";
$handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
while ($entry = readdir($handle)) {
// Construct absolute theme.php file name
- $theme = sprintf("%stheme/%s/theme.php", PATH, $entry);
+ $INC = sprintf("theme/%s/theme.php", $entry);
- if (($entry != ".") && ($entry != "..") && (FILE_READABLE($theme)) && (THEME_IS_ACTIVE($entry))) {
+ if (($entry != ".") && ($entry != "..") && (FILE_READABLE($INC)) && (THEME_IS_ACTIVE($entry))) {
// Found a valid directory so let's load it's theme.php file
- require($theme);
+ LOAD_INC($INC);
// Add found theme to array
$THEMES['theme_unix'][] = $entry;
define('DEBUG_SQL', false);
// Non-database functions
-require_once(PATH."inc/functions.php");
+LOAD_INC_ONCE("inc/functions.php");
// Filter functions
-require_once(PATH."inc/filters.php");
+LOAD_INC_ONCE("inc/filters.php");
// Functions which interact with the database
-require_once(PATH."inc/mysql-manager.php");
+LOAD_INC_ONCE("inc/mysql-manager.php");
// Load extensions and language
-require_once(PATH."inc/extensions.php");
+LOAD_INC_ONCE("inc/extensions.php");
// Load database library
-require_once(PATH."inc/db/lib.php");
+LOAD_INC_ONCE("inc/db/lib.php");
// Error handler function
function __errorHandler ($errno, $errstr, $errfile, $errline) {
$_CONFIG = merge_array($_CONFIG, LOAD_CONFIG());
// Load "databases" aka static arrays
- require_once(PATH."inc/databases.php");
+ LOAD_INC_ONCE("inc/databases.php");
// Loading patching system is required here...
- require_once(PATH."inc/patch-system.php"); // Initialize patch system
+ LOAD_INC_ONCE("inc/patch-system.php"); // Initialize patch system
// Session management
- require_once(PATH."inc/session.php");
+ LOAD_INC_ONCE("inc/session.php");
// Run daily reset
- require_once(PATH."inc/check-reset.php");
+ LOAD_INC_ONCE("inc/check-reset.php");
// Load admin include file if he is admin
if (IS_ADMIN()) {
// Administrative functions
- require_once(PATH."inc/modules/admin/admin-inc.php");
+ LOAD_INC_ONCE("inc/modules/admin/admin-inc.php");
} // END - if
//* DEBUG: */ ADD_POINTS_REFSYSTEM("test", 36, 1000);
//* DEBUG: */ die();
} // END - if
// Update sending pool
- if (($CSS != "1") && ($CSS != "-1")) require_once(PATH."inc/pool-update.php"); // Sends out mails in configureable steps
+ if (($CSS != "1") && ($CSS != "-1")) LOAD_INC_ONCE("inc/pool-update.php"); // Sends out mails in configureable steps
// Load all active extension including language files when not upgrading.
// Check module for testing and count one click
}
} else {
// Add language system
- require_once(PATH."inc/language.php");
+ LOAD_INC_ONCE("inc/language.php");
// Wrong database?
addFatalMessage(getMessage('WRONG_DB_SELECTED'));
}
} else {
// Add language system
- require_once(PATH."inc/language.php");
+ LOAD_INC_ONCE("inc/language.php");
// No link to database!
addFatalMessage(getMessage('NO_DB_LINK'));
}
} else {
// Add language system
- require_once(PATH."inc/language.php");
+ LOAD_INC_ONCE("inc/language.php");
// Maybe you forgot to enter your MySQL data?
addFatalMessage(getMessage('MYSQL_DATA_MISSING'));
$link = false; // No database link by default
// Include required files
- require_once(PATH."inc/databases.php");
- require_once(PATH."inc/session.php");
+ LOAD_INC_ONCE("inc/databases.php");
+ LOAD_INC_ONCE("inc/session.php");
// Check if we are in installation routine
if ((basename($_SERVER['PHP_SELF']) != "install.php") && ($CSS != "1") && ($CSS != -1)) {
if ((getTotalFatalErrors() > 0) && (isBooleanConstantAndTrue('mxchange_installed')) && (!defined('mxchange_installing')) && ($CSS != "1")) {
// One or more fatal error(s) occur during connect...
- require_once(PATH."inc/header.php");
- require_once(PATH."inc/fatal_errors.php");
- require_once(PATH."inc/footer.php");
+ LOAD_INC_ONCE("inc/header.php");
+ LOAD_INC_ONCE("inc/fatal_errors.php");
+ LOAD_INC_ONCE("inc/footer.php");
} // END - if
//
// Still no luck or not found?
if (($ret == "cache_miss") || (!$found)) {
// ----- Legacy module ----- ---- Module in base folder ---- --- Module with extension's name ---
- if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s.php", PATH, $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", PATH, $extension, $mod)))) {
+ if ((FILE_READABLE(sprintf("%sinc/modules/%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s.php", constant('PATH'), $mod))) || (FILE_READABLE(sprintf("%s%s/%s.php", constant('PATH'), $extension, $mod)))) {
// Data is missing so we add it
if (GET_EXT_VERSION("sql_patches") >= "0.3.6") {
// Since 0.3.6 we have a has_menu column, this took me a half hour
// Full file name for checking menu
//* DEBUG: */ echo __LINE__.":!!!!".$sub_what."!!!<br />\n";
- $test_inc = sprintf("%sinc/modules/%s/what-%s.php", PATH, $MODE, $sub_what);
- $test = (FILE_READABLE($test_inc));
- if ($test) {
+ $FQFN = sprintf("%sinc/modules/%s/what-%s.php", constant('PATH'), $MODE, $sub_what);
+ if (FILE_READABLE($FQFN)) {
if ((!empty($wht)) && (($wht == $sub_what))) {
$content = "<strong>";
}
// Menu title
$content .= getConfig('menu_blur_spacer') . $sub_title;
- if ($test) {
+ if (FILE_READABLE($FQFN)) {
$content .= "</a>";
} else {
$content .= "</em>";
} else {
// This is a menu block... ;-)
$BLOCK_MODE = true;
- $INC_BLOCK = sprintf("%sinc/modules/%s/action-%s.php", PATH, $MODE, $main_action);
+ $INC_BLOCK = sprintf("inc/modules/%s/action-%s.php", $MODE, $main_action);
if (FILE_READABLE($INC_BLOCK)) {
// Load include file
if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML("<tr>
<td class=\"".$MODE."_menu_whats\">");
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
- include ($INC_BLOCK);
+ LOAD_INC($INC_BLOCK);
//* DEBUG: */ echo __LINE__."/".$main_cnt."/".$main_action."/".$sub_what.":".$GLOBALS['what']."*<br />\n";
if ((!EXT_IS_ACTIVE($main_action)) || ($main_action == "online")) OUTPUT_HTML(" </td>
</tr>");
$PHPSESSID = @session_id();
// Load language system
-require_once(PATH."inc/language.php");
+LOAD_INC_ONCE("inc/language.php");
// Load extensions here
-require_once(PATH."inc/load_extensions.php");
+LOAD_INC_ONCE("inc/load_extensions.php");
// Determine and set referal id
DETERMINE_REFID();
// Output inclusion lines
foreach ($STYLES as $value) {
// Only include found CSS files (to reduce 404 requests)
- $BASE = sprintf("%stheme/%s/css/", PATH, GET_CURR_THEME());
+ $BASE = sprintf("%stheme/%s/css/", constant('PATH'), GET_CURR_THEME());
$file = $BASE.$value;
// Do include only existing files and whose are not empty
$GLOBALS['module'] = "index";
// Load config.php
-require("inc/config.php");
+require_once("inc/config.php");
// Is the script installed?
if (isBooleanConstantAndTrue('mxchange_installed')) {
// Header
- require(PATH."inc/header.php");
+ LOAD_INC("inc/header.php");
// Fix missing array elements here
if (getConfig('index_delay') == null) $_CONFIG['index_delay'] = 0;
}
// Footer
- require(PATH."inc/footer.php");
+ LOAD_INC("inc/footer.php");
} else {
// You have to install first!
LOAD_URL("install.php");
define('mxchange_installing', true);
// Load security system
-require("inc/libs/security_functions.php");
+require_once("inc/libs/security_functions.php");
// Init "action" and "what"
global $what, $action;
$GLOBALS['module'] = "install";
// Load config file
-require("inc/config.php");
+require_once("inc/config.php");
// Header
-require(PATH."inc/header.php");
+LOAD_INC("inc/header.php");
// Reload page to page=welcome when it is not specified
if (!isset($_GET['page'])) {
LOAD_TEMPLATE("install_header");
// Here start's our installtion stuff
- require_once(PATH."inc/install-inc.php");
+ LOAD_INC_ONCE("inc/install-inc.php");
// Close main installation table
LOAD_TEMPLATE("install_footer");
}
// Footer
-require(PATH."inc/footer.php");
+LOAD_INC("inc/footer.php");
//
?>
$CSS = "1"; $GLOBALS['module'] = "js";
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is this script installed and a JavaScript tag is provied?
if ((isBooleanConstantAndTrue('mxchange_installed')) && (isset($_GET['tag']))) {
@header("Content-type: text/javascript");
// Load header
- require_once(PATH."inc/header.php");
+ LOAD_INC_ONCE("inc/header.php");
// Prepare include file for looking
- $fqfn = sprintf("%sinc/js/tag-%s.php",
- PATH,
+ $INC = sprintf("inc/js/tag-%s.php",
SQL_ESCAPE($_GET['tag'])
);
// Is that file readable?
- if (FILE_READABLE($fqfn)) {
+ if (FILE_READABLE($INC)) {
// Include it
- require_once($fqfn);
+ LOAD_INC_ONCE($INC);
} // END - if
// Load footer
- require_once(PATH."inc/footer.php");
+ LOAD_INC_ONCE("inc/footer.php");
} // END - if
//
$GLOBALS['module'] = "lead-confirm";
// Load config.php
-require("inc/config.php");
+require_once("inc/config.php");
// Is the script installed?
if (isBooleanConstantAndTrue('mxchange_installed')) {
// Header
- require(PATH."inc/header.php");
+ LOAD_INC("inc/header.php");
// Initialize the array for the template
$content = array(
LOAD_TEMPLATE("lead_code", false, $content);
// Footer
- require(PATH."inc/footer.php");
+ LOAD_INC("inc/footer.php");
} else {
// You have to install first!
LOAD_URL("install.php");
$GLOBALS['module'] = "login";
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the script installed?
if (isBooleanConstantAndTrue('mxchange_installed')) {
$GLOBALS['module'] = "mailid"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
if (isBooleanConstantAndTrue('mxchange_installed')) {
// Is the extension active
}
// Add header
- require_once(PATH."inc/header.php");
+ LOAD_INC_ONCE("inc/header.php");
// Was that mail a valid one?
if ($VALID) {
}
} else {
// Include footer
- require_once(PATH."inc/footer.php");
+ LOAD_INC_ONCE("inc/footer.php");
}
} else {
// You have to install first!
$GLOBALS['module'] = "mailid"; $CSS = 0;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
if (isBooleanConstantAndTrue('mxchange_installed')) {
// Is the extension active
// 01 1 12 2 2 21 1 22 10
if (($url_uid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (getTotalFatalErrors() == 0)) {
// No image? Then output header
- if ($mode != "img") require_once(PATH."inc/header.php");
+ if ($mode != "img") LOAD_INC_ONCE("inc/header.php");
// Maybe he wants to confirm an email?
if ($url_mid > 0) {
// Insert footer if no image
if ($mode != "img") {
// Write footer
- require_once(PATH."inc/footer.php");
+ LOAD_INC_ONCE("inc/footer.php");
} // END - if
}
} elseif ($mode != "img") {
$GLOBALS['module'] = secureString($_GET['module']);
// Needed include files
-require("inc/config.php");
+require_once("inc/config.php");
// Check if logged in
if (IS_MEMBER()) {
}
// The header file
-require_once(PATH."inc/header.php");
+LOAD_INC_ONCE("inc/header.php");
// Modules are by default not valid!
$MOD_VALID = false; $check = "failed";
// Maintain mode is active and you are no admin
addFatalMessage(getMessage('LANG_DOWN_MAINTAINCE'));
} elseif (($link) && ($db) && (getTotalFatalErrors() == 0)) {
+ // Construct module name
+ define('__MODULE', sprintf("inc/modules/%s.php", SQL_ESCAPE($GLOBALS['module'])));
+
// Did we found the module listed in allowed modules and are we successfully connected?
$check = CHECK_MODULE($GLOBALS['module']);
switch ($check)
case "admin_only":
case "mem_only":
case "done":
- // Construct module name
- define('__MODULE', sprintf("%sinc/modules/%s.php", PATH, SQL_ESCAPE($GLOBALS['module'])));
-
// Does the module exists on local file system?
if ((FILE_READABLE(__MODULE)) && (getTotalFatalErrors() == 0)) {
// Module is valid, active and located on the local disc...
break;
case "locked":
- if (!FILE_READABLE(PATH."inc/modules/".$GLOBALS['module'].".php")) {
+ if (!FILE_READABLE(__MODULE)) {
// Module does addionally not exists
addFatalMessage(LANG_MOD_REG_404_1.$GLOBALS['module'].LANG_MOD_REG_404_2);
} // END - if
/////////////////////////////////////////////
//
// Everything is okay so we can load the module
- include (__MODULE);
+ LOAD_INC_ONCE(__MODULE);
} // END - if
// Next-to-end add the footer
-require_once(PATH."inc/footer.php");
+LOAD_INC_ONCE("inc/footer.php");
//
?>
$GLOBALS['module'] = "ref"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Redirect only to registration page when this script is installed
if (isBooleanConstantAndTrue('mxchange_installed')) {
$GLOBALS['module'] = "show_bonus"; $CSS = 0;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the "bonus" extension active?
if (!EXT_IS_ACTIVE("bonus")) {
// List only rankings when script is installed
if (isBooleanConstantAndTrue('mxchange_installed')) {
// Include header
- require(PATH."inc/header.php");
+ LOAD_INC("inc/header.php");
if (($_GET['uid'] > 0) && ($_GET['d'] > 0) && (!empty($_GET['t']))) {
// Set row name
LOAD_TEMPLATE("show_bonus");
// Include footer
- require(PATH."inc/footer.php");
+ LOAD_INC("inc/footer.php");
} else {
// You have to install first!
LOAD_URL("install.php");
require_once("inc/libs/security_functions.php");
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the script installed?
if (isBooleanConstantAndTrue('mxchange_installed')) {
require_once("inc/libs/security_functions.php");
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Redirect only to registration page when this script is installed
if (defined('mxchange_installed') && (isBooleanConstantAndTrue(mxchange_installed))) {
$msg = null;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
// Is the script installed?
if (isBooleanConstantAndTrue('mxchange_installed')) {
if ((SURFBAR_CHECK_RELOAD_FULL()) || ((isset($_GET['frame'])) && (in_array($_GET['frame'], array("stop", "stop2", "stats", "textlinks"))))) {
// Reload-lock is full, surfbar stopped so...
// Load header
- require_once(PATH."inc/header.php");
+ LOAD_INC_ONCE("inc/header.php");
// Load template
if (((isset($_GET['frame'])) && ($_GET['frame'] == "stop")) || (!isset($_GET['frame']))) {
}
// Load header
- require_once(PATH."inc/header.php");
+ LOAD_INC_ONCE("inc/header.php");
// Load that template
//* DEBUG: */ die("templateName={$templateName}<br />\n<strong>content</strong>=<pre>".print_r($content, true)."</pre>");
}
// Load footer
- require_once(PATH."inc/footer.php");
+ LOAD_INC_ONCE("inc/footer.php");
} else {
// You have to install first!
LOAD_URL("install.php");
--- /dev/null
+<form action="{!__BURL_ACTION!}/install.php?page=2" method="POST">
+<table border="0" cellspacing="0" cellpadding="0" class="install_content">
+<tr>
+ <td align="center">
+ <div class="install">{!HEADER_MYSQL_ERRORS!}</div>
+ </td>
+</tr>
+<tr><td colspan="2" height="21" class="seperator"> </td></tr>
+<tr>
+ <td><div class="install_intro">
+ {!TEXT_MYSQL_ERRORS!}
+ </div></td>
+</tr>
+<tr>
+ <td align="center"><strong>
+ <ol>
+{!__FATAL_ERROR_LI!}
+ </ol>
+{!__MYSQL_DATA!}
+ <input type="hidden" name="spath" value="{!__SPATH_VALUE!}" />
+ <input type="hidden" name="burl" value="{!__BURL_VALUE!}" />
+ <input type="hidden" name="title" value="{!__TITLE_VALUE!}" />
+ <input type="submit" class="admin_submit" name="ok" value="{!RETURN_MYSQL_PAGE!}" />
+ </strong></td>
+</tr>
+</table>
+</form>
$GLOBALS['module'] = "view"; $CSS = -1;
// Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
if (((!empty($_GET['user'])) || (!empty($_GET['reseller']))) && (!empty($_GET['banner']))) {
// Count banner view... we currently don't need the user's id but maybe