All, except security block, include()/require() rewritten to own LOAD_INC()/LOAD_INC_...
authorRoland Häder <roland@mxchange.org>
Thu, 19 Feb 2009 23:48:16 +0000 (23:48 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 19 Feb 2009 23:48:16 +0000 (23:48 +0000)
124 files changed:
.gitattributes
admin.php
agb.php
beg.php
birthday_confirm.php
click.php
confirm.php
css.php
debug.php
doubler.php
img.php
inc/config.php
inc/db/lib.php
inc/extensions.php
inc/extensions/ext-autopurge.php
inc/extensions/ext-beg.php
inc/extensions/ext-birthday.php
inc/extensions/ext-bonus.php
inc/extensions/ext-cache.php
inc/extensions/ext-doubler.php
inc/extensions/ext-mediadata.php
inc/extensions/ext-newsletter.php
inc/extensions/ext-profile.php
inc/extensions/ext-refback.php
inc/extensions/ext-sql_patches.php
inc/filters.php
inc/footer.php
inc/functions.php
inc/gen_mediadata.php
inc/gen_refback.php
inc/gen_sql_patches.php
inc/header.php
inc/install-inc.php
inc/language.php
inc/libs/cache_functions.php
inc/libs/rallye_functions.php
inc/libs/security_functions.php
inc/libs/sponsor_functions.php
inc/libs/theme_functions.php
inc/load_extensions.php
inc/loader/load_cache-admin.php
inc/loader/load_cache-config.php
inc/loader/load_cache-modreg.php
inc/loader/load_cache-refdepths.php
inc/loader/load_cache-refsystem.php
inc/loader/load_cache-them.php
inc/modules/admin.php
inc/modules/admin/action-
inc/modules/admin/action-admins.php
inc/modules/admin/action-bank.php
inc/modules/admin/action-country.php
inc/modules/admin/action-doubler.php
inc/modules/admin/action-email.php
inc/modules/admin/action-holiday.php
inc/modules/admin/action-login.php
inc/modules/admin/action-menu.php
inc/modules/admin/action-misc.php
inc/modules/admin/action-mods.php
inc/modules/admin/action-newsletter.php
inc/modules/admin/action-payouts.php
inc/modules/admin/action-primera.php
inc/modules/admin/action-rallye.php
inc/modules/admin/action-repair.php
inc/modules/admin/action-setup.php
inc/modules/admin/action-sponsor.php
inc/modules/admin/action-stats.php
inc/modules/admin/action-surfbar.php
inc/modules/admin/action-task.php
inc/modules/admin/action-theme.php
inc/modules/admin/action-transfer.php
inc/modules/admin/action-user.php
inc/modules/admin/action-wernis.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-config_secure.php
inc/modules/admin/what-edit_sponsor.php
inc/modules/admin/what-list_task.php
inc/modules/admin/what-lock_user.php
inc/modules/admin/what-logs.php
inc/modules/admin/what-overview.php
inc/modules/admin/what-theme_check.php
inc/modules/admin/what-theme_edit.php
inc/modules/admin/what-theme_import.php
inc/modules/admin/what-usage.php
inc/modules/guest/action-
inc/modules/guest/action-admin.php
inc/modules/guest/action-main.php
inc/modules/guest/action-members.php
inc/modules/guest/action-sponsor.php
inc/modules/guest/what-login.php
inc/modules/guest/what-wernis_portal.php
inc/modules/index.php
inc/modules/login.php
inc/modules/member/action-
inc/modules/member/action-account.php
inc/modules/member/action-bank.php
inc/modules/member/action-extras.php
inc/modules/member/action-logout.php
inc/modules/member/action-main.php
inc/modules/member/action-order.php
inc/modules/member/action-rals.php
inc/modules/member/action-stats.php
inc/modules/member/action-surfbar.php
inc/modules/member/what-reflinks.php
inc/modules/member/what-themes.php
inc/mysql-connect.php
inc/mysql-manager.php
inc/session.php
inc/stylesheet.php
index.php
install.php
js.php
lead-confirm.php
login.php
mailid.php
mailid_top.php
modules.php
ref.php
show_bonus.php
sponsor_confirm.php
sponsor_ref.php
surfbar.php
templates/de/html/install/install_fatal_errors.tpl [new file with mode: 0644]
view.php

index c4281ff..3056141 100644 (file)
@@ -1326,6 +1326,7 @@ templates/de/html/index.tpl -text
 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
index 3a173f4..ef2153f 100644 (file)
--- a/admin.php
+++ b/admin.php
@@ -44,7 +44,7 @@ $GLOBALS['module'] = "admin";
 $CSS = -1;
 
 // Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
 
 // Is the script installed?
 if (isBooleanConstantAndTrue('mxchange_installed')) {
diff --git a/agb.php b/agb.php
index be4e7dc..9e82d2d 100644 (file)
--- a/agb.php
+++ b/agb.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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')) {
diff --git a/beg.php b/beg.php
index 077e3cd..e1e41d1 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -46,7 +46,7 @@ $CSS = -1;
 $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")) {
@@ -186,7 +186,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                        SQL_FREERESULT($result);
 
                        // Include header
-                       require_once(PATH."inc/header.php");
+                       LOAD_INC_ONCE("inc/header.php");
 
                        // Load final template
                        LOAD_TEMPLATE("beg_link");
@@ -205,7 +205,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                        }
 
                        // 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);
index a40adc6..d33f8dc 100644 (file)
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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")) {
@@ -116,7 +116,7 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
        $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));
