diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2014-03-16 14:09:46 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2014-03-16 14:09:46 -0500 |
commit | 5f70518987838b927ebeae504113cb4bc6e8f722 (patch) | |
tree | 00a874923ce25a01b6056755be13aefb176ebc66 | |
parent | 69c195687f2bdbbc2f21094432b1ee4f74c2d414 (diff) | |
parent | df0ac9876c794be0bfc49bfdcfd50366afa88d49 (diff) | |
download | forums-5f70518987838b927ebeae504113cb4bc6e8f722.tar forums-5f70518987838b927ebeae504113cb4bc6e8f722.tar.gz forums-5f70518987838b927ebeae504113cb4bc6e8f722.tar.bz2 forums-5f70518987838b927ebeae504113cb4bc6e8f722.tar.xz forums-5f70518987838b927ebeae504113cb4bc6e8f722.zip |
Merge pull request #2136 from Elsensee/ticket/11071
[ticket/11071] Add fallback if requested style don't exist
-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']) { |