diff --git a/include/serendipity_smarty_class.inc.php b/include/serendipity_smarty_class.inc.php index 5e0f0b24..8ac8bfc8 100644 --- a/include/serendipity_smarty_class.inc.php +++ b/include/serendipity_smarty_class.inc.php @@ -1,15 +1,15 @@ -setTemplateDir(array(S9Y_TEMPLATE_DEFAULT)); + $this->setTemplateDir(array(S9Y_TEMPLATE_USERDEFAULT)); + // set addTemplate array with the blogs used template anyway $serendipity['addTemplateDir'] = array($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['defaultTemplate']); /* Note: Ian - BEWARE: Bulletproof and default template do not have any engine settings, so this will be empty. This is why adding defaultTemplate was necessary + BEWARE: Bulletproof and default template do not have any engine settings, so the next will be empty. This is why adding defaultTemplate was necessary. */ // merge engine only templates to addTemplate array $p = explode(',', $serendipity['template_engine']); @@ -115,14 +114,16 @@ class Serendipity_Smarty extends Smarty $serendipity['addTemplateDir'][] = $serendipity['serendipityPath'] . 'plugins'; // add default template to addTemplate array, if not already set in engine $serendipity['addTemplateDir'][] = S9Y_TEMPLATE_FALLBACK; + // expand smarty objects (add)TemplateDir setter with $serendipity['addTemplateDir'] as is $this->addTemplateDir($serendipity['addTemplateDir']); - // setTemplateDir again to unified getTemplateDir() to avoid doubles for (engine, default and main template) - $this->setTemplateDir(array_values(array_unique($this->getTemplateDir()))); // reset keys unique + + // setTemplateDir again to unified getTemplateDir() to avoid doubles for (engine, default and main templates) + $this->setTemplateDir(array_values(array_unique($this->getTemplateDir()))); // reset keys to be unique $this->setCompileDir($serendipity['serendipityPath'] . PATH_SMARTY_COMPILE); - $this->setConfigDir(array(S9Y_TEMPLATE_DEFAULT)); + $this->setConfigDir(array(S9Y_TEMPLATE_USERDEFAULT)); if (!is_dir($this->getCompileDir()) || !is_writable($this->getCompileDir())) { if(ini_get('display_errors') == 0 || ini_get('display_errors') == 'off') printf(DIRECTORY_WRITE_ERROR, $this->getCompileDir()); @@ -160,7 +161,7 @@ class Serendipity_Smarty extends Smarty */ // does set cache also need to be set to true? - #cache# $this->cache_modified_check = true; // must be true to enable 304 headers + #cache# $this->cache_modified_check = true; // to be used with display() method only, must be true to enable 304 headers /* Note: rodneyrehm @@ -207,7 +208,7 @@ class Serendipity_Smarty extends Smarty */ // set the cache_lifetime for index.tpl to 5 minutes - #cache# $this->cache_lifetime = 300; // $this->setCacheLifetime(300); + #cache# $this->cache_lifetime = 300; // $this->setCacheLifetime(300); // 86400; // one day: 60*60*24 // some documentary from the smarty forum /********************************************************* @@ -248,11 +249,14 @@ class Serendipity_Smarty extends Smarty * Set all other needed Smarty class properties ***********************************************/ - #???# $this->merge_compiled_includes = true; // $this->setMergeCompiledIncludes(true); + #???# $this->merge_compiled_includes = true; // $this->setMergeCompiledIncludes(true); // what is this for? + + // default here to be overwritten by $serendipity['production'] == 'debug' - see below! + $this->debugging = false; // $this->setDebugging(false); - $this->debugging = false; // $this->setDebugging(false); // default here to be overwritten by $serendipity['production'] == 'debug'! // Smarty will create subdirectories under the compiled templates and cache directories if $use_sub_dirs is set to TRUE, default is FALSE. $this->use_sub_dirs = ( ini_get('safe_mode') ? false : true ); // $this->setUseSubDirs(false); // cache and compile dir only + // Smarty should update the cache files automatically if $smarty->compile_check is true. $this->compile_check = true; // $this->setCompileCheck(true); #$this->compile_check = COMPILECHECK_OFF (false) - template files will not be checked @@ -280,20 +284,14 @@ class Serendipity_Smarty extends Smarty $this->debugging = true; // $this->setDebugging(true); } + // set smarty error reporting. General error_reporting is set in serendipity/serendipity_config.inc.php $this->error_reporting = E_ALL & ~E_NOTICE; - #$this->error_reporting = E_STRICT; - /* - Note: Ian - E_STRICT produces lots of errors, a la - Strict Standards: Non-static method *** should not be called statically in *** - - The solution might be to add "public static" to all errored functions - */ } /* Note: Ian + These BC methods are to be kept as long as not converted to new syntax in additional plugins Search "$serendipity['smarty']->register_" (11 hits in 6 files) in additional_plugins serendipity_event_communityrating.php, serendipity_event_customarchive.php, serendipity_event_microformats.php, serendipity_event_multilingual.php, serendipity_event_smartymarkup.php, serendipity_event_staticpage.php