mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-17 11:28:41 +01:00
uncache themes on settings change
This commit is contained in:
parent
758cb94e01
commit
b78b3db010
@ -2501,10 +2501,14 @@ function mod_theme_configure($theme_name) {
|
|||||||
$query->bindValue(':value', $_POST[$conf['name']]);
|
$query->bindValue(':value', $_POST[$conf['name']]);
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = prepare("INSERT INTO ``theme_settings`` VALUES(:theme, NULL, NULL)");
|
$query = prepare("INSERT INTO ``theme_settings`` VALUES(:theme, NULL, NULL)");
|
||||||
$query->bindValue(':theme', $theme_name);
|
$query->bindValue(':theme', $theme_name);
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
|
|
||||||
|
// Clean cache
|
||||||
|
Cache::delete("themes");
|
||||||
|
Cache::delete("theme_settings_".$theme);
|
||||||
|
|
||||||
$result = true;
|
$result = true;
|
||||||
$message = false;
|
$message = false;
|
||||||
@ -2552,11 +2556,15 @@ function mod_theme_uninstall($theme_name) {
|
|||||||
|
|
||||||
if (!hasPermission($config['mod']['themes']))
|
if (!hasPermission($config['mod']['themes']))
|
||||||
error($config['error']['noaccess']);
|
error($config['error']['noaccess']);
|
||||||
|
|
||||||
$query = prepare("DELETE FROM ``theme_settings`` WHERE `theme` = :theme");
|
$query = prepare("DELETE FROM ``theme_settings`` WHERE `theme` = :theme");
|
||||||
$query->bindValue(':theme', $theme_name);
|
$query->bindValue(':theme', $theme_name);
|
||||||
$query->execute() or error(db_error($query));
|
$query->execute() or error(db_error($query));
|
||||||
|
|
||||||
|
// Clean cache
|
||||||
|
Cache::delete("themes");
|
||||||
|
Cache::delete("theme_settings_".$theme);
|
||||||
|
|
||||||
header('Location: ?/themes', true, $config['redirect_http']);
|
header('Location: ?/themes', true, $config['redirect_http']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user