Surfbar admin stats added (dummy), FILE_READABLE() added
authorRoland Häder <roland@mxchange.org>
Wed, 10 Sep 2008 09:42:13 +0000 (09:42 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 10 Sep 2008 09:42:13 +0000 (09:42 +0000)
73 files changed:
.gitattributes
inc/extensions.php
inc/extensions/ext-sql_patches.php
inc/extensions/ext-surfbar.php
inc/functions.php
inc/install-inc.php
inc/language.php
inc/libs/cache_functions.php
inc/libs/output_functions.php
inc/libs/sponsor_functions.php
inc/load_extensions.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/what-edit_sponsor.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-logs.php
inc/modules/admin/what-surfbar_stats.php [new file with mode: 0644]
inc/modules/admin/what-theme_check.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/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/modules/sponsor.php
inc/modules/sponsor/.php
inc/modules/sponsor/account.php
inc/modules/sponsor/settings.php
inc/modules/sponsor/welcome.php
inc/mysql-manager.php
inc/stylesheet.php
inc/theme-manager.php
modules.php

index 0c0dfd6..f6de7bd 100644 (file)
@@ -369,6 +369,7 @@ inc/modules/admin/what-send_bonus.php -text
 inc/modules/admin/what-send_newsletter.php -text
 inc/modules/admin/what-stats_mods.php -text
 inc/modules/admin/what-sub_points.php -text
+inc/modules/admin/what-surfbar_stats.php -text
 inc/modules/admin/what-theme_check.php -text
 inc/modules/admin/what-theme_edit.php -text
 inc/modules/admin/what-theme_import.php -text
index 17dbf7d..1250799 100644 (file)
@@ -55,7 +55,7 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
        $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
 
        // Does this extension exists?
-       if (file_exists($file) && is_readable($file))
+       if (FILE_READABLE($file))
        {
                // Extension was found so we can load it in registration mode
                require($file);
@@ -98,7 +98,7 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false)
                        $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $EXT_UPDATE_DEPENDS);
 
                        // Check for required file
-                       if (file_exists($file) && is_readable($file))
+                       if (FILE_READABLE($file))
                        {
                                // File exists so let's load it
                                $VER_BACKUP = $EXT_VERSION;
@@ -254,7 +254,10 @@ function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
        // Load extension in detected mode
        //* DEBUG: */ echo __FUNCTION__.":ext_name[{$id}]={$ext_name}<br />\n";
        $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
-       if (file_exists($file) && is_readable($file)) require($file);
+       if (FILE_READABLE($file)) {
+               // Load the include
+               require($file);
+       }
 
        //* DEBUG: */ echo __FUNCTION__.":SQLs::count=".count($SQLs)."<br />\n";
        if ((is_array($SQLs) && (sizeof($SQLs) > 0))) {
@@ -316,7 +319,7 @@ function EXT_IS_ACTIVE ($ext_name, $ignore_admin = false, $ignore_cache = false)
 
        // Extension's file name will also be checked
        $file = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
-       if ((!file_exists($file)) && (!is_readable($file))) return false;
+       if (!FILE_READABLE($file)) return false;
        //* DEBUG: */ echo "*".$ext_name."(".count($cacheArray).")<br />";
 
        // Not active is the default
@@ -362,9 +365,7 @@ function EXT_IS_ACTIVE ($ext_name, $ignore_admin = false, $ignore_cache = false)
                (
                        $active == "Y"
                ) && (
-                       file_exists($inc)
-               ) && (
-                       is_readable($inc)
+                       FILE_READABLE($inc)
                )
        );
 }
index b332e0d..958fc7a 100644 (file)
@@ -289,8 +289,7 @@ PRIMARY KEY(id)
 
        case "0.2.4": // SQL queries for v0.2.4
                $auto_type = "png"; // PNG image is the default
-               if ((file_exists(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg'))
-               {
+               if ((FILE_READABLE(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
                        // Switch to JPEG format
                        $auto_type = "jpg";
                }
@@ -588,19 +587,21 @@ default: // Do stuff when extension is loaded
                                require_once(PATH."inc/extensions/ext-cache.php");
                                if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
                                if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
-                       }
-               }
+                       } // END - if
+               } // END - if
 
                // Test again
                if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) {
                        // File hash fas generated so we can also file the secret file... hopefully.
-                       if ((file_exists(PATH."inc/.secret/.".$_CONFIG['file_hash'])) && (is_readable(PATH."inc/.secret/.".$_CONFIG['file_hash']))) {
-                               $_CONFIG['secret_key'] = implode("", file(PATH."inc/.secret/.".$_CONFIG['file_hash']));
+                       $hashFile = sprintf("%sinc/.secret/.%s", PATH, $_CONFIG['file_hash']);
+                       if (FILE_READABLE($hashFile)) {
+                               // Read file
+                               $_CONFIG['secret_key'] = implode("", file($hashFile));
                        } else {
                                // Cannot read secret file!
                                mxchange_die("Cannot read secret file!");
                        }
-               }
+               } // END - if
 
                // Transfer words/numbers to constants
                define('POINTS'  , $dummy['points_word']);
index 1ffc749..4550e53 100644 (file)
@@ -58,7 +58,6 @@ case "register": // Do stuff when installtion is running (modules.php?module=adm
 `last_salt` VARCHAR( 255 ) NOT NULL DEFAULT '',
 `reward` FLOAT(10,5) UNSIGNED  NOT NULL DEFAULT '0.00000',
 `costs` FLOAT(10,5) UNSIGNED  NOT NULL DEFAULT '0.00000',
-`payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
 `views_total` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
 `status` ENUM('PENDING','CONFIRMED', 'LOCKED') NOT NULL DEFAULT 'CONFIRMED',
 `registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -128,11 +127,12 @@ INDEX (`userid`,`url_id`)
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',3)";
 
        // Admin menus
-       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','','Surfbar','URLs in der Surfbar verwalten, Einstellungen &auml;ndern und vieles mehr.',7)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar',NULL,'Surfbar','URLs in der Surfbar verwalten, Einstellungen &auml;ndern und vieles mehr.',7)";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','add_surfbar_url','URL hinzuf&uuml;gen','F&uuml;gen Sie URLs z.B. von Werbenetzwerken hinzu, oder Ihre eigenen Projekte. <strong>Vorsicht!</strong> Ihnen muss es auch gestattet sein, URLs aus dem Werbenetzwerk in die Surfbar einzuf&uuml;gen.',1)";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_urls','URLs verwalten','Verwalten Sie hier alle in der Surfbar befindlichen URLs mit nur wenigen Klicks.',2)";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','unlock_surfbar_urls','Wartende URLs freigeben','Geben Sie hier nur direkt in der Surfbar gebuchte URLs frei.',3)";
        $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar &auml;ndern, wie Festverg&uuml;tung, prozentuale Ref-Verg&uuml;tung und vieles mehr.',4)";
