From 3a60615e36f60612523966daf585ebe308a4f5cc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 29 Jul 2009 21:56:28 +0000 Subject: [PATCH 1/1] Several double->single convertions, fix for missing constant '_MYSQL_PREFIX' which is no longer a constant, extension .cache added to rdf.class.php --- inc/functions.php | 5 +- inc/modules/admin/what-config_cache.php | 51 ++++++++++--------- inc/modules/guest/what-wernis_portal.php | 21 ++++---- inc/rdf.class.php | 4 +- .../de/html/admin/admin_config_cache.tpl | 8 +-- 5 files changed, 46 insertions(+), 43 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 10b4d02d32..ea7a4297b0 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -120,6 +120,9 @@ function OUTPUT_HTML ($HTML, $newLine = true) { // Compile and run finished rendered HTML code while (strpos($OUTPUT, '{!') > 0) { + // Replace _MYSQL_PREFIX + $OUTPUT = str_replace("{!_MYSQL_PREFIX!}", getConfig('_MYSQL_PREFIX'), $OUTPUT); + // Prepare the content and eval() it... $newContent = ''; $eval = "\$newContent = \"".COMPILE_CODE(smartAddSlashes($OUTPUT))."\";"; @@ -128,7 +131,7 @@ function OUTPUT_HTML ($HTML, $newLine = true) { // Was that eval okay? if (empty($newContent)) { // Something went wrong! - app_die(__FUNCTION__, __LINE__, "Evaluation error:
".htmlentities($eval)."
"); + app_die(__FUNCTION__, __LINE__, 'Evaluation error:
' . htmlentities($eval) . '
'); } // END - if $OUTPUT = $newContent; } // END - while diff --git a/inc/modules/admin/what-config_cache.php b/inc/modules/admin/what-config_cache.php index 59a6723c89..59ac1df1d0 100644 --- a/inc/modules/admin/what-config_cache.php +++ b/inc/modules/admin/what-config_cache.php @@ -40,7 +40,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); -} +} // END - if // Add description as navigation point ADD_DESCR('admin', __FILE__); @@ -53,40 +53,41 @@ if (isFormSent()) { if (REQUEST_POST('cache_path') != getConfig('cache_path')) { // Okay, cache path has been altered so we have to test it again! REQUEST_SET_POST('cache_tested', 'Y'); - } + } // END - if if ((REQUEST_POST('cache_admins') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('admins'))) { $GLOBALS['cache_instance']->destroyCacheFile(); - } + } // END - if - if ((REQUEST_POST('cache_acls') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile("acls"))) { + if ((REQUEST_POST('cache_acls') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('acls'))) { $GLOBALS['cache_instance']->destroyCacheFile(); - } + } // END - if - if ((REQUEST_POST('cache_exts') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile("extensions", true))) { + if ((REQUEST_POST('cache_exts') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('extensions', true))) { $GLOBALS['cache_instance']->destroyCacheFile(); - } + } // END - if - if ((REQUEST_POST('cache_config') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile("config"))) { + if ((REQUEST_POST('cache_config') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('config'))) { $GLOBALS['cache_instance']->destroyCacheFile(); - } + } // END - if - if ((REQUEST_POST('cache_modreg') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile("modreg"))) { + if ((REQUEST_POST('cache_modreg') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('modreg'))) { $GLOBALS['cache_instance']->destroyCacheFile(); - } + } // END - if - if ((REQUEST_POST('cache_refdepth') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile("refdepth"))) { + if ((REQUEST_POST('cache_refdepth') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('refdepth'))) { $GLOBALS['cache_instance']->destroyCacheFile(); - } + } // END - if - if ((REQUEST_POST('cache_refsys') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile("refsys"))) { + if ((REQUEST_POST('cache_refsys') == 'N') && ($GLOBALS['cache_instance']->loadCacheFile('refsys'))) { $GLOBALS['cache_instance']->destroyCacheFile(); - } + } // END - if // Save configuration ADMIN_SAVE_SETTINGS_POST(); } else { // Prepare data + // @TODO Rewrite all constants switch (getConfig('cache_admins')) { case 'Y': define('__ADMINS_Y', ' checked="checked"'); @@ -97,7 +98,7 @@ if (isFormSent()) { define('__ADMINS_Y', ''); define('__ADMINS_N', ' checked="checked"'); break; - } + } // END - switch switch (getConfig('cache_acls')) { case 'Y': @@ -109,7 +110,7 @@ if (isFormSent()) { define('__ACLS_Y', ''); define('__ACLS_N', ' checked="checked"'); break; - } + } // END - switch switch (getConfig('cache_exts')) { case 'Y': @@ -121,7 +122,7 @@ if (isFormSent()) { define('__EXTS_Y', ''); define('__EXTS_N', ' checked="checked"'); break; - } + } // END - switch switch (getConfig('cache_config')) { case 'Y': @@ -133,7 +134,7 @@ if (isFormSent()) { define('__CONFIG_Y', ''); define('__CONFIG_N', ' checked="checked"'); break; - } + } // END - switch switch (getConfig('cache_modreg')) { case 'Y': @@ -145,7 +146,7 @@ if (isFormSent()) { define('__MODREG_Y', ''); define('__MODREG_N', ' checked="checked"'); break; - } + } // END - switch switch (getConfig('cache_refdepth')) { case 'Y': @@ -157,7 +158,7 @@ if (isFormSent()) { define('__REFDEPTH_Y', ''); define('__REFDEPTH_N', ' checked="checked"'); break; - } + } // END - switch switch (getConfig('cache_refsys')) { case 'Y': @@ -169,7 +170,7 @@ if (isFormSent()) { define('__REFSYS_Y', ''); define('__REFSYS_N', ' checked="checked"'); break; - } + } // END - switch switch (getConfig('cache_themes')) { case 'Y': @@ -181,7 +182,7 @@ if (isFormSent()) { define('__THEMES_Y', ''); define('__THEMES_N', ' checked="checked"'); break; - } + } // END - switch switch (getConfig('cache_admin_menu')) { case 'Y': @@ -193,12 +194,12 @@ if (isFormSent()) { define('__ADMIN_MENU_Y', ''); define('__ADMIN_MENU_N', ' checked="checked"'); break; - } + } // END - switch define('__PATH', getConfig('cache_path')); // Load template - LOAD_TEMPLATE("admin_config_cache"); + LOAD_TEMPLATE('admin_config_cache'); } // diff --git a/inc/modules/guest/what-wernis_portal.php b/inc/modules/guest/what-wernis_portal.php index 9b131e71ab..567fe1a2b6 100644 --- a/inc/modules/guest/what-wernis_portal.php +++ b/inc/modules/guest/what-wernis_portal.php @@ -51,19 +51,19 @@ loadIncludeOnce('inc/rdf.class.php'); // Add description as navigation point ADD_DESCR('guest', __FILE__); -OUTPUT_HTML("
"); +OUTPUT_HTML('
'); $rdf = new fase4_rdf(); $rdf->use_dynamic_display(false); -$rdf->set_CacheDir(constant('PATH')."inc/cache/"); +$rdf->set_CacheDir(constant('PATH') . 'inc/cache/'); $rdf->set_salt(md5(getConfig('SITE_KEY'))); $rdf->set_max_item(10); $rdf->set_Options( -array( - 'textinput' => "hidden", - 'sitelink' => "http://www.wds66.com", + array( + 'textinput' => 'hidden', + 'sitelink' => 'http://www.wds66.com', 'refid' => getConfig('wernis_refid'), - 'reflink' => "/ref.php?refid=", -) + 'reflink' => '/ref.php?refid=', + ) ); // Use proxy? @@ -78,12 +78,11 @@ if ((getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0)) { } // END - if } // END - if -$rdf->parse_RDF("http://www.wds66.com/rss.xml"); +$rdf->parse_RDF('http://www.wds66.com/rss.xml'); -// Fix to avoid "headers already sent" bug. Thanks to Profi-Concept +// Fix to avoid 'headers already sent' bug. Thanks to Profi-Concept OUTPUT_HTML($rdf->finish(true)); -// @TODO Can this be removed? $rdf->clear_cache(); -OUTPUT_HTML("
"); +OUTPUT_HTML('
'); // ?> diff --git a/inc/rdf.class.php b/inc/rdf.class.php index 17b8050bbe..33d82dbc67 100644 --- a/inc/rdf.class.php +++ b/inc/rdf.class.php @@ -1000,10 +1000,10 @@ class fase4_rdf { $this->_create_cache_dir(); } if($this->_use_dynamic_display == true) { - $this->_cached_file = md5("dynamic".$this->salt.$this->_remote_file); + $this->_cached_file = md5("dynamic".$this->salt.$this->_remote_file) . '.cache'; $this->_cache_type = "normal"; } else { - $this->_cached_file = md5($this->salt.$this->_remote_file); + $this->_cached_file = md5($this->salt.$this->_remote_file) . '.cache'; $this->_cache_type = "fast"; } diff --git a/templates/de/html/admin/admin_config_cache.tpl b/templates/de/html/admin/admin_config_cache.tpl index 923b72a276..478af6bd50 100644 --- a/templates/de/html/admin/admin_config_cache.tpl +++ b/templates/de/html/admin/admin_config_cache.tpl @@ -8,9 +8,9 @@   - + {--ADMIN_CACHE_ADMINS--} -  {--YES--}  {--NO--}  @@ -19,9 +19,9 @@   - + {--ADMIN_CACHE_ACLS--} -  {--YES--}  {--NO--}  -- 2.39.2