diff options
Diffstat (limited to 'phpBB/install/install_update.php')
-rw-r--r-- | phpBB/install/install_update.php | 62 |
1 files changed, 6 insertions, 56 deletions
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 9f50a56595..dcf01e5cc8 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -71,7 +71,7 @@ class install_update extends module function main($mode, $sub) { - global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; + global $style, $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; global $request; $this->tpl_name = 'install_update'; @@ -131,7 +131,7 @@ class install_update extends module } // Set custom template again. ;) - $template->set_custom_template('../adm/style', 'admin'); + $style->set_custom_style('admin', '../adm/style', ''); $template->assign_vars(array( 'S_USER_LANG' => $user->lang['USER_LANG'], @@ -504,56 +504,6 @@ class install_update extends module // Add database update to log add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->update_to_version); - // Refresh prosilver css data - this may cause some unhappy users, but - $sql = 'SELECT * - FROM ' . STYLES_THEME_TABLE . " - WHERE LOWER(theme_name) = 'prosilver'"; - $result = $db->sql_query($sql); - $theme = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if ($theme) - { - $recache = (empty($theme['theme_data'])) ? true : false; - $update_time = time(); - - // We test for stylesheet.css because it is faster and most likely the only file changed on common themes - if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css')) - { - $recache = true; - $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'); - } - else if (!$recache) - { - $last_change = $theme['theme_mtime']; - $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme"); - - if ($dir) - { - while (($entry = readdir($dir)) !== false) - { - if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}")) - { - $recache = true; - break; - } - } - closedir($dir); - } - } - - if ($recache) - { - // Instead of re-caching here, we simply remove theme_data... HAR HAR HAR (think about a carribean pirate) - $sql = 'UPDATE ' . STYLES_THEME_TABLE . " SET theme_data = '' - WHERE theme_id = " . $theme['theme_id']; - $db->sql_query($sql); - - $cache->destroy('sql', STYLES_THEME_TABLE); - $cache->destroy('sql', STYLES_TABLE); - } - } - $db->sql_return_on_error(true); $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'"); $db->sql_return_on_error(false); @@ -1694,9 +1644,9 @@ class install_update extends module $info['custom'] = array(); /* // Get custom installed styles... - $sql = 'SELECT template_name, template_path - FROM ' . STYLES_TEMPLATE_TABLE . " - WHERE LOWER(template_name) NOT IN ('subsilver2', 'prosilver')"; + $sql = 'SELECT style_name, style_path + FROM ' . STYLES_TABLE . " + WHERE LOWER(style_name) NOT IN ('subsilver2', 'prosilver')"; $result = $db->sql_query($sql); $templates = array(); @@ -1715,7 +1665,7 @@ class install_update extends module { foreach ($templates as $row) { - $info['custom'][$filename][] = str_replace('/prosilver/', '/' . $row['template_path'] . '/', $filename); + $info['custom'][$filename][] = str_replace('/prosilver/', '/' . $row['style_path'] . '/', $filename); } } } |