+       $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','surfbar_stats','Statistiken','Detailierte Statistiken zu einer ausgew&auml;hlten URL anzeigen.',5)";
 
        // Load CSS?
        $EXT_CSS = "Y";
@@ -145,7 +145,7 @@ case "remove": // Do stuff when removing extension
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`";
        $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `action`='surfbar' LIMIT 4";
-       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 5";
+       $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 6";
        break;
 
 case "activate": // Do stuff when admin activates this extension
index 0bfa730..bfe60aa 100644 (file)
@@ -272,20 +272,20 @@ function LOAD_TEMPLATE($template, $return=false, $content="") {
                );
 
                // Probe for it...
-               if (file_exists($file2)) $file = $file2;
+               if (FILE_READABLE($file2)) $file = $file2;
 
                // Remove variable from memory
                unset($file2);
        }
 
        // Does the special template exists?
-       if ((!file_exists($file)) || (!is_readable($file))) {
+       if (!FILE_READABLE($file)) {
                // Reset to default template
                $file = $BASE.$template.".tpl";
-       }
+       } // END - if
 
        // Now does the final template exists?
-       if ((file_exists($file)) && (is_readable($file))) {
+       if (FILE_READABLE($file)) {
                // The local file does exists so we load it. :)
                $tmpl_file = implode("", file($file));
 
@@ -646,7 +646,7 @@ function GET_LANGUAGE() {
        // Check GET variable and cookie
        if (!empty($lang)) {
                // Check if main language file does exist
-               if (file_exists(PATH."inc/language/".$lang.".php")) {
+               if (FILE_READABLE(PATH."inc/language/".$lang.".php")) {
                        // Okay found, so let's update cookies
                        SET_LANGUAGE($lang);
                }
@@ -853,13 +853,13 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") {
        }
 
        // Does the special template exists?
-       if ((!@file_exists($file)) || (!is_readable($file))) {
+       if (!FILE_READABLE($file)) {
                // Reset to default template
                $file = $BASE.$template.".tpl";
        } // END - if
 
        // Now does the final template exists?
-       if ((@file_exists($file)) && (is_readable($file))) {
+       if (FILE_READABLE($file)) {
                // The local file does exists so we load it. :)
                $tmpl_file = @implode("", @file($file));
                $tmpl_file = addslashes($tmpl_file);
@@ -1248,42 +1248,34 @@ function bigintval($num, $castValue = true) {
 // Insert the code in $img_code into jpeg or PNG image
 function GENERATE_IMAGE($img_code, $header=true) {
        global $_CONFIG;
-       if ((strlen($img_code) > 6) || (empty($img_code)) || ($_CONFIG['code_length'] == 0))
-       {
+
+       if ((strlen($img_code) > 6) || (empty($img_code)) || ($_CONFIG['code_length'] == 0)) {
                // Stop execution of function here because of over-sized code length
                return;
-       }
-        elseif (!$header)
-       {
+       } elseif (!$header) {
                // Return in an HTML code code
                return "<IMG src=\"".URL."/img.php?code=".$img_code."\">\n";
        }
 
-       switch ($_CONFIG['img_type'])
-       {
-       case "jpg":
-               // Loads JPEG image
-               $img = sprintf("%s/theme/%s/images/code_bg.jpg", PATH, GET_CURR_THEME());
-               if ((file_exists($img)) && (is_readable($img))) {
+       // Load image
+       $img = sprintf("%s/theme/%s/images/code_bg.%s", PATH, GET_CURR_THEME(), $_CONFIG['img_type']);
+       if (FILE_READABLE($img)) {
+               // Switch image type
+               switch ($_CONFIG['img_type'])
+               {
+               case "jpg":
                        // Okay, load image and hide all errors
                        $image = @imagecreatefromjpeg($img);
-               } else  {
-                       // Exit function here
-                       return;
-               }
-               break;
+                       break;
 
-       case "png":
-               // Loads PNG image
-               $img = sprintf("%s/theme/%s/images/code_bg.png", PATH, GET_CURR_THEME());
-               if ((file_exists($img)) && (is_readable($img))) {
+               case "png":
                        // Okay, load image and hide all errors
                        $image = @imagecreatefrompng($img);
-               } else {
-                       // Exit function here
-                       return;
+                       break;
                }
-               break;
+       } else {
+               // Exit function here
+               return;
        }
 
        // Generate text color (red/green/blue; 0 = dark, 255 = bright)
@@ -2434,6 +2426,11 @@ function HANDLE_EXTRA_VALUES ($filterFunction, $value, $extraValue) {
        // Return the value
        return $ret;
 }
+// Check if given FQFN is a readable file
+function FILE_READABLE($fqfn) {
+       // Check all...
+       return ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn)));
+}
 //
 //////////////////////////////////////////////////
 //                                              //
index 5f9fede..58b5635 100644 (file)
@@ -48,7 +48,7 @@ function install_WriteData ($file, $comment, $prefix, $suffix, $DATA, $sneak=0)
        $next = -1;
        $sneak++;
 
-       if ((file_exists($file)) && (is_readable($file))) {
+       if (FILE_READABLE($file)) {
                $search = "CFG: ".$comment;
                $tmp = $file.".tmp";
                $fp = @fopen($file, 'r') or OUTPUT_HTML("<STRONG>READ:</STRONG> ".$file."<br />");
@@ -342,12 +342,12 @@ if ((!isBooleanConstantAndTrue('mxchange_installed')) || (!isBooleanConstantAndT
                                $db = SQL_SELECT_DB($mysql['dbase'], $link, __FILE__, __LINE__);
                                if ($db) {
                                        // Automatically run install.sql
-                                       if ((file_exists($_POST['spath']."install/tables.sql")) && (file_exists($_POST['spath']."install/menu-".GET_LANGUAGE().".sql"))) {
+                                       if ((FILE_READABLE($_POST['spath']."install/tables.sql")) && (FILE_READABLE($_POST['spath']."install/menu-".GET_LANGUAGE().".sql"))) {
                                                // Both exists so import them
                                                foreach (array("tables.sql", "menu-".GET_LANGUAGE().".sql") as $dump) {
                                                        // Should be save here because file_exists() is there but we check it again. :)
                                                        $file = secureString($_POST['spath']) . "install/" . $dump;
-                                                       if ((file_exists($file)) && (is_readable($file))) {
+                                                       if (FILE_READABLE($file)) {
                                                                // Load the file
                                                                $sql = implode("", file($file));
 
index cd18027..93da8d9 100644 (file)
@@ -43,12 +43,12 @@ if (empty($mx_lang)) $mx_lang = DEFAULT_LANG;
 
 // Look for file
 $file = sprintf("%sinc/language/%s.php", PATH, $mx_lang);
-if ((!file_exists($file)) || (!is_readable($file))) {
+if (!FILE_READABLE($file)) {
        // Switch to default (DO NOT CHANGE!!!)
        set_session("mx_lang", "de");
        $mx_lang = "de";
-       $file = sprintf("%sinc/language/%s.php", PATH, $mx_lang);
-}
+       $file = sprintf("%sinc/language/%s.php", PATH, "de");
+} // END - if
 
 // Load language file
 require($file);
index 711dc59..1a7a5f1 100644 (file)
@@ -57,16 +57,15 @@ class mxchange_cache
                $this->cache_path=$path;
 
                // Check if path exists
-               if ((file_exists($path)) && (is_dir($path)) && (!$tested))
-               {
+               if ((is_dir($path)) && (!$tested)) {
                        // Check if we can create a file inside the path
                        @touch($path."dummy.tmp", 'w');
-                       if (file_exists($path."dummy.tmp")) {
+                       if (FILE_READABLE($path."dummy.tmp")) {
                                // Yes, we can do. So let's remove it
                                @unlink($path."dummy.tmp");
 
                                // Is there a .htaccess file?
-                               if (file_exists($path.".htaccess")) {
+                               if (FILE_READABLE($path.".htaccess")) {
                                        // Update database that we have tested it
                                        UPDATE_CONFIG("cache_tested", 1);
 
@@ -89,8 +88,7 @@ class mxchange_cache
                return "failed";
        }
 
-       function cache_file($file, $ignore_ctime=false)
-       {
+       function cache_file($file, $ignore_ctime=false) {
                global $INC;
                // Construct FQFN (full qualified file name)
                $inc = $this->cache_path.$file.".cache";
@@ -99,14 +97,11 @@ class mxchange_cache
                $this->cache_inc = $inc;
 
                // Check if file exists
-               $status = (file_exists($inc) && (is_readable($inc)) && (is_writeable($inc)));
-               if ($status)
-               {
+               $status = (FILE_READABLE($inc) && (is_writeable($inc)));
+               if ($status) {
                        // Yes, it does. So let's get it's last changed date/time
                        $ctime = filectime($inc);
-               }
-               else
-               {
+               } else {
                        // No, it doesn't. Zero date/time
                        $ctime = "0";
                }
@@ -115,21 +110,20 @@ class mxchange_cache
                $this->cache_ctime = $ctime;
 
                // Is the cache file outdated?
-               if (((time() - $ctime) >= $this->update_interval) && (!$ignore_ctime))
-               {
+               if (((time() - $ctime) >= $this->update_interval) && (!$ignore_ctime)) {
                        // Ok, we need an update!
                        $status = false;
                }
+
+               // Return status
                return $status;
        }
 
-       function cache_init($array)
-       {
+       function cache_init($array) {
                // This will destory an existing cache file!
-               if ($this->ret == "done")
-               {
+               if ($this->ret == "done") {
                        // Create file
-                       if (file_exists($this->cache_inc)) @chmod($this->cache_inc, 0666);
+                       if (FILE_READABLE($this->cache_inc)) @chmod($this->cache_inc, 0666);
                        $fp = @fopen($this->cache_inc, 'w') or mxchange_die("Cannot write to cache ".$this->cache_inc." !");
 
                        // Begin of cache file
@@ -137,9 +131,7 @@ class mxchange_cache
 
                        // Remember file pointer
                        $this->cache_pointer = $fp;
-               }
-               else
-               {
+               } else {
                        // Cannot create file
                        ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
                }
@@ -182,7 +174,7 @@ class mxchange_cache
                        @fclose($this->cache_pointer);
 
                        // Set rights
-                       if (file_exists($this->cache_inc)) @chmod($this->cache_inc, 0666);
+                       if (FILE_READABLE($this->cache_inc)) @chmod($this->cache_inc, 0666);
 
                        // Remove pointer
                        unset($this->cache_pointer);
@@ -196,8 +188,7 @@ class mxchange_cache
 
        function cache_load()
        {
-               if ((file_exists($this->cache_inc)) && (is_readable($this->cache_inc)))
-               {
+               if (FILE_READABLE($this->cache_inc)) {
                        // Prepare temporary array
                        $data = array();
 
@@ -223,11 +214,11 @@ class mxchange_cache
 
        function cache_destroy()
        {
-               if (file_exists($this->cache_inc))
+               if (FILE_READABLE($this->cache_inc))
                {
                        // Remove cache file from system
                        @unlink($this->cache_inc);
-                       if (!file_exists($this->cache_inc))
+                       if (!FILE_READABLE($this->cache_inc))
                        {
                                // Close cache automatically (we don't need it anymore!)
                                $this->cache_close();
@@ -248,7 +239,7 @@ class mxchange_cache
        function cache_remove($search, $data, $array)
        {
                global $ARRAY;
-               if ((file_exists($this->cache_inc)) && (is_writeable($this->cache_inc)))
+               if ((FILE_READABLE($this->cache_inc)) && (is_writeable($this->cache_inc)))
                {
                        // Load cache into dummy array
                        $dummy = $this->cache_load();
@@ -303,7 +294,7 @@ class mxchange_cache
        function cache_replace($search, $replace, $search_key, $array)
        {
                global $ARRAY;
-               if ((file_exists($this->cache_inc)) && (is_writeable($this->cache_inc)))
+               if ((FILE_READABLE($this->cache_inc)) && (is_writeable($this->cache_inc)))
                {
                        // Load cache into dummy array
                        $dummy = $this->cache_load();
index fb245f9..45f0eb4 100644 (file)
@@ -113,20 +113,20 @@ function get_template ($template, $return=false, $content="")
                $file2 = sprintf("%s%s%s_%s.tpl", $BASE, $MODE, $template, SQL_ESCAPE($_GET['what']));
 
                // Probe for it...
-               if ((file_exists($file2)) && (is_readable($file2))) $file = $file2;
+               if (FILE_READABLE($file2)) $file = $file2;
 
                // Remove variable from memory
                unset($file2);
        } // END - if
 
        // Does the special template exists?
-       if ((!file_exists($file)) || (!is_readable($file))) {
+       if (!FILE_READABLE($file)) {
                // Reset to default template
                $file = sprintf("%stemplates/%s/html/%s.tpl", PATH, GET_LANGUAGE(), $template);
        } // END - if
 
        // Now does the final template exists?
-       if ((file_exists($file)) && (is_readable($file))) {
+       if (FILE_READABLE($file)) {
                // The local file does exists so we load it. :)
                $tmpl_file = implode("", file($file));
                $tmpl_file = str_replace("'", '{QUOT}', $tmpl_file);
index 019eac7..7ee98e3 100644 (file)
@@ -423,7 +423,7 @@ function GENERATE_SPONSOR_CONTENT($what)
        global $HTTP_POST_VARS, $_GET, $CONFIG;
        $OUT = "";
        $FILE = sprintf("%sinc/modules/sponsor/%s.php", PATH, $what);
-       if ((file_exists($FILE)) && (is_readable($FILE))) {
+       if (FILE_READABLE($FILE)) {
                // Every sponsor action will output nothing directly. It will be written into $OUT!
                require_once($FILE);
        } else {
index 9ed4eb4..1b5d401 100644 (file)
@@ -46,7 +46,7 @@ $ADD = "";
 if ((!isBooleanConstantAndTrue('mxchange_installed')) || (isBooleanConstantAndTrue('mxchange_installing'))) return;
 
 // Load default sql_patches extension if present
-if (file_exists(PATH."inc/extensions/ext-sql_patches.php") && is_readable(PATH."inc/extensions/ext-sql_patches.php")) {
+if (FILE_READABLE(PATH."inc/extensions/ext-sql_patches.php")) {
        // Load it...
        $EXT_LOAD_MODE = "";
        require_once(PATH."inc/extensions/ext-sql_patches.php");
@@ -98,7 +98,7 @@ if ($cacheMode == "load") {
                // Load Language file
                if ($EXT_DUMMY['ext_lang'][$k] == "Y") {
                        $INC = sprintf("%sinc/language/%s_%s.php", PATH, $name, GET_LANGUAGE());
-                       if (file_exists($INC)) require_once($INC);
+                       if (FILE_READABLE($INC)) require_once($INC);
                } // END - if
 
                // Load CSS file
@@ -198,14 +198,14 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode ==
                $file3 = sprintf("%sinc/libs/%s_functions.php", PATH, $name);
 
                // Does the extension file exists?
-               if (file_exists($file1) && is_readable($file1)) {
+               if (FILE_READABLE($file1)) {
                        // If there's no language file specified we don't need to load one... ;-)
                        if (!empty($lang)) {
                                // Create language file
                                $file2 = sprintf("%sinc/language/%s_%s.php", PATH, $lang, GET_LANGUAGE());
                        }
 
-                       if (file_exists($file3) && is_readable($file3)) {
+                       if (FILE_READABLE($file3)) {
                                // Special functions file
                                $funcs = "Y";
                                require_once($file3);
@@ -215,7 +215,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode ==
                        }
 
                        // Do we need a language file?
-                       if (($file1 != $file2) && (file_exists($file2)) && (is_readable($file2))) {
+                       if (($file1 != $file2) && (FILE_READABLE($file2))) {
                                // Load language file
                                $lang = "Y";
                                include($file2);
@@ -235,7 +235,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode ==
 
                        if ($css == "Y") {
                                $CSS_FILE = sprintf("%stheme/%s/css/%s.css", PATH, GET_CURR_THEME(), $name);
-                               if (file_exists($CSS_FILE)) {
+                               if (FILE_READABLE($CSS_FILE)) {
                                        // CSS file for extension was found (use only relative path for now!)
                                        $EXT_CSS_FILES[] = $name.".css";
                                } else {
@@ -261,7 +261,7 @@ if ((SQL_NUMROWS($res_ext_crt) > 0) && (($cacheMode == "init") || ($cacheMode ==
                                // Remember this value for later usage
                                $cacheArray['active_extensions'][$name] = $EXT_ALWAYS_ACTIVE;
                        }
-               } elseif (!file_exists($file1)) {
+               } elseif (!FILE_READABLE($file1)) {
                        // Deleted extension file so we mark it for removal from DB
                        $DEL[] = $name;
                }
index a117d14..285e82e 100644 (file)
@@ -359,7 +359,7 @@ if (!isBooleanConstantAndTrue('admin_registered')) {
                        if (empty($_CONFIG['admin_menu'])) $_CONFIG['admin_menu'] = "OLD";
 
                        // Check for version and switch between old menu system and new "intelligent menu system"
-                       if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (file_exists(PATH."inc/modules/admin/la_sys-inc.php"))) {
+                       if ((ADMIN_CHECK_MENU_MODE() == "NEW") && (FILE_READABLE(PATH."inc/modules/admin/la_sys-inc.php"))) {
                                // Default area is the entrance, of course
                                $area = "entrance";
 
index 4f657c6..75268e3 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC)) {
+if (FILE_READABLE($INC)) { 
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index 9e4c6b2..95c4b72 100644 (file)
@@ -42,11 +42,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 16ca06e..7d20e40 100644 (file)
@@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index 7a1950c..8b70025 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index f4a7922..a08f335 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf(."%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index 1e28604..808abc2 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index f350201..056d423 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index 9111fbd..a7377d8 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) { 
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index e124559..9b5f8a3 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 95d0b1e..48222b8 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 20c8468..1ae0aae 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index da9c090..8d36f0b 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 8871db9..436253e 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 2d94ead..3ede03c 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC)) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index 243c179..fd4dc22 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 09eba7e..4ae98f8 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 7f28d82..f9b44e6 100644 (file)
@@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index fcb23d1..58b58b5 100644 (file)
@@ -42,11 +42,11 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if ((file_exists($INC)) && (is_readable($INC))) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
-       $FATAL[] = ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2;
+       ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
 //
 ?>
index 3cd3874..7422f6c 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index d4964c6..e322bef 100644 (file)
@@ -42,7 +42,7 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC)) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
 } else {
index 4c7691c..832c40a 100644 (file)
@@ -45,14 +45,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 8b702b0..527b612 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 1eae1b1..c832f82 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 1d53df9..01f87a7 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 5b91251..e528e04 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("admin", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/admin/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the admin action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(ADMIN_404_ACTION_1.$GLOBALS['what'].ADMIN_404_ACTION_2);
 }
+
 //
 ?>
index 43f531c..377cdfa 100644 (file)
@@ -194,7 +194,7 @@ function admin_WriteData ($file, $comment, $prefix, $suffix, $DATA, $seek=0) {
        $found = false;
 
        // Is the file there and read-/write-able?
-       if ((file_exists($file)) && (is_readable($file)) && (is_writeable($file))) {
+       if ((FILE_READABLE($file)) && (is_writeable($file))) {
                $search = "CFG: ".$comment;
                $tmp = $file.".tmp";
 
@@ -309,7 +309,7 @@ LIMIT 1", array($act, $wht, $wht), __FILE__, __LINE__);
 
                // Is valid but does the inlcude file exists?
                $INC = sprintf("%sinc/modules/admin/action-%s.php", PATH, $act);
-               if ((file_exists($INC)) && (is_readable($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && (__ACL_ALLOW == true))
+               if ((FILE_READABLE($INC)) && (VALIDATE_MENU_ACTION("admin", $act, $wht)) && (__ACL_ALLOW == true))
                {
                        // Ok, we finally load the admin action module
                        include($INC);
@@ -416,7 +416,7 @@ function ADD_ADMIN_MENU($act, $wht,$return=false)
                                                        // ACL is "allow"... hmmm
                                                        $ACL = true;
                                                }
-                                               $readable = ((file_exists($INC)) && (is_readable($INC)));
+                                               $readable = FILE_READABLE($INC);
                                                if ($ACL)
                                                {
                                                        // Insert compiled title and description
index fc3d280..9081221 100644 (file)
@@ -176,8 +176,8 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) {
                        if (!empty($MSG)) {
                                // Output message
                                LOAD_TEMPLATE("admin_settings_saved", false, $MSG);
-                       }
-               } elseif (file_exists(PATH."templates/".GET_LANGUAGE()."/html/admin/".$TPL.".tpl")) {
+                       } // END - if
+               } elseif (FILE_READABLE(sprintf("%stemplates/%s/html/admin/%s.tpl", PATH, GET_LANGUAGE(), $TPL))) {
                        // Create mailto link
                        define('__SPONSOR_VALUE', "<A href=\"mailto:".__EMAIL."\">".__SURNAME." ".__FAMILY."</A>");
 
index 80b0cd0..1930311 100644 (file)
@@ -369,7 +369,7 @@ case "search": // Search for new extensions on our server
                                if (empty($cver)) $cver = "-.-";
 
                                // Is the extension already installed or not?
-                               if (!file_exists($file) || ($ver != $cver))
+                               if (!FILE_READABLE($file) || ($ver != $cver))
                                {
                                        // No, it isn't. So let's add this one!
                                        $EXT_SEARCH['fname'][]  = $name;
index efffe46..55d0bb0 100644 (file)
@@ -46,7 +46,7 @@ if (!empty($_GET['access'])) {
        $target = sprintf("%slogs/%s", PATH, $access);
 
        // Is the file valid and readable?
-       if ((file_exists($target)) && (is_readable($target))) {
+       if (FILE_READABLE($target)) {
                // Load it directly
                $content = implode("", file($target));
 
diff --git a/inc/modules/admin/what-surfbar_stats.php b/inc/modules/admin/what-surfbar_stats.php
new file mode 100644 (file)
index 0000000..3bc8f9f
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+/************************************************************************
+ * MXChange v0.2.1                                    Start: 09/09/2008 *
+ * ================                             Last change: 09/09/2008 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-surfbar_stats.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Surfbar URL statistics                           *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : URL-Statistiken fuer die Surfbar                 *
+ * -------------------------------------------------------------------- *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * For more information visit: http://www.mxchange.org                  *
+ *                                                                      *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or    *
+ * (at your option) any later version.                                  *
+ *                                                                      *
+ * This program is distributed in the hope that it will be useful,      *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
+ * GNU General Public License for more details.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!is_admin())) {
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       require($INC);
+}
+
+// Add description as navigation point
+ADD_DESCR("admin", basename(__FILE__));
+
+//
+?>
index acef17b..f416bd3 100644 (file)
@@ -82,7 +82,7 @@ if (($response[sizeof($response) - 1] == "[EOF]") && ($response[0] != "[EOF]"))
                        if (empty($cver)) $cver = "-.-";
 
                        // Is the extension already installed or not?
-                       if (((SQL_NUMROWS($result) == 0) && (!file_exists($file))) || ($ver != $cver)) {
+                       if (((SQL_NUMROWS($result) == 0) && (!FILE_READABLE($file))) || ($ver != $cver)) {
                                // No, it isn't. So let's add this one!
                                $THEMES['fname'][]  = $name;
                                $THEMES['fsize'][]  = $response[$idx + 1];
index 775f6f4..ff47824 100644 (file)
@@ -53,7 +53,7 @@ if (!empty($_POST['theme']))
        {
                // Import theme
                $file = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($_POST['theme']));
-               if ((file_exists($file)) && (is_readable($file))) {
+               if (FILE_READABLE($file)) {
                        // Load the theme header file
                        include($file);
 
@@ -96,7 +96,7 @@ while ($dir = readdir($handle)) {
        $theme = sprintf("%stheme/%s/theme.php", PATH, $dir);
 
        // Test it...
-       if (($dir != ".") && ($dir != "..") && (file_exists($theme)) && (is_readable($theme))) {
+       if (($dir != ".") && ($dir != "..") && (FILE_READABLE($theme))) {
                // Found a valid directory so let's load it's theme.php file
                include($theme);
 
@@ -107,8 +107,10 @@ while ($dir = readdir($handle)) {
                $THEMES['theme_email'][]  = $THEME_EMAIL;
                $THEMES['theme_url'][]    = $THEME_URL;
                $THEMES['theme_ver'][]    = $THEME_VERSION;
-       }
-}
+       } // END - if
+} // END - while
+
+// Close directory
 closedir($handle);
 
 // Sort array by Uni* name
@@ -116,7 +118,7 @@ array_pk_sort($THEMES, array("theme_name"));
 
 // Generate output lines for the template
 $OUT = ""; $SW = 2;
-foreach ($THEMES['theme_unix'] as $key=>$unix) {
+foreach ($THEMES['theme_unix'] as $key => $unix) {
        // Check if current theme is already imported or not
        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' LIMIT 1",
         array($unix), __FILE__, __LINE__);
index 3a17999..4046acd 100644 (file)
@@ -53,7 +53,7 @@ if (!empty($_GET['image'])) {
                $file = sprintf("%s%s%s_usage_%s.png", PATH, $usage, SQL_ESCAPE($_GET['type']), SQL_ESCAPE($_GET['image']));
        }
 
-       if ((file_exists($file)) && (is_readable($file))) {
+       if (FILE_READABLE($file)) {
                $image = imagecreatefrompng($file);
                header("Content-type: image/png");
                imagepng($image);
@@ -61,7 +61,7 @@ if (!empty($_GET['image'])) {
        }
        exit();
 } elseif (empty($_GET['usage'])) {
-       $file = PATH.$usage."index.html";
+       $file = sprintf("%s%sindex.html", PATH, $usage);
 } else {
        $file = sprintf("%s%susage_%s.html",
                PATH,
@@ -71,7 +71,7 @@ if (!empty($_GET['image'])) {
 }
 
 if (!empty($file)) {
-       if (file_exists($file) && is_readable($file)) {
+       if (FILE_READABLE($file)) {
                        $tmpl_file = implode("", file($file));
                        $tmpl_file = addslashes($tmpl_file);
                        $tmpl_file = "\$content=\"".$tmpl_file."\";";
index 38264c4..2c6d438 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("guest", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf(PATH."inc/modules/guest/what-%s.php", $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the guest action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
 }
+
 //
 ?>
index fce845e..94dbca9 100644 (file)
@@ -38,19 +38,16 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
        require($INC);
 }
 
-if (GET_ACTION("guest", $GLOBALS['what']) == "admin")
-{
+if (GET_ACTION("guest", $GLOBALS['what']) == "admin") {
        // Only when one admin link is clicked...
        $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
-       if (file_exists($INC))
-       {
-            // Ok, we finally load the guest action module
+       if (FILE_READABLE($INC)) {
+               // Ok, we finally load the guest action module
                include($INC);
-       }
-        else
-       {
+       } else {
                ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
        }
-}
+} // END - if
+
 //
 ?>
index 0647588..4c89048 100644 (file)
@@ -45,18 +45,14 @@ ADD_DESCR("guest", basename(__FILE__));
 $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
 $IS_VALID = WHAT_IS_VALID(GET_ACTION("guest", $GLOBALS['what']), $GLOBALS['what'], "guest");
 
-if ((file_exists($INC)) && (is_readable($INC)) && ($IS_VALID))
-{
+if (FILE_READABLE($INC)) && ($IS_VALID)) {
        // Ok, we finally load the guest action module
        require_once($INC);
-}
- elseif ($IS_VALID)
-{
+} elseif ($IS_VALID) {
        ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
-}
- else
-{
+} else {
        ADD_FATAL(GUEST_LOCKED_ACTION);
 }
+
 //
 ?>
index 1b2c046..3a3b270 100644 (file)
@@ -43,14 +43,12 @@ ADD_DESCR("guest", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC))
-{
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the guest action module
        include($INC);
-}
- else
-{
+} else {
        ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
 }
+
 //
 ?>
index de40dbc..52d06df 100644 (file)
@@ -42,11 +42,12 @@ ADD_DESCR("guest", basename(__FILE__));
 
 // Load the include file
 $INC = sprintf("%sinc/modules/guest/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC)) {
+if (FILE_READABLE($INC)) {
        // Ok, we finally load the guest action module
        include($INC);
 } else {
-       $FATAL[] = GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2;
+       ADD_FATAL(GUEST_404_ACTION_1.$GLOBALS['what'].GUEST_404_ACTION_2);
 }
+
 //
 ?>
index e501964..366c6d1 100644 (file)
@@ -48,8 +48,7 @@ LOAD_TEMPLATE("guest_header");
 
 // Add message here
 if (!empty($_GET['msg'])) {
-       switch ($_GET['msg'])
-       {
+       switch ($_GET['msg']) {
                case CODE_LOGOUT_DONE      : $msg = LOGOUT_DONE; break;
                case CODE_LOGOUT_FAILED    : $msg = "<SPAN class=\"guest_failed\">".LOGOUT_FAILED."</SPAN>"; break;
                case CODE_DATA_INVALID     : $msg = MAIL_DATA_INVALID; break;
@@ -65,8 +64,10 @@ if (!empty($_GET['msg'])) {
                case CODE_LOGIN_FAILED     : $msg = LOGIN_FAILED_GENERAL; break;
                default                    : $msg = UNKNOWN_MAILID_CODE_1.$_GET['msg'].UNKNOWN_MAILID_CODE_2; break;
        }
+
+       // Load message template
        LOAD_TEMPLATE("message", false, $msg);
-}
+} // END - if
 
 // Some of you needs this to be extracted into a template... ???
 LOAD_TEMPLATE("guest_menu_td");
@@ -75,41 +76,33 @@ LOAD_TEMPLATE("guest_menu_td");
 if (empty($GLOBALS['what'])) $GLOBALS['what'] = $_CONFIG['index_home'];
 
 // Adding the main content module here
-if (empty($GLOBALS['action']))
-{
+if (empty($GLOBALS['action'])) {
        // Get action value from what value
        $act = GET_ACTION("guest", $GLOBALS['what']);
-}
- else
-{
+} else {
        // Get action value directly from URL
        $act = COMPILE_CODE($GLOBALS['action']);
 }
 
 // Add the guest's menu here...
-if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true)))
-{
+if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
        // Show only when guest menu is active
        ADD_MENU("guest", $act, $GLOBALS['what']);
-}
+} // END - if
 
 // TDs between menu and content
 LOAD_TEMPLATE("guest_menu_content");
 
 $INC_ACTION = sprintf("%sinc/modules/guest/action-%s.php", PATH, $act);
-if ((file_exists($INC_ACTION)) && (is_readable($INC_ACTION)) && (VALIDATE_MENU_ACTION("guest", $act, $GLOBALS['what'])))
-{
+if ((FILE_READABLE($INC_ACTION)) && (VALIDATE_MENU_ACTION("guest", $act, $GLOBALS['what']))) {
        // Requested module is available so we load it
        require_once($INC_ACTION);
-}
- else
-{
+} else {
        // Invalid module specified or not found...
        LOAD_URL("modules.php?module=index");
 }
 
-if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true)))
-{
+if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true))) {
        // TDs between content and </table>
        LOAD_TEMPLATE("guest_content_footer");
 
@@ -121,7 +114,7 @@ if (($_CONFIG['guest_menu'] == "Y") || (!EXT_IS_ACTIVE("sql_patches", true)))
 
        // Goto TOP template
        LOAD_TEMPLATE("guest_goto_top");
-}
+} // END - if
 
 // Footer template (Thanx to Mr. Glaus!)
 LOAD_TEMPLATE("guest_footer");
index 8c493c0..63871f1 100644 (file)
@@ -96,7 +96,7 @@ OUTPUT_HTML("   </TD>
   <TD valign=\"top\" align=\"center\" rowspan=\"3\" class=\"member_content\">");
 
 $INC_ACTION = sprintf("%sinc/modules/member/action-%s.php", PATH, $act);
-if ((file_exists($INC_ACTION)) && (is_readable($INC_ACTION)) && (VALIDATE_MENU_ACTION("member", GET_ACTION("member", $GLOBALS['what']), $GLOBALS['what']))) {
+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);
 } else {
index 456ce52..b164334 100644 (file)
@@ -47,7 +47,7 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT)) {
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
 } else {
index e7391a9..4fca9d9 100644 (file)
@@ -52,14 +52,12 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT))
-{
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
-}
- else
-{
+} else {
        ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
 }
+
 //
 ?>
index 4b01b03..b2a8a63 100644 (file)
@@ -52,14 +52,12 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT))
-{
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
-}
- else
-{
+} else {
        ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
 }
+
 //
 ?>
index 7cd95fa..4c5e8d6 100644 (file)
@@ -52,14 +52,12 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT))
-{
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
-}
- else
-{
+} else {
        ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
 }
+
 //
 ?>
index 1a35520..af6da02 100644 (file)
@@ -52,14 +52,12 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT))
-{
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
-}
- else
-{
+} else {
        ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
 }
+
 //
 ?>
index d3c82ec..816cac4 100644 (file)
@@ -52,14 +52,12 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT))
-{
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
-}
- else
-{
+} else {
        ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
 }
+
 //
 ?>
index 6c3cbfc..b2524b4 100644 (file)
@@ -52,14 +52,12 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT))
-{
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
-}
- else
-{
+} else {
        ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
 }
+
 //
 ?>
index 4733d9c..4f9ffd1 100644 (file)
@@ -52,14 +52,12 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT))
-{
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
-}
- else
-{
+} else {
        ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
 }
+
 //
 ?>
index ac10d88..8d731fa 100644 (file)
@@ -52,14 +52,12 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT))
-{
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
-}
- else
-{
+} else {
        ADD_FATAL(MEMBER_404_ACTION_1.$GLOBALS['what'].MEMBER_404_ACTION_2);
 }
+
 //
 ?>
index 27fc07b..3a8201d 100644 (file)
@@ -47,7 +47,7 @@ ADD_DESCR("member", basename(__FILE__));
 
 // Load the include file
 $INC_WHAT = sprintf("%sinc/modules/member/what-%s.php", PATH, $GLOBALS['what']);
-if (file_exists($INC_WHAT)) {
+if (FILE_READABLE($INC_WHAT)) {
        // Ok, we finally load the member action module
        include_once($INC_WHAT);
 } else {
index 0715a59..e9dcc54 100644 (file)
@@ -105,9 +105,7 @@ if (SQL_NUMROWS($result) > 0)
                                }
                        }
                        $size = strlen($file);
-               }
-                elseif (file_exists($test))
-               {
+               } elseif (FILE_READABLE($test)) {
                        $size = filesize($test);
                }
                if ($size > 0) $alt .= " (".TRANSLATE_COMMA(round($size/102.4)/10)." ".KBYTES.")";
index e52b8da..9731f71 100644 (file)
@@ -73,8 +73,7 @@ $THEMES = array(
 
 // Read directory "themes"
 $handle = opendir(PATH."theme/") or mxchange_die("Cannot read themes dir!");
-while ($dir = readdir($handle))
-{
+while ($dir = readdir($handle)) {
        // Construct absolute theme.php file name
        $theme = sprintf("%stheme/%s/theme.php", PATH, $dir);
 
@@ -82,7 +81,7 @@ while ($dir = readdir($handle))
        $result = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_themes WHERE theme_path='%s' AND theme_active='Y' LIMIT 1",
         array($dir), __FILE__, __LINE__);
 
-       if (($dir != ".") && ($dir != "..") && (file_exists($theme)) && (is_readable($theme)) && (SQL_NUMROWS($result) == 1)) {
+       if (($dir != ".") && ($dir != "..") && (FILE_READABLE($theme)) && (SQL_NUMROWS($result) == 1)) {
                // Free memory
                SQL_FREERESULT($result);
 
@@ -96,8 +95,10 @@ while ($dir = readdir($handle))
                $THEMES['theme_email'][]  = $THEME_EMAIL;
                $THEMES['theme_url'][]    = $THEME_URL;
                $THEMES['theme_ver'][]    = $THEME_VERSION;
-       }
-}
+       } // END - if
+} // END - while
+
+// Close directory
 closedir($handle);
 
 // Sort array by Uni* name
index 7a32580..27cf4dc 100644 (file)
@@ -35,11 +35,11 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
        require($INC);
 } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
-       $FATAL[] = EXTENSION_PROBLEM_EXT_INACTIVE;
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
-       $FATAL[] = SPONSOR_ONLY_AREA_ENTERED;
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
        return;
 } elseif (empty($GLOBALS['what'])) {
        // Empty what value detected!
index 026ba6e..eeb6fe4 100644 (file)
@@ -35,11 +35,11 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
        require($INC);
 } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
-       $FATAL[] = EXTENSION_PROBLEM_EXT_INACTIVE;
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
-       $FATAL[] = SPONSOR_ONLY_AREA_ENTERED;
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
        return;
 }
 
index 9212ace..ec754c9 100644 (file)
@@ -35,11 +35,11 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
        require($INC);
 } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
-       $FATAL[] = EXTENSION_PROBLEM_EXT_INACTIVE;
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
-       $FATAL[] = SPONSOR_ONLY_AREA_ENTERED;
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
        return;
 }
 
index f9130ba..c8e7c4b 100644 (file)
@@ -35,11 +35,11 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
        require($INC);
 } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
-       $FATAL[] = EXTENSION_PROBLEM_EXT_INACTIVE;
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
-       $FATAL[] = SPONSOR_ONLY_AREA_ENTERED;
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
        return;
 }
 
index bc67c1d..e120cc2 100644 (file)
@@ -35,11 +35,11 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
        require($INC);
 } elseif ((!EXT_IS_ACTIVE("sponsor")) && (!IS_ADMIN())) {
-       $FATAL[] = EXTENSION_PROBLEM_EXT_INACTIVE;
+       ADD_FATAL(EXTENSION_PROBLEM_EXT_INACTIVE);
        return;
 } elseif (!IS_SPONSOR()) {
        // No sponsor!
-       $FATAL[] = SPONSOR_ONLY_AREA_ENTERED;
+       ADD_FATAL(SPONSOR_ONLY_AREA_ENTERED);
        return;
 }
 
index d3a9576..e7d9ade 100644 (file)
@@ -148,8 +148,8 @@ function CHECK_MODULE($mod) {
 
        // Still no luck or not found?
        if (($ret == "major") || ($ret == "cache_miss") || (!$found)) {
-               //         ----- Legacy module -----                      ---- Module in base folder  ----           --- Module with extension's name ---
-               if ((file_exists(PATH."inc/modules/".$mod.".php")) || (file_exists(PATH.$mod.".php")) || (file_exists(PATH.$extension."/".$mod.".php"))) {
+               //              ----- 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)))) {
                        // 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
@@ -168,13 +168,13 @@ function CHECK_MODULE($mod) {
                        if (SQL_AFFECTEDROWS() == 0) {
                                // Something bad happend!
                                return "major";
-                       }
+                       } // END - if
 
                        // Destroy cache here
                        if (GET_EXT_VERSION("cache") >= "0.1.2") {
                                if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
                                unset($cacheArray['modules']);
-                       }
+                       } // END - if
 
                        // And reload data
                        $ret = CHECK_MODULE($mod_chk);
@@ -182,7 +182,7 @@ function CHECK_MODULE($mod) {
                        // Module not found we don't add it to the database
                        $ret = "404";
                }
-       }
+       } // END - if
 
        // Return the value
        return $ret;
@@ -330,7 +330,7 @@ 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_exists($test_inc) && is_readable($test_inc));
+                                       $test = (FILE_READABLE($test_inc));
                                        if ($test) {
                                                if ((!empty($wht)) && (($wht == $sub_what))) {
                                                        $content = "<STRONG>";
@@ -365,7 +365,7 @@ function ADD_MENU($MODE, $act, $wht) {
                                // This is a menu block... ;-)
                                $BLOCK_MODE = true;
                                $INC_BLOCK = sprintf("%sinc/modules/%s/action-%s.php", PATH, $MODE, $main_action);
-                               if ((file_exists($INC_BLOCK)) && (is_readable($INC_BLOCK))) {
+                               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\">");
@@ -1713,7 +1713,7 @@ function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) {
                );
 
                // Load text for task
-               if ((file_exists($tpl)) && (is_readable($tpl))) {
+               if (FILE_READABLE($tpl)) {
                        // Load extension's own text template (HTML!)
                        $msg = LOAD_TEMPLATE("ext_".$ext, true);
                } else {
index 1757242..497339b 100644 (file)
@@ -75,7 +75,7 @@ if (($CSS == "1") || ($_CONFIG['css_php'] == "DIRECT"))
                $file = $BASE.$value;
 
                // Do include only existing files and whose are not empty
-               if ((file_exists($file)) && (filesize($file) > 0)) {
+               if ((FILE_READABLE($file)) && (filesize($file) > 0)) {
                        switch ($_CONFIG['css_php']) {
                                case "DIRECT":
                                        OUTPUT_HTML("<link rel=\"stylesheet\" type=\"text/css\" href=\"".URL."/".$BASE."\" />");
index d03bbfa..0ee3796 100644 (file)
@@ -69,10 +69,10 @@ function GET_CURR_THEME() {
                $theme = sprintf("%stheme/%s/theme.php", PATH, $_GET['theme']);
 
                // Installation mode active
-               if ((!empty($_GET['theme'])) && (file_exists($theme)) && (is_readable($theme))) {
+               if ((!empty($_GET['theme'])) && (FILE_READABLE($theme))) {
                        // Set cookie from URL data
                        set_session("mxchange_theme", $_GET['theme']);
-               } elseif (file_exists(PATH."theme/".$_POST['theme']."/theme.php")) {
+               } elseif (FILE_READABLE(PATH."theme/".$_POST['theme']."/theme.php")) {
                        // Set cookie from posted data
                        set_session("mxchange_theme", $_POST['theme']);
                }
@@ -88,7 +88,7 @@ function GET_CURR_THEME() {
        $theme = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($ret));
 
        // Try to load the requested include file
-       if ((@file_exists($theme)) && (is_readable($theme))) $INC_POOL[] = $theme;
+       if (FILE_READABLE($theme)) $INC_POOL[] = $theme;
 
        // Return theme value
        return $ret;
@@ -112,7 +112,7 @@ function THEME_SELECTION_BOX($mod, $act, $wht, $result) {
        while(list($theme) = SQL_FETCHROW($result)) {
                // Load it's theme.php file
                $INC = sprintf("%stheme/%s/theme.php", PATH, SQL_ESCAPE($theme));
-               if ((file_exists($INC)) && (is_readable($INC))) {
+               if (FILE_READABLE($INC)) {
                        // And save all data in array
                        require($INC);
                        $THEMES['theme_unix'][] = $theme;
index 5850e44..f4e8cba 100644 (file)
@@ -101,7 +101,7 @@ if ((!empty($_CONFIG['maintenance'])) && ($_CONFIG['maintenance'] == "Y") && (!I
                define('__MODULE', sprintf("%sinc/modules/%s.php", PATH, $GLOBALS['module']));
 
                // Does the module exists on local file system?
-               if (((file_exists(__MODULE)) && (is_readable(__MODULE))) && (sizeof($FATAL) == 0)) {
+               if ((FILE_READABLE(__MODULE)) && (sizeof($FATAL) == 0)) {
                        // Module is valid, active and located on the local disc...
                        $MOD_VALID = true;
                } elseif (!empty($URL)) {
@@ -117,7 +117,7 @@ if ((!empty($_CONFIG['maintenance'])) && ($_CONFIG['maintenance'] == "Y") && (!I
                break;
 
        case "locked":
-               if (!file_exists(PATH."inc/modules/".$GLOBALS['module'].".php"))
+               if (!FILE_READABLE(PATH."inc/modules/".$GLOBALS['module'].".php"))
                {
                        // Module does addionally not exists
                        ADD_FATAL(LANG_MOD_REG_404_1.$GLOBALS['module'].LANG_MOD_REG_404_2);