From 252d56ec36c049712302370036bbcf254698c240 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sun, 20 Jul 2003 17:46:06 +0000 Subject: [PATCH] Cannot delete if only theme left, select new theme for use by styles that use this git-svn-id: file:///svn/phpbb/trunk@4298 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/admin_styles.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php index 95397c8928..fc3cf10226 100644 --- a/phpBB/adm/admin_styles.php +++ b/phpBB/adm/admin_styles.php @@ -1850,6 +1850,23 @@ function csspreview() if ($theme_id) { + $sql = 'SELECT theme_id, theme_name + FROM ' . STYLES_CSS_TABLE . ' + WHERE theme_id <> ' . $theme_id . ' + ORDER BY theme_id'; + $result = $db->sql_query($sql); + + $theme_options = ''; + while ($row = $db->sql_fetchrow($result)) + { + $theme_options .= ''; + } + + if ($theme_options == '') + { + trigger_error($user->lang['ONLY_THEME']); + } + $sql = 'SELECT * FROM ' . STYLES_CSS_TABLE . " WHERE theme_id = $theme_id"; @@ -1867,6 +1884,11 @@ function csspreview() WHERE theme_id = ' . $theme_id; $db->sql_query($sql); + $sql = 'UPDATE ' . STYLES_TABLE . ' + SET theme_id = ' . intval($_POST['newtheme']) . ' + WHERE theme_id = ' . $theme_id; + $db->sql_query($sql); + $onfs = 0; if (!empty($_POST['deletefs']) && is_writeable("{$phpbb_root_path}styles/themes/$theme_path")) { @@ -1930,6 +1952,10 @@ function csspreview() } ?> + + Update styles to:
Select theme to replace this one if used by styles. + +