]> git.mxchange.org Git - mailer.git/commitdiff
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 0c0dfd6c4c5e9eea317b7032b42cd29e48906a29..f6de7bda740b861f7791067f60e59e7954ab30cf 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 17dbf7d6d4aaf5c3e1a97527f880e2786c57eba1..1250799913ba3902275615a04a0d515430a4b3b7 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 b332e0d9b91e1a8cd72fd312677939b0e335fa81..958fc7a7de7244d98cff3ea0d23492eac3247fdb 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 1ffc7492ebdc41e037593636093125eaeac8443c..4550e539acae0077752afe536d0288fb77b436ff 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 0bfa73075cb3eb8c3ec2584602d62f597008d900..bfe60aa6e7b6439b30ec62198d4ea384d710b102 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 5f9fede1c27f7ed416f8fda48a8aad31897120b3..58b56350cd7e3ba7d5a728e4e4be02aa01ed8b23 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 cd180277835b814b2d8fecd1f2ce7707383b2851..93da8d9ca92143f3f3e1a7a7d86ef9a2b4b8a279 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 711dc5955401120849bdca078293477bcb5edcff..1a7a5f14e59515f3838dee68e6d7fecd9abd5bd4 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 fb245f9b709f25f690c10aeac7bed389c4f4690c..45f0eb40699784ab28511bad144b5ec37e057506 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 019eac79ff0ca47acd623e1fdd47d6905a4aebd1..7ee98e31188eac9c50d7f94b95006bdeed4f4741 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 9ed4eb42fab97710d8988d397ef2eaccdcb0b1ec..1b5d401cbc09cca8d4885d6dd10bd397420d763c 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 a117d14b8970864db74e0f9614b4f0a2520fa90e..285e82eabb83a4b377cd647ef2a8e7e9ce411b54 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 4f657c694043d011966dec2ebe001307d143390c..75268e3a1b0f099b011b51b5e58fcac1ee91aba7 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 9e4c6b28ee5b2db910b592cef6e49ff49444f71f..95c4b724b20b809226e18b3c21f63c1a0460ffd2 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 16ca06e12121a7159beb3b105db9f7260585e66d..7d20e4039bc797130cfae6bd5f19f41e673812b7 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 7a1950c4d8bd0487c55e2cc7aab90aca92f3c05c..8b70025d5393b2cfafd7ee7aaf0b261324d99581 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 f4a7922f36f947961a45702e14bf15c9e28bab82..a08f335778dd3c0eb7b56a47751593fd889d3efb 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 1e28604ed305a843634e2b4f982f5c9bf3be2841..808abc2d70b62e71876dd2e58d27f9eda2e4aa65 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 f350201a79552ecbef74bd9317c9c697e74fd6b7..056d42358304bc1a712e3146c30cd0f810112907 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 9111fbd95ea03c088543a04e011def008e385eb3..a7377d80fa4e554f356bcdb2ee9baf7996666bb8 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 e1245595d9952a9a08fe1f8e70a9e83cf0bc5476..9b5f8a35c42590b6312a1a6235c5b770338bf59a 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 95d0b1e5890acfbf8d6a58d563070b5b4875275b..48222b8e639b3e56459b1b6c90df056f081dffa7 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 20c846844a3f4b0142919a60798a113a4a431b74..1ae0aae9ffa786fb31c846a969041e7642cfc4c0 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 da9c090b6167f4ee430d691998156db9decf91b9..8d36f0b9115c2b1403d324ceaa6373e793f8b708 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 8871db900d75b8d6ad2c8c50914cbd8d993256e1..436253e508974e1ecf23d10a2da981522b194651 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 2d94eade214d733be8c68bd07d762a350522d9a7..3ede03c63e93d0934159bf9c4bf4c9b26a3ce9ea 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 243c179b4fee29688443cea496adfdbf6b8e6faf..fd4dc22f313dc3f33594a82774579ec74e8f2fe6 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 09eba7ec2e458667e24731dfe3860bbbb67993f0..4ae98f8af4d9dcc3c4fbbdeace17ba0f82578d29 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 7f28d820d7c9c3afd673749813c848042dc94075..f9b44e6b0b8ca84674c202f61a58ac47b8abcdd5 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 fcb23d131ddae7cb6562886c117b9fd9e6f6fb1e..58b58b5edf48e5bfb1d38c2c4faf2ef5a3c2a456 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 3cd387404bff342d4864d923fdf7d88cb87d024d..7422f6c61302bbd4a66b2de491ffc4fcdbef4eac 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 d4964c6321e500dc612a9dbc20a6d9dacd269a69..e322bef5d23f0c5f32a62c0306867b7a08f0ff55 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 4c7691cd5c899a26e3e010deddf27d10b5f809ba..832c40a582523e0afc844e00a553c1122a4d7a9b 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 8b702b0aef2034eaac32eaf1dc6c07475cc7d4d7..527b6126fea34400092cb41e54bb1f6ec8e6dcf8 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 1eae1b12c25b2ab50769a22c6293062611d64a8b..c832f82dabab2d2fb427342a9893ac9aef70e2b5 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 1d53df9a1367701b74c1b3a4691519d4f39eb71d..01f87a7aee62f98e60cf69e55b8fc9b7767dae4c 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 5b912516790ce758570fb96b13f08b6e11c30e41..e528e044b25b3138b41f21220ab5d77a3f13331a 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 43f531ceeeeefbbe451515d5b16290a350364f45..377cdfab91be1ca2d7b26bded6c8ebf96a0d0ddd 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 fc3d280ea6744c6d615cd08e010b42ff671383ea..9081221758cf789938acd5872cacf61924cd689f 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 80b0cd03e751d0a4983f70293f35e79cd7db1eea..1930311d39beb6f4eba05806380b71021dd4a631 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 efffe465da0aa292b4742f59af0f252d2f93ea31..55d0bb06e3b86ade13f0859120acbc1d3f5c7e94 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 acef17b946a8c423c421a6a1943709ea726bdcb7..f416bd31155a81acd6609ad02928da995e25ee13 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 775f6f493f5b6f48ed51af0fce29b9639601ea4d..ff47824ed7dd058923744ca6658ca384d3c1e733 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 3a17999e65bc0739a9662c7de7c5932bfa72b955..4046acd7536c21c8906698aacfb45142eacb307f 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 38264c411fcd9e63a62f675fb9f7dcb62b788e02..2c6d438a15e02441c96ec9c7657bfffa226f69e7 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 fce845e27a91c876aad076d7484bbe42b628d54a..94dbca97ce17a953a800f670596fe5d41edae7e2 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 0647588b143cc90a8e5acb0b8d246e2f683c9ad5..4c89048ccd56657555c6dd83e3050343d15bb011 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 1b2c0460a231a2e5700537edb0e44bcb1f6e4188..3a3b270e6e9a7032cd3fc03bc7687d6b47f8711a 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 de40dbc7152aea6df5e38695bf1a0d4aba5773db..52d06df863f9e511dc9f31acbfefecff621199ad 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 e5019640be8c23f2fcc7cc2f82c26aa3443ab687..366c6d16c7db47a46d1b6802ab9ebcc8fe9828e0 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 8c493c055b609584b2671f0577304151d51bab26..63871f1ecdab71bffb6f51eee62bd24863ea6d4e 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 456ce52d264cbd5a331f5c609bdb52b06854c604..b16433423eda2ac2440f9f6aa12d9276934bed05 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 e7391a9cf037d0ade21b545e72bec908f8ceaa61..4fca9d942d201ecb7a189a078e5500eb55e49666 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 4b01b03a09248676b948a5ed73e1267c1c1b273a..b2a8a635090704b96f0ea732f899973df07a89b9 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 7cd95faabd5c686285da3c2481aa0e15cdc3f6ae..4c5e8d6e4fccfb140f33aa1a9d1834714e506dce 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 1a35520733d02f9759a1e9ae09e7fa6e7e7fc2bd..af6da02380515d0966d3e725dadf6cf74c82b603 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 d3c82ec007650b0d8c30019a3f415c62c5c00403..816cac49c55c6c058dde6010618bf97653eb9687 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 6c3cbfcb9b7ed07927494b42e4bb7df9d6bb26a2..b2524b4ba6c16e7ced882d6200b282f7ad23ebaf 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 4733d9c3265f8ca02931b06af967b54111d0593b..4f9ffd18b1d95073ab402c1ab39b536cb8cdaabb 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 ac10d889d0525403f542b119554bc48e34d3a7b1..8d731faf70975dc8b87d71a5f8bd0178228c243f 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 27fc07b6f7626d1d85522f6d460d27a67ac2021f..3a8201d9505056fd2180e948d9faa7adeb98eaef 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 0715a595b78525261b3ae96e2c2d2c4059fe06cf..e9dcc54c19449ec91ad1230bd1c5283b911a6c9f 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 e52b8da18960b47bba63682fbd9243c18d0a2c92..9731f71f5d56a6bf97e19612faed6fc3b523cfc3 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 7a3258071bf1c7f27268c44928919b5a65c86e7a..27cf4dc6dba2f634a9917185d2c8723309d43355 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 026ba6e9e0906173bfe832b1e2cdf9e0c1265efe..eeb6fe4494e2d3b26974b4f0b803be7b88106b54 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 9212ace1e41f7bbdaa45d26ce48ab9bcff911617..ec754c98e1c08c6dd5f2529eb0557fbfc0982f30 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 f9130baf9357754eb6a9aedf2ddfec05ad634539..c8e7c4b4b73cf34d21d1d1c0c7bc31f1b64f86ad 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 bc67c1dedbbf067762751ab065edec7a808cce62..e120cc286405349b7626aa34a70e740fa3481b8f 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 d3a95764bcf77dd162d25ba37e56b149c9d1ffe7..e7d9adeccac4ac36ac963462518fc9dbf8ee4e7e 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 17572429a25e349180352895c422a46b8ac4a8b3..497339beb8f04e02050180306449f824268e4989 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 d03bbfa7c265e422b21482cb431be4ecf17f9b60..0ee37962e4c86e77643b4776632f04970bf243ed 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 5850e441720b2acc798e9fc2345df95222e01025..f4e8cbacfbbea1e21ca627b0a314841b812060c5 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);