You are correct.yellowled wrote:I did not follow all your code, but that might mean that the colorset stylesheet is not included using serendipity_printStylesheet because that is the function in serendipity.css.php which replaces {TEMPLATE_PATH} with the actual path.
Yep. Works. Didn't realize this would be a simple str_replace - thought {TEMPLATE_PATH} was some kind of constant or variable....Timbalu wrote:Right. Since outside the normal routine, you need to do this on your own in this case...
Is the accidental overwrite really a risk?Timbalu wrote:[...] and set it like thisThen one theme config could not accidently overwrite another.Code: Select all
$template_global_config = array('navigation' => true); $template_loaded_config = serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option'], true); $serendipity['template_loaded_config'][$serendipity['template']] = $template_loaded_config; // copy into global scope for extended plugin API usage serendipity_loadGlobalThemeOptions($template_config, $template_loaded_config, $template_global_config);
Additionally - that code didn't work, but this earlier suggestion does work (notwithstanding any risk to overwriting another theme):
Code: Select all
$template_global_config = array('navigation' => true);
$serendipity['template_loaded_config'] = $template_loaded_config = serendipity_loadThemeOptions($template_config, $serendipity['smarty_vars']['template_option'], true);
serendipity_loadGlobalThemeOptions($template_config, $template_loaded_config, $template_global_config);
Code: Select all
$tfilecontent = str_replace('img/', 'templates/' . $serendipity['template'] . '/img/', @file_get_contents($tfile));
Code: Select all
$tfilecontent = str_replace('{TEMPLATE_PATH}', 'templates/' . $serendipity['template'] . '/', @file_get_contents($tfile));