From 620f70fe1ed1038b0395353db3be472910c91743 Mon Sep 17 00:00:00 2001
From: "Paul S. Owen" <psotfx@users.sourceforge.net>
Date: Tue, 12 Aug 2003 22:24:19 +0000
Subject: [PATCH] Destroy! Destroy! Danger! Will Robinson Danger! ... Doctor
 Smith will destroy the cached SQL when something changes ...

git-svn-id: file:///svn/phpbb/trunk@4394 89ea8834-ac86-4346-8a33-228a782c2dd0
---
 phpBB/adm/admin_styles.php | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php
index a7cc2f2406..ba0c722116 100644
--- a/phpBB/adm/admin_styles.php
+++ b/phpBB/adm/admin_styles.php
@@ -838,6 +838,8 @@ function viewsource(url)
 							$db->sql_query($sql);
 						}
 
+						$cache->destroy('sql', STYLES_CSS_TABLE);
+
 						$error[] = $user->lang['THEME_UPDATED'];
 						add_log('admin', 'LOG_EDIT_THEME', $theme_name);
 					}
@@ -1194,6 +1196,11 @@ function csspreview()
 					}
 					$db->sql_freeresult($result);
 
+
+//					$cache->destroy('sql', STYLES_IMAGE_TABLE);
+
+
+
 					$test_ary = array();
 					foreach ($imglist as $category => $img_ary)
 					{
@@ -1590,6 +1597,8 @@ function remove($type, $id)
 			}
 		}
 
+		$cache->destroy('sql', STYLES_TABLE);
+
 		add_log('admin', 'LOG_DELETE_' . $l_prefix, ${$type . '_name'});
 		$message = ($onfs) ? $l_prefix . '_DELETED_FS' : $l_prefix . '_DELETED';
 		trigger_error($user->lang[$message]);
@@ -2422,7 +2431,7 @@ function install_style($action, $name, $copyright, $active, $default, $root_path
 // Commented inline
 function install($type, $action, $id)
 {
-	global $phpbb_root_path, $phpEx, $SID, $config, $db, $user;
+	global $phpbb_root_path, $phpEx, $SID, $config, $db, $cache, $user;
 	global $safe_mode, $file_uploads, $archive_preg;
 
 	$install_path = (isset($_REQUEST['path'])) ? htmlspecialchars($_REQUEST['path']) : '';
@@ -2641,6 +2650,8 @@ function install($type, $action, $id)
 
 			if (!sizeof($error))
 			{
+				$cache->destroy('sql', STYLES_TABLE);
+
 				$message = ($storedb) ? '_ADDED_DB' : '_ADDED';
 				trigger_error($user->lang[$l_type . $message]);
 			}
@@ -2721,6 +2732,8 @@ function install($type, $action, $id)
 
 			if (!sizeof($error))
 			{
+				$cache->destroy('sql', STYLES_TABLE);
+
 				$message = ($storedb) ? '_ADDED_DB' : '_ADDED';
 				trigger_error($user->lang["$l_type$message"]);
 			}
@@ -2817,6 +2830,8 @@ function install($type, $action, $id)
 				}
 			}
 
+			$cache->destroy('sql', STYLES_TABLE);
+
 			add_log('admin', 'LOG_EDIT_' . $l_type, $name);
 			trigger_error($user->lang[$l_type . '_EDITED']);
 		}