@@ -128,7 +128,7 @@ WHERE b.userid=%s AND b.chk_value='%s' LIMIT 1",
        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");
index ee59e6f..1f7398f 100644 (file)
--- a/click.php
+++ b/click.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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...
index 612d348..a86970d 100644 (file)
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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'))) {
diff --git a/css.php b/css.php
index 368716c..1496f78 100644 (file)
--- a/css.php
+++ b/css.php
@@ -55,16 +55,16 @@ $GLOBALS['module'] = "css";
 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");
 
 //
 ?>
index 025ec75..f08058f 100644 (file)
--- a/debug.php
+++ b/debug.php
@@ -43,7 +43,7 @@ $GLOBALS['action'] = "";
 $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)) {
@@ -58,16 +58,15 @@ if ((isBooleanConstantAndTrue('mxchange_installed')) && (getTotalFatalErrors() =
                // 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']);
index 182b473..2b0d5c6 100644 (file)
@@ -46,7 +46,7 @@ $GLOBALS['refid'] = 0;
 $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")) {
@@ -208,10 +208,10 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
        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));
@@ -272,7 +272,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
        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");
diff --git a/img.php b/img.php
index 15fb090..b6e1636 100644 (file)
--- a/img.php
+++ b/img.php
@@ -42,33 +42,32 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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");
index 536cae8..c645e2e 100644 (file)
@@ -162,7 +162,7 @@ define('SSL_COOKIES', false);
 define('ENABLE_BACKLINK', true);
 
 // Connect to the MySQL database...
-require_once(PATH."inc/mysql-connect.php");
+LOAD_INC_ONCE("inc/mysql-connect.php");
 
 //
 ?>
index 083e5f2..645721d 100644 (file)
@@ -38,21 +38,18 @@ if (!defined('__SECURITY')) {
 }
 
 // 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." -&gt; R.I.P.");
+       die("Cannot load database abstraction layer ".constant('_DB_TYPE')." -&gt; R.I.P.");
 }
 
-// Remove this globally used variable
-unset($FQFN);
-
 //
 ?>
index 91646a1..c299557 100644 (file)
@@ -55,7 +55,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // 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)) {
@@ -67,25 +67,25 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // 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
@@ -102,7 +102,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
 
        // Include the extension file
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Extension loaded.");
-       require($extInclude);
+       LOAD_INC($extInclude);
 
        // Is this extension deprecated?
        if ($EXT_DEPRECATED == "Y") {
@@ -667,7 +667,7 @@ function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) {
        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
                );
index ff66f2c..9c46b91 100644 (file)
@@ -257,7 +257,7 @@ default: // Do stuff when extension is loaded
        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;
 }
index 846ad31..8d392d6 100644 (file)
@@ -271,7 +271,7 @@ default: // Do stuff when extension is loaded
        // 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;
 }
index 15664c8..07cdfd4 100644 (file)
@@ -196,7 +196,7 @@ default: // Do stuff when extension is loaded
        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;
 }
