aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions_user.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions_user.inc.php')
-rw-r--r--include/functions_user.inc.php16
1 files changed, 15 insertions, 1 deletions
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;
+ }
+ }
}
/*