diff options
author | plegall <plg@piwigo.org> | 2010-03-22 19:49:14 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2010-03-22 19:49:14 +0000 |
commit | 6b3dc4ede1084d4940b62d7e70f3cd67f8bcdc78 (patch) | |
tree | fb768711cff097b8d2b2bda21ddcb9cc803927ba | |
parent | 363268ab990454feec7d88f148716af04d42014c (diff) |
feature 1514: improvement, if a user has a theme that is (maybe temporary)
unactive, we fallback on default theme (the real default theme, the one set
for default user)
git-svn-id: http://piwigo.org/svn/trunk@5264 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/functions_user.inc.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index 5d964ec99..99b18ea98 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -246,9 +246,9 @@ function build_user( $user_id, $use_cache ) $user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page']; // Check user theme - if (!file_exists(PHPWG_ROOT_PATH.'themes/'.$user['theme'].'/themeconf.inc.php')) + if (!isset($user['theme_name'])) { - $user['theme'] = $conf['default_theme']; + $user['theme'] = get_default_theme(); } return $user; @@ -292,9 +292,10 @@ SELECT '; while (true) { $query = ' -SELECT ui.*, uc.* - FROM '.USER_INFOS_TABLE.' AS ui LEFT JOIN '.USER_CACHE_TABLE.' AS uc - ON ui.user_id = uc.user_id +SELECT ui.*, uc.*, t.name AS theme_name + FROM '.USER_INFOS_TABLE.' AS ui + LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id + LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme WHERE ui.user_id = \''.$user_id.'\''; $result = pwg_query($query); if (pwg_db_num_rows($result) > 0) |