Skip to content

Commit

Permalink
feature 1514: improvement, if a user has a theme that is (maybe tempo…
Browse files Browse the repository at this point in the history
…rary)

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
  • Loading branch information
plegall committed Mar 22, 2010
1 parent 363268a commit 6b3dc4e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/functions_user.inc.php
Expand Up @@ -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;
Expand Down Expand Up @@ -292,9 +292,10 @@ function getuserdata($user_id, $use_cache)
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)
Expand Down

0 comments on commit 6b3dc4e

Please sign in to comment.