index 70e8151..0bcddc7 100644 (file)
@@ -550,18 +550,18 @@ default: // Do stuff when extension is loaded
                // 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;
 }
index 5a0dc15..3a7f56e 100644 (file)
@@ -248,7 +248,7 @@ default: // Do stuff when extension is loaded
                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);
index 2a9dac4..e8c82f7 100644 (file)
@@ -240,7 +240,7 @@ case "test": // For testing purposes. For details see file inc/modules/admin/wha
 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;
 }
index bc23dc9..23eb6ec 100644 (file)
@@ -145,7 +145,7 @@ default: // Do stuff when extension is loaded
 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
 
index fd5f2f5..5810b4e 100644 (file)
@@ -170,7 +170,7 @@ default: // Do stuff when extension is loaded
 
        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;
 }
index e0f5c58..ae60910 100644 (file)
@@ -125,7 +125,7 @@ default: // Do stuff when extension is loaded
        // 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;
 }
index e1e165c..8edb325 100644 (file)
@@ -111,7 +111,9 @@ default: // Do stuff when extension is loaded
 // 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!
index 8da3cde..2c3ef53 100644 (file)
@@ -735,13 +735,13 @@ default: // Do stuff when extension is loaded
                        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
@@ -750,7 +750,7 @@ default: // Do stuff when extension is loaded
                // 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);
