diff options
author | Oliver Schramm <oliver.schramm97@gmail.com> | 2014-03-15 22:00:48 +0100 |
---|---|---|
committer | Oliver Schramm <oliver.schramm97@gmail.com> | 2014-03-15 22:00:48 +0100 |
commit | df0ac9876c794be0bfc49bfdcfd50366afa88d49 (patch) | |
tree | a06f39071301effacbf7dc2aa4b160d11c42a886 /phpBB/phpbb/user.php | |
parent | Merge branch 'prep-release-3.1.0-b1' into develop (diff) | |
download | phpbb-df0ac9876c794be0bfc49bfdcfd50366afa88d49.tar.gz phpbb-df0ac9876c794be0bfc49bfdcfd50366afa88d49.tar.bz2 phpbb-df0ac9876c794be0bfc49bfdcfd50366afa88d49.zip |
[ticket/11071] Add fallback if requested style don't exist
PHPBB3-11071
Diffstat (limited to 'phpBB/phpbb/user.php')
-rw-r--r-- | phpBB/phpbb/user.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 2a7cc602da..6c060e21ea 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -204,6 +204,19 @@ class user extends \phpbb\session $this->style = $db->sql_fetchrow($result); $db->sql_freeresult($result); + // Fallback to user's standard style + if (!$this->style && $style_id != $this->data['user_style']) + { + $style_id = $this->data['user_style']; + + $sql = 'SELECT * + FROM ' . STYLES_TABLE . " s + WHERE s.style_id = $style_id"; + $result = $db->sql_query($sql, 3600); + $this->style = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + } + // User has wrong style if (!$this->style && $style_id == $this->data['user_style']) { |