Purge browser cache using a timestamp variable when switching templates.
This should hopefully fix Ian and my problems.
This commit is contained in:
@ -65,6 +65,7 @@ if ($serendipity['GET']['adminAction'] == 'install' ) {
|
||||
|
||||
serendipity_set_config_var('template', htmlspecialchars($serendipity['GET']['theme']));
|
||||
serendipity_set_config_var('template_engine', isset($themeInfo['engine']) ? $themeInfo['engine'] : 'default');
|
||||
serendipity_set_config_var('last_template_change', time());
|
||||
|
||||
$data["adminAction"] = "install";
|
||||
$data["install_template"] = htmlspecialchars($serendipity['GET']['theme']);
|
||||
|
@ -967,6 +967,14 @@ function serendipity_smarty_init($vars = array()) {
|
||||
|
||||
if (!isset($serendipity['smarty_vars']['head_link_stylesheet'])) {
|
||||
$serendipity['smarty_vars']['head_link_stylesheet'] = serendipity_rewriteURL('serendipity.css');
|
||||
|
||||
// When templates are switched, append a specific version string to make sure the browser does not cache the CSS
|
||||
if (strstr($serendipity['smarty_vars']['head_link_stylesheet'], '?')) {
|
||||
$serendipity['smarty_vars']['head_link_stylesheet'] .= '&v=' . $serendipity['last_template_change'];
|
||||
} else {
|
||||
$serendipity['smarty_vars']['head_link_stylesheet'] .= '?v=' . $serendipity['last_template_change'];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$serendipity['smarty']->assign(
|
||||
|
Reference in New Issue
Block a user