index 3ef321c..846668a 100644 (file)
@@ -407,7 +407,7 @@ function FILTER_LOAD_INCLUDES ($data) {
        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
index c32e5cd..e2d31c6 100644 (file)
@@ -45,7 +45,7 @@ if (($footer != "1") && ($footer != "2") && ($CSS != "1")) {
        // 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?
index e545aa0..f071322 100644 (file)
@@ -40,7 +40,7 @@ if (!defined('__SECURITY')) {
 // 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))) {
@@ -265,7 +265,7 @@ function LOAD_TEMPLATE ($template, $return=false, $content=array()) {
        $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
@@ -476,12 +476,12 @@ function SEND_RAW_EMAIL ($to, $subject, $msg, $from) {
        // 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;
@@ -701,7 +701,7 @@ function GET_LANGUAGE() {
        global $cacheArray;
 
        // Set default return value to default language from config
-       $ret = DEFAULT_LANG;
+       $ret = constant('DEFAULT_LANG');
 
        // Init variable
        $lang = "";
@@ -724,7 +724,7 @@ function GET_LANGUAGE() {
                $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
@@ -823,7 +823,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content=array(), $UID="0") {
        $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) {
@@ -950,9 +950,9 @@ function LOAD_URL($URL, $addUrlData=true) {
                header ("Location: ".str_replace("&amp;", "&", $URL));
        } else {
                // Output error message
-               require(PATH."inc/header.php");
+               LOAD_INC("inc/header.php");
                LOAD_TEMPLATE("redirect_url", false, str_replace("&amp;", "&", $URL));
-               require(PATH."inc/footer.php");
+               LOAD_INC("inc/footer.php");
        }
        exit();
 }
@@ -1319,7 +1319,7 @@ function GENERATE_IMAGE($img_code, $header=true) {
        }
 
        // 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'))
@@ -2240,13 +2240,13 @@ function FIX_DELETED_COOKIES ($cookies) {
 // 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;
@@ -2639,13 +2639,13 @@ function REBUILD_CACHE ($cache, $inc="") {
                // 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}");
@@ -2915,13 +2915,13 @@ function GET_CURR_THEME() {
                } // 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']));
                }
@@ -2934,7 +2934,7 @@ function GET_CURR_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;
@@ -3069,7 +3069,7 @@ function getActualVersion ($type = 0) {
        $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)) {
@@ -3105,6 +3105,48 @@ function getActualVersion ($type = 0) {
                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 //
 //////////////////////////////////////////////////
index bdf11b0..eae47ea 100644 (file)
@@ -71,7 +71,7 @@ FROM `{!_MYSQL_PREFIX!}_bonus`", __FILE__, __LINE__);
 } // 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);
index 6aa3729..596aa5b 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // 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__);
index efa7941..0c9afaa 100644 (file)
@@ -72,7 +72,10 @@ if (getConfig('master_salt') == "") {
 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);
@@ -95,7 +98,9 @@ if (getConfig('file_hash') == "") {
                        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)) {
index 6c85f0b..b04464c 100644 (file)
@@ -80,10 +80,10 @@ if (($header != "1") && ($header != "2")) {
                                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'));
@@ -118,7 +118,7 @@ if (($header != "1") && ($header != "2")) {
                LOAD_TEMPLATE("header");
 
                // Include stylesheet
-               require_once(PATH."inc/stylesheet.php");
+               LOAD_INC_ONCE("inc/stylesheet.php");
        } // END - if
 
        // Closing HEAD tag
index 3a7422e..c33ac6e 100644 (file)
@@ -419,33 +419,8 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                                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\">&nbsp;</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");
@@ -456,13 +431,13 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                } 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 {
index 1f8275c..6399eca 100644 (file)
@@ -38,27 +38,26 @@ if (!defined('__SECURITY')) {
 }
 
 // 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");
 }
 
 //
index bb5db58..4e12fb9 100644 (file)
@@ -178,7 +178,7 @@ class CacheSystem {
                        $cache_version = null;
 
                        // Load cache file
-                       require_once($this->inc);
+                       LOAD_INC_ONCE($this->inc);
 
                        // Is there an array?
                        if (is_array($data)) {
index 4389864..fb4fa4a 100644 (file)
@@ -695,7 +695,7 @@ function RALLYE_TEMPLATE_SELECTION($name="template", $default="")
 {
        // 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))
        {
index 02b5132..1f08065 100644 (file)
@@ -93,7 +93,7 @@ $SEC_CHARS = array(
                "{CLOSE_ANCHOR2}",
                "{SLASH}",
                "{DOT}",
-               '{QUOT}',
+               "{QUOT}",
                "{DOLLAR}",
                "{OPEN_ANCHOR}",
                "{CLOSE_ANCHOR}",
index 1bc1c7e..48300f1 100644 (file)
@@ -354,10 +354,10 @@ function GENERATE_SPONSOR_CONTENT($what)
 {
        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);
index 61b3243..6289a3d 100644 (file)
@@ -53,10 +53,10 @@ function THEME_SELECTION_BOX($mod, $act, $wht, $result) {
        // 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
@@ -208,9 +208,9 @@ if ((!empty($_POST['new_theme'])) && ($_POST['new_theme'] != $currTheme)) {
        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
 
 //
index c033051..f77b7c7 100644 (file)
@@ -95,7 +95,7 @@ if ($cacheMode == "load") {
                $cacheInstance->destroyCacheFile();
 
                // Retry it
-               require(__FILE__);
+               LOAD_INC(__FILE__);
                return;
        } // END -  if
 
@@ -163,7 +163,7 @@ if ($cacheMode == "load") {
        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);
@@ -192,7 +192,7 @@ $DEL = array();
 // 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)) {
@@ -203,7 +203,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
                } // 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)) {
@@ -225,7 +225,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
                        // 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)) {
@@ -260,7 +260,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && ((($cacheMode == "init") && ($CSS != "1")
                $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
index 5f240f5..eef5335 100644 (file)
@@ -107,7 +107,7 @@ ORDER BY login", __FILE__, __LINE__);
        $cacheInstance->finalize();
 
        // Reload the cache
-       require(__FILE__);
+       LOAD_INC(__FILE__);
 }
 
 // Next cached table are the admins_acls...
@@ -138,7 +138,7 @@ if (GET_EXT_VERSION("admins") >= "0.3") {
                $cacheInstance->finalize();
 
                // Reload the cache
-               require(__FILE__);
+               LOAD_INC(__FILE__);
        }
 } // END - if
 
index 133a6dc..72853a2 100644 (file)
@@ -66,7 +66,7 @@ if (($cacheInstance->loadCacheFile("config", true)) && ($cacheInstance->extensio
        $cacheInstance->finalize();
 
        // Reload the cache
-       require(__FILE__);
+       LOAD_INC(__FILE__);
 }
 
 //
index b6eb02a..7e6411a 100644 (file)
@@ -96,7 +96,7 @@ FROM `{!_MYSQL_PREFIX!}_mod_reg` ORDER BY `id`", __FILE__, __LINE__);
        $cacheInstance->finalize();
 
        // Reload the cache
-       require(__FILE__);
+       LOAD_INC(__FILE__);
 }
 
 //
index 208d882..7c5bf3f 100644 (file)
@@ -64,7 +64,7 @@ if (($cacheInstance->loadCacheFile("refdepths")) && ($cacheInstance->extensionVe
        $cacheInstance->finalize();
 
        // Reload the cache
-       require(__FILE__);
+       LOAD_INC(__FILE__);
 }
 
 //
index 87dce53..b657646 100644 (file)
@@ -64,7 +64,7 @@ if (($cacheInstance->loadCacheFile("refsystem")) && ($cacheInstance->extensionVe
        $cacheInstance->finalize();
 
        // Reload the cache
-       require(__FILE__);
+       LOAD_INC(__FILE__);
 }
 
 //
index c516fe9..0b453f1 100644 (file)
@@ -91,7 +91,7 @@ if (($cacheInstance->loadCacheFile("themes")) && ($cacheInstance->extensionVersi
        $cacheInstance->finalize();
 
        // Reload the cache
-       require(__FILE__);
+       LOAD_INC(__FILE__);
 }
 
 //
index fec5cc9..2d11145 100644 (file)
@@ -44,7 +44,7 @@ if ((empty($GLOBALS['action'])) && ($check == "admin_only")) {
 } // 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'));
@@ -355,7 +355,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
                        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']);
index 4991768..cdaccba 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 584cea7..69eaf11 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index ff6fd6a..2247dfd 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 6407fa2..572b5a8 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index c289625..ec9c8cf 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
index fa176d7..303a858 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 1085578..dcdc7e3 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 9fad8a1..cc980cf 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 0377e5d..eec930c 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 2f261a6..6f6b74a 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 609fda6..a0ecec3 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 438d613..eae1d18 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index b4b15bf..29af434 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index f2549d1..48bc6cc 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index b6f3046..9b7df7e 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 0add635..f94fd84 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 560c878..d2cb9c5 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index fb1c527..b9452b7 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 86ff0f2..4100288 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index ff29f17..9b721fe 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 06b0b88..20274b9 100644 (file)
@@ -44,10 +44,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 494674d..d1e14ad 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 5aaa6fd..8175c2f 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index b2a3e9e..cdc5240 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 46a97df..4957c8f 100644 (file)
@@ -41,10 +41,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 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);
 }
index 75f66ff..f729b1d 100644 (file)
@@ -349,10 +349,10 @@ LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__);
        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'));
@@ -469,7 +469,7 @@ function ADD_ADMIN_MENU($act, $wht, $return=false) {
                <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 {
@@ -729,7 +729,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con
 // 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";
@@ -739,7 +739,7 @@ function ADMIN_MAKE_MENU_SELECTION ($menu, $type, $name, $default="") {
                // 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)) {
index 188f07a..f9e89a7 100644 (file)
@@ -75,7 +75,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
                                } // 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";
index e241ce7..b717f17 100644 (file)
@@ -43,7 +43,7 @@ if (isset($_POST['ok'])) {
        // 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']);
index 73b5ab0..dd3d722 100644 (file)
@@ -185,7 +185,7 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) {
                                // 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>");
 
index d30d507..3e8f80c 100644 (file)
@@ -84,7 +84,7 @@ if (!empty($whereStatement))
        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 {
index 435ab83..1a4c705 100644 (file)
@@ -108,7 +108,7 @@ if (!empty($_GET['u_id'])) {
                } 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&amp;what=list_user&amp;u_id=".bigintval($_GET['u_id']);
index a4ab2a1..648fa3a 100644 (file)
@@ -43,7 +43,7 @@ ADD_DESCR("admin", __FILE__);
 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)) {
index 208c377..20a1057 100644 (file)
@@ -41,7 +41,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // 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
index 9cff81b..04a9354 100644 (file)
@@ -69,7 +69,7 @@ if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]"))
                // 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
index 5eff513..8066104 100644 (file)
@@ -101,8 +101,13 @@ $OUT = ""; $SW = 2;
 $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;
index d8ab90b..9dbff1f 100644 (file)
@@ -51,10 +51,10 @@ if (!empty($_POST['theme'])) {
        // 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`)
@@ -94,12 +94,12 @@ $THEMES = array(
 $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;
index e9d28df..fa5f774 100644 (file)
@@ -45,37 +45,43 @@ $usage = getConfig('usage_base')."/";
 
 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);
index 0641287..84177b6 100644 (file)
@@ -47,10 +47,10 @@ if (!defined('__SECURITY')) {
 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 {
index 39c8bbb..eb04fed 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 }
 
 // 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 {
index 87d77a9..4a1528f 100644 (file)
@@ -44,12 +44,12 @@ if (!defined('__SECURITY')) {
 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 {
index 214fadd..39edeef 100644 (file)
@@ -44,10 +44,10 @@ if (!defined('__SECURITY')) {
 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 {
index 30b6a52..d2a0a9c 100644 (file)
@@ -46,10 +46,10 @@ if (!defined('__SECURITY')) {
 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 {
index b3693ca..9b7ffe5 100644 (file)
@@ -164,7 +164,7 @@ if (!empty($URL)) {
        // 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);
index 51a2efa..8a32c4c 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 }
 
 // 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__);
index dee82df..686da74 100644 (file)
@@ -108,12 +108,12 @@ LOAD_TEMPLATE("guest_menu_content");
 $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");
index 89756f9..50d7d98 100644 (file)
@@ -78,10 +78,10 @@ if ((getConfig('member_menu') == "Y") || (!EXT_IS_ACTIVE("sql_patches", true)))
 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");
index 7fcb665..91e6a06 100644 (file)
@@ -49,10 +49,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index 538709a..9f19674 100644 (file)
@@ -46,10 +46,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index b641a2c..8aad934 100644 (file)
@@ -49,10 +49,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index ffef8c9..6aae2a0 100644 (file)
@@ -46,10 +46,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index 557c54c..e3f4de5 100644 (file)
@@ -46,10 +46,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index 27bd965..7158a4c 100644 (file)
@@ -46,10 +46,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index d8455dc..5248f12 100644 (file)
@@ -49,10 +49,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index df0838f..5815abf 100644 (file)
@@ -46,10 +46,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index 284de3b..c7e9111 100644 (file)
@@ -46,10 +46,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index c2090cd..214a66b 100644 (file)
@@ -49,10 +49,10 @@ if (!defined('__SECURITY')) {
 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);
 }
index 8b400c2..4a88da8 100644 (file)
@@ -78,7 +78,7 @@ if (SQL_NUMROWS($result) > 0) {
        // 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 = "";
index 2034e6e..e260fae 100644 (file)
@@ -74,11 +74,11 @@ $THEMES = array(
 $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;
index c9e9563..697481e 100644 (file)
@@ -41,19 +41,19 @@ if (!defined('__SECURITY')) {
 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) {
@@ -166,21 +166,21 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                $_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();
@@ -216,7 +216,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                } // 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
@@ -241,14 +241,14 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                                }
                        } 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'));
@@ -256,7 +256,7 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
                }
        } 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'));
@@ -271,8 +271,8 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
        $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)) {
@@ -297,9 +297,9 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT
 
 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
 
 //
index 9e82899..7afa45d 100644 (file)
@@ -155,7 +155,7 @@ function CHECK_MODULE ($mod) {
        // 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
@@ -369,9 +369,8 @@ function ADD_MENU ($MODE, $act, $wht) {
 
                                        // 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>";
                                                }
@@ -385,7 +384,7 @@ function ADD_MENU ($MODE, $act, $wht) {
                                        // Menu title
                                        $content .= getConfig('menu_blur_spacer') . $sub_title;
 
-                                       if ($test) {
+                                       if (FILE_READABLE($FQFN)) {
                                                $content .= "</a>";
                                        } else {
                                                $content .= "</em>";
@@ -411,14 +410,14 @@ function ADD_MENU ($MODE, $act, $wht) {
                        } 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>");
index 89f3705..37f988d 100644 (file)
@@ -57,10 +57,10 @@ global $PHPSESSID;
 $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();
index c93b50b..4840655 100644 (file)
@@ -59,7 +59,7 @@ if (($CSS == "1") || (getConfig('css_php') == "DIRECT")) {
        // 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
index d5ee879..fc1220d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -43,12 +43,12 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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;
@@ -81,7 +81,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
        }
 
        // Footer
-       require(PATH."inc/footer.php");
+       LOAD_INC("inc/footer.php");
 } else {
        // You have to install first!
        LOAD_URL("install.php");
index a700f22..b6f2416 100644 (file)
@@ -45,7 +45,7 @@
 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;
@@ -59,10 +59,10 @@ $CSS = 0;
 $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'])) {
@@ -81,14 +81,14 @@ if (getTotalFatalErrors() == 0) {
        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");
 
 //
 ?>
diff --git a/js.php b/js.php
index 0ced4dc..d5598fb 100644 (file)
--- a/js.php
+++ b/js.php
@@ -51,7 +51,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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']))) {
@@ -59,22 +59,21 @@ 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
 
 //
index f014f2d..793814e 100644 (file)
@@ -43,12 +43,12 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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(
@@ -83,7 +83,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
        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");
index 2753753..3d9dab5 100644 (file)
--- a/login.php
+++ b/login.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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')) {
index 4778ba9..d1bae74 100644 (file)
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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
@@ -156,7 +156,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                                                }
 
                                                // Add header
-                                               require_once(PATH."inc/header.php");
+                                               LOAD_INC_ONCE("inc/header.php");
 
                                                // Was that mail a valid one?
                                                if ($VALID) {
@@ -216,7 +216,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                }
        } else {
                // Include footer
-               require_once(PATH."inc/footer.php");
+               LOAD_INC_ONCE("inc/footer.php");
        }
 } else {
        // You have to install first!
index 1c9405a..513b898 100644 (file)
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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
@@ -62,7 +62,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
        // 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) {
@@ -348,7 +348,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                // 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") {
index 4215f5c..f1b619b 100644 (file)
@@ -55,7 +55,7 @@ if (!empty($_GET['what'])) $GLOBALS['what'] = secureString($_GET['what']);
 $GLOBALS['module'] = secureString($_GET['module']);
 
 // Needed include files
-require("inc/config.php");
+require_once("inc/config.php");
 
 // Check if logged in
 if (IS_MEMBER()) {
@@ -94,7 +94,7 @@ 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";
@@ -102,6 +102,9 @@ if ((getConfig('maintenance') == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] !=
        // 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)
@@ -109,9 +112,6 @@ if ((getConfig('maintenance') == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] !=
        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...
@@ -129,7 +129,7 @@ if ((getConfig('maintenance') == "Y") && (!IS_ADMIN()) && ($GLOBALS['module'] !=
                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
@@ -154,11 +154,11 @@ if (($MOD_VALID) && (defined('__MODULE'))) {
        /////////////////////////////////////////////
        //
        // 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");
 
 //
 ?>
diff --git a/ref.php b/ref.php
index 604a86d..ef79784 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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')) {
index ddff568..d86e5fe 100644 (file)
@@ -44,7 +44,7 @@ $GLOBALS['action'] = "";
 $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")) {
@@ -55,7 +55,7 @@ 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
@@ -133,7 +133,7 @@ LIMIT 1",
        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");
index 5b601d8..d849c93 100644 (file)
@@ -34,7 +34,7 @@
 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')) {
index 065aef6..e632647 100644 (file)
@@ -34,7 +34,7 @@
 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))) {
index a640ea6..07d22fb 100644 (file)
@@ -47,7 +47,7 @@ $CSS = 0;
 $msg = null;
 
 // Load the required file(s)
-require("inc/config.php");
+require_once("inc/config.php");
 
 // Is the script installed?
 if (isBooleanConstantAndTrue('mxchange_installed')) {
@@ -67,7 +67,7 @@ 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']))) {
@@ -183,7 +183,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                }
 
                // 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>");
@@ -191,7 +191,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
        }
 
        // Load footer
-       require_once(PATH."inc/footer.php");
+       LOAD_INC_ONCE("inc/footer.php");
 } else {
        // You have to install first!
        LOAD_URL("install.php");
diff --git a/templates/de/html/install/install_fatal_errors.tpl b/templates/de/html/install/install_fatal_errors.tpl
new file mode 100644 (file)
index 0000000..c68e2e9
--- /dev/null
@@ -0,0 +1,27 @@
+<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">&nbsp;</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>
index a22e835..0344832 100644 (file)
--- a/view.php
+++ b/view.php
@@ -42,7 +42,7 @@ $GLOBALS['what'] = ""; $GLOBALS['action'] = "";
 $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