Constant PATH rewritten, some parts rewritten to use INCLUDE_READABLE()
authorRoland Häder <roland@mxchange.org>
Mon, 23 Feb 2009 19:40:40 +0000 (19:40 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 23 Feb 2009 19:40:40 +0000 (19:40 +0000)
12 files changed:
inc/autopurge.php
inc/config.php
inc/db/lib-mysql3.php
inc/extensions/ext-sql_patches.php
inc/functions.php
inc/load_cache.php
inc/modules/admin.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-theme_import.php
inc/modules/guest/what-wernis_portal.php
inc/modules/member/what-themes.php
inc/pool-update.php

index 75bddcd86b15f2864ccb3d377222099beda077e1..8f2e72a208e683e053d724c893464283f701541a 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Load all includes
-$INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/autopurge/", "purge-");
+$INC_POOL = GET_DIR_AS_ARRAY(constant('PATH')."inc/autopurge/", "purge-");
 
 // Run the filter
 RUN_FILTER('load_includes', $INC_POOL);
index 5e6307bbd6ca4e426b69bab8c022228a141715c5..4cfa57bbbf36aee8a0d990951e82ed04981c2783 100644 (file)
@@ -162,7 +162,7 @@ define('SSL_COOKIES', false);
 define('ENABLE_BACKLINK', true);
 
 // Connect to the MySQL database...
-require(PATH."inc/mysql-connect.php");
+require(constant('PATH')."inc/mysql-connect.php");
 
 //
 ?>
index 8d0ee5f467477c1b0700e9800f285203f611c026..b1850f4efa553eb7983d1ed102eefd3cd7a813ed 100644 (file)
@@ -79,7 +79,7 @@ Query string:<br />
                //
                // Debugging stuff...
                //
-               $fp = @fopen(PATH."inc/cache/mysql.log", 'a') or mxchange_die("Cannot write mysql.log!");
+               $fp = fopen(constant('PATH')."inc/cache/mysql.log", 'a') or mxchange_die("Cannot write mysql.log!");
                if (!isset($OK)) {
                        // Write first entry
                        fwrite($fp, "Module=".$GLOBALS['module']."\n");
@@ -256,7 +256,7 @@ function SQL_QUERY_ESC ($qstring, $data, $file, $line, $run=true, $strip=true) {
        //
        // Debugging
        //
-       //* DEBUG: */ $fp = fopen(PATH."inc/cache/escape_debug.log", 'a') or mxchange_die("Cannot write debug.log!");
+       //* DEBUG: */ $fp = fopen(constant('PATH')."inc/cache/escape_debug.log", 'a') or mxchange_die("Cannot write debug.log!");
        //* DEBUG: */ fwrite($fp, $file."(".$line."): ".str_replace("\r", "", str_replace("\n", " ", $eval))."\n");
        //* DEBUG: */ fclose($fp);
 
index 3cc2446bf531d90328b48a9edc7f839408771e71..d849e757e321f6b45c768dd2709ffd946fc9def6 100644 (file)
@@ -310,7 +310,7 @@ case "update": // Update an extension
 
        case "0.2.4": // SQL queries for v0.2.4
                $auto_type = "png"; // PNG image is the default
-               if ((FILE_READABLE(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
+               if ((INCLUDE_READABLE("theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
                        // Switch to JPEG format
                        $auto_type = "jpg";
                }
index 38612873b25b6a9be882b1929a991055823ea0c6..c5db673515ab429308bea018173048a8f4c41958 100644 (file)
@@ -712,7 +712,7 @@ function GET_LANGUAGE() {
                $ret = $cacheArray['language'];
        } elseif (!empty($lang)) {
                // Check if main language file does exist
-               if (FILE_READABLE(PATH."inc/language/".$lang.".php")) {
+               if (FILE_READABLE(constant('PATH')."inc/language/".$lang.".php")) {
                        // Okay found, so let's update cookies
                        SET_LANGUAGE($lang);
                }
@@ -1227,7 +1227,7 @@ function GEN_RANDOM_CODE($length, $code, $uid, $DATA="") {
        if (!defined('_MAX')) define('_MAX', 15235);
 
        // Build server string
-       $server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(PATH."inc/databases.php");
+       $server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(constant('PATH')."inc/databases.php");
 
        // Build key string
        $keys   = SITE_KEY.":".DATE_KEY;
@@ -2033,7 +2033,7 @@ function generateHash ($plainText, $salt = "") {
        // When the salt is empty build a new one, else use the first x configured characters as the salt
        if (empty($salt)) {
                // Build server string
-               $server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(PATH."inc/databases.php");
+               $server = $_SERVER['PHP_SELF'].":".GET_USER_AGENT().":".getenv('SERVER_SOFTWARE').":".GET_REMOTE_ADDR().":".":".filemtime(constant('PATH')."inc/databases.php");
 
                // Build key string
                $keys   = constant('SITE_KEY').":".constant('DATE_KEY').":".getConfig('secret_key').":".getConfig('file_hash').":".date("d-m-Y (l-F-T)", bigintval(getConfig('patch_ctime'))).":".getConfig('master_salt');
@@ -2400,7 +2400,7 @@ function DEBUG_LOG ($file, $line, $message, $force=true) {
        // Is debug mode enabled?
        if ((isBooleanConstantAndTrue('DEBUG_MODE')) || ($force === true)) {
                // Log this message away
-               $fp = fopen(PATH."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!");
+               $fp = fopen(constant('PATH')."inc/cache/debug.log", 'a') or mxchange_die("Cannot write logfile debug.log!");
                fwrite($fp, date("d.m.Y|H:i:s", time())."|".basename($file)."|".$line."|".strip_tags($message)."\n");
                fclose($fp);
        } // END - if
@@ -2457,7 +2457,7 @@ function RESET_ADD_INCLUDES () {
        } // END - if
 
        // Get more daily reset scripts
-       $INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/reset/", "reset_");
+       $INC_POOL = GET_DIR_AS_ARRAY(constant('PATH')."inc/reset/", "reset_");
 
        // Update database
        if (!defined('DEBUG_RESET')) UPDATE_CONFIG("last_update", time());
@@ -2468,7 +2468,7 @@ function RESET_ADD_INCLUDES () {
        // Has it changed?
        if (getConfig('last_week') != $currWeek) {
                // Include weekly reset scripts
-               $INC_POOL = merge_array($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/weekly/", "weekly_"));
+               $INC_POOL = merge_array($INC_POOL, GET_DIR_AS_ARRAY(constant('PATH')."inc/weekly/", "weekly_"));
 
                // Update config
                if (!defined('DEBUG_WEEKLY')) UPDATE_CONFIG("last_week", $currWeek);
@@ -2480,7 +2480,7 @@ function RESET_ADD_INCLUDES () {
        // Has it changed?
        if (getConfig('last_month') != $currMonth) {
                // Include monthly reset scripts
-               $INC_POOL = merge_array($INC_POOL, GET_DIR_AS_ARRAY(PATH."inc/monthly/", "monthly_"));
+               $INC_POOL = merge_array($INC_POOL, GET_DIR_AS_ARRAY(constant('PATH')."inc/monthly/", "monthly_"));
 
                // Update config
                if (!defined('DEBUG_MONTHLY')) UPDATE_CONFIG("last_month", $currMonth);
index 4e849ba4402108eb778629cd0d37c29295978d74..cc441d5d8b5002454823e85ce78d0ec24cd0f088 100644 (file)
@@ -38,7 +38,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Load more cache includes
-$INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/loader/", "load_cache-");
+$INC_POOL = GET_DIR_AS_ARRAY(constant('PATH')."inc/loader/", "load_cache-");
 
 // Run the filter
 RUN_FILTER('load_includes', $INC_POOL);
index 5700828f82251fe6b848fe260527514ab830c442..2127e9f67b3943c75814d3e34cfcb7845b3291d7 100644 (file)
@@ -68,7 +68,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
                switch ($ret)
                {
                case "done":
-                       admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
+                       admin_WriteData(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
                        if (!constant('_FATAL')) {
                                // Registering is done
                                LOAD_URL("modules.php?module=admin&amp;action=login&register=done");
@@ -96,7 +96,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
                        // Admin still not registered?
                        if (!isBooleanConstantAndTrue('admin_registered')) {
                                // Write to config that registration is done
-                               admin_WriteData(PATH."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
+                               admin_WriteData(constant('PATH')."inc/config.php", "ADMIN-SETUP", "define('admin_registered', ", ");", "true", 0);
 
                                // Load URL for login
                                LOAD_URL("modules.php?module=admin&amp;action=login");
@@ -347,7 +347,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
                if (!isConfigEntrySet('admin_menu')) setConfigEntry('admin_menu', "OLD");
 
                // Check for version and switch between old menu system and new "intelligent menu system"
-               if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (FILE_READABLE(PATH."inc/modules/admin/lasys-inc.php"))) {
+               if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (INCLUDE_READABLE("inc/modules/admin/lasys-inc.php"))) {
                        // Default area is the entrance, of course
                        $area = "entrance";
 
index 2ffdeee1f7d3c2b72692c2cd84957ede3b35d330..85d37c9740751a0548e819755567f7d3c44221f8 100644 (file)
@@ -49,7 +49,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
        $JOBS_DONE = true;
 
        // Open the extension directory
-       $handle = opendir(PATH."inc/extensions/") or mxchange_die("Cannot read extension directory!");
+       $handle = opendir(constant('PATH')."inc/extensions/") or mxchange_die("Cannot read extension directory!");
        while ($file = readdir($handle)) {
                // Is this file an extension?
                if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == ".php")) {
index 045e925e2bb630f89d9d7a9b75727773edbf22fe..df118063b96f88e5eca1c0b6b987cdc35410ed37 100644 (file)
@@ -90,7 +90,7 @@ $THEMES = array(
 );
 
 // Read directory "themes"
-$handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
+$handle = opendir(constant('PATH')."theme/") or mxchange_die("Cannot read themes dir!");
 while ($dir = readdir($handle)) {
        // Construct absolute theme.php file name
        $INC = sprintf("theme/%s/theme.php", $dir);
index 3d801a5e8c80bea7740d27766f71df45b8fac896..c60a8f3f8e03f5e7a4501009af91ebb7f924a81c 100644 (file)
@@ -49,7 +49,7 @@ ADD_DESCR("guest", __FILE__);
 OUTPUT_HTML("<div style=\"padding-left: 10px; padding-right: 10px\">");
 $rdf = new fase4_rdf();
 $rdf->use_dynamic_display(false);
-$rdf->set_CacheDir(PATH."inc/cache/");
+$rdf->set_CacheDir(constant('PATH')."inc/cache/");
 $rdf->set_salt(md5(SITE_KEY));
 $rdf->set_max_item(10);
 $rdf->set_Options(
index 990f2bedce3a11aa893d175b583b51d7986466b8..cf10a10eab7a7b62bc51f8190c313c2f87b8d108 100644 (file)
@@ -71,7 +71,7 @@ $THEMES = array(
 );
 
 // Read directory "themes"
-$handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
+$handle = opendir(constant('PATH')."theme/") or mxchange_die("Cannot read themes dir!");
 while ($entry = readdir($handle)) {
        // Construct absolute theme.php file name
        $INC = sprintf("theme/%s/theme.php", $entry);
index 32256682f5370933dbb4853696c23d9f8e04a4c5..93e986148ad7a6b01220de3b9790791d1705205e 100644 (file)
@@ -47,7 +47,7 @@ if (defined('__DAILY_RESET')) {
 $GLOBALS['pool_cnt'] = 0;
 
 // Load more cache includes
-$INC_POOL = GET_DIR_AS_ARRAY(PATH."inc/pool/", "pool-");
+$INC_POOL = GET_DIR_AS_ARRAY(constant('PATH')."inc/pool/", "pool-");
 
 // Run the filter
 RUN_FILTER('load_includes', $INC_POOL);