1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

- support re-caching of theme data if stylesheet.css changed and load_tplcompile enabled

- mcp fixes
- fixed some usability issues


git-svn-id: file:///svn/phpbb/trunk@6447 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-10-06 18:43:55 +00:00
parent c645088a34
commit 0f0d160ded
20 changed files with 87 additions and 55 deletions

View File

@@ -54,6 +54,7 @@ if ($id && $sid)
require($phpbb_root_path . 'includes/acm/acm_' . $acm_type . '.' . $phpEx);
require($phpbb_root_path . 'includes/cache.' . $phpEx);
require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
$db = new $sql_db();
$cache = new cache();
@@ -64,6 +65,8 @@ if ($id && $sid)
exit;
}
$config = $cache->obtain_config();
$sql = "SELECT s.session_id, u.user_lang
FROM {$table_prefix}sessions s, {$table_prefix}users u
WHERE s.session_id = '" . $db->sql_escape($sid) . "'
@@ -89,11 +92,26 @@ if ($id && $sid)
exit;
}
/**
* @todo What happens if the theme_data value is older than the file?
* It should be re-cached as is done with templates and the template cache
* if ($theme['theme_mtime'] < filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
*/
// Re-cache stylesheet data if necessary
if ($config['load_tplcompile'] && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'))
{
include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx);
$theme['theme_data'] = acp_styles::db_theme_data($theme);
$theme['theme_mtime'] = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css');
// Save CSS contents
$sql_ary = array(
'theme_mtime' => $theme['theme_mtime'],
'theme_data' => $theme['theme_data']
);
$sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE theme_id = $id";
$db->sql_query($sql);
$cache->destroy('sql', STYLES_THEME_TABLE);
}
header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 3600));
header('Content-type: text/css');