Several double->single convertions, fix for missing constant '_MYSQL_PREFIX' which...
authorRoland Häder <roland@mxchange.org>
Wed, 29 Jul 2009 21:56:28 +0000 (21:56 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 29 Jul 2009 21:56:28 +0000 (21:56 +0000)
inc/functions.php
inc/modules/admin/what-config_cache.php
inc/modules/guest/what-wernis_portal.php
inc/rdf.class.php
templates/de/html/admin/admin_config_cache.tpl

index 10b4d02..ea7a429 100644 (file)
@@ -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:<pre>".htmlentities($eval)."</pre>");
+                               app_die(__FUNCTION__, __LINE__, 'Evaluation error:<pre>' . htmlentities($eval) . '</pre>');
                        } // END - if
                        $OUTPUT = $newContent;
                } // END - while
index 59a6723..59ac1df 100644 (file)
@@ -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');
 }
 
 //
index 9b131e7..567fe1a 100644 (file)
@@ -51,19 +51,19 @@ loadIncludeOnce('inc/rdf.class.php');
 // Add description as navigation point
 ADD_DESCR('guest', __FILE__);
 
-OUTPUT_HTML("<div style=\"padding-left: 10px; padding-right: 10px\">");
+OUTPUT_HTML('<div style="padding-left: 10px; padding-right: 10px">');
 $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("</div>");
+OUTPUT_HTML('</div>');
 
 //
 ?>
index 17b8050..33d82db 100644 (file)
@@ -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";
                }
 
index 923b72a..478af6b 100644 (file)
@@ -8,9 +8,9 @@
                <td colspan="2" class="seperator" height="10">&nbsp;</td>
        </tr>
        <tr>
-               <td class="switch_sw1" align="right" width="350" height="20">
+               <td align="right" width="350" height="20">
                {--ADMIN_CACHE_ADMINS--}</td>
-               <td class="switch_sw1" width="150" style="padding-left: 10px"><input
+               <td width="150" style="padding-left: 10px"><input
                        type="radio" name="cache_admins" value="Y" class="admin_normal"{!__ADMINS_Y!} />&nbsp;{--YES--}
                <input type="radio" name="cache_admins" value="N" class="admin_normal"{!__ADMINS_N!} />&nbsp;{--NO--}&nbsp;
                </td>
@@ -19,9 +19,9 @@
                <td colspan="2" class="seperator" height="10">&nbsp;</td>
        </tr>
        <tr>
-               <td class="switch_sw2" align="right" width="350" height="20">
+               <td align="right" width="350" height="20">
                {--ADMIN_CACHE_ACLS--}</td>
-               <td class="switch_sw2" width="150" style="padding-left: 10px"><input
+               <td width="150" style="padding-left: 10px"><input
                        type="radio" name="cache_acls" value="Y" class="admin_normal"{!__ACLS_Y!} />&nbsp;{--YES--}
                <input type="radio" name="cache_acls" value="N" class="admin_normal"{!__ACLS_N!} />&nbsp;{--NO--}&nbsp;
                </td>