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
$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);
$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;
// 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))) {
// 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
(
$active == "Y"
) && (
- file_exists($inc)
- ) && (
- is_readable($inc)
+ FILE_READABLE($inc)
)
);
}
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";
}
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']);
`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,
$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 ä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 ändern und vieles mehr.',7)";
$SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','add_surfbar_url','URL hinzufügen','Fü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ü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 ändern, wie Festvergütung, prozentuale Ref-Vergü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ählten URL anzeigen.',5)";
// Load CSS?
$EXT_CSS = "Y";
$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
);
// 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));
// 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);
}
}
// 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);
// 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)
// 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)));
+}
//
//////////////////////////////////////////////////
// //
$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 />");
$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));
// 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);
$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);
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";
$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";
}
$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
// Remember file pointer
$this->cache_pointer = $fp;
- }
- else
- {
+ } else {
// Cannot create file
ADD_FATAL(__FILE__."(".__LINE__."): ".CACHE_PROBLEMS_DETECTED);
}
@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);
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();
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();
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();
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();
$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);
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 {
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");
// 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
$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);
}
// 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);
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 {
// 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;
}
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";
// 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 {
// 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);
}
+
//
?>
// 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 {
// 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 {
// 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 {
// 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 {
// 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 {
// 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 {
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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 {
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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 {
// 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);
}
//
?>
// 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);
}
+
//
?>
// 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 {
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
$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";
// 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);
// ACL is "allow"... hmmm
$ACL = true;
}
- $readable = ((file_exists($INC)) && (is_readable($INC)));
+ $readable = FILE_READABLE($INC);
if ($ACL)
{
// Insert compiled title and description
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>");
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;
$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));
--- /dev/null
+<?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__));
+
+//
+?>
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];
{
// 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);
$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);
$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
// 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__);
$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);
}
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,
}
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."\";";
// 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);
}
+
//
?>
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
+
//
?>
$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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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;
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");
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");
// Goto TOP template
LOAD_TEMPLATE("guest_goto_top");
-}
+} // END - if
// Footer template (Thanx to Mr. Glaus!)
LOAD_TEMPLATE("guest_footer");
<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 {
// 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 {
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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);
}
+
//
?>
// 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 {
}
}
$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.")";
// 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);
$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);
$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
$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!
$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;
}
$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;
}
$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;
}
$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;
}
// 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
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);
// Module not found we don't add it to the database
$ret = "404";
}
- }
+ } // END - if
// Return the value
return $ret;
// 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>";
// 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\">");
);
// 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 {
$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."\" />");
$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']);
}
$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;
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;
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)) {
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);