From 73db66afa58cb14c6ced4163c10f4603a3399428 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 28 Apr 2010 14:28:05 +0000 Subject: feature 1630: upgrade to Piwigo 2.1 :-) bug 1604: only activate core themes not all themes. git-svn-id: http://piwigo.org/svn/trunk@5982 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions_user.inc.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'include/functions_user.inc.php') diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index 6a63c83e4..41c97d0bb 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -848,7 +848,21 @@ function get_default_user_value($value_name, $sos_value) */ function get_default_theme() { - return get_default_user_value('theme', PHPWG_DEFAULT_TEMPLATE); + $theme = get_default_user_value('theme', PHPWG_DEFAULT_TEMPLATE); + if (check_theme_installed($theme)) + { + return $theme; + } + + // let's find the first available theme + $active_themes = get_pwg_themes(); + foreach (array_keys(get_pwg_themes()) as $theme_id) + { + if (check_theme_installed($theme_id)) + { + return $theme_id; + } + } } /* -- cgit v1.2.3