aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-03-31 17:22:54 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-03-31 17:22:54 +0200
commit0ae491c5fa9228304e17431ea7aa8ba9303cc193 (patch)
tree9d3fcccb13d8bda12ae7f0dec3321c7375d8e621 /phpBB/includes/session.php
parente7a4437c1bccace4a0637241a8f386e686d9c3fb (diff)
parent5d07b16ec647f51d51504cf9d6a0861a975ceb8e (diff)
downloadforums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.tar
forums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.tar.gz
forums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.tar.bz2
forums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.tar.xz
forums-0ae491c5fa9228304e17431ea7aa8ba9303cc193.zip
Merge remote-tracking branch 'cyberalien/feature/merging-style-components' into develop
* cyberalien/feature/merging-style-components: (31 commits) [feature/merging-style-components] Fix back link on install page [feature/merging-style-components] Fix for unit tests [feature/merging-style-components] Moving template initialization out of style [feature/merging-style-components] Renaming "delete" to "uninstall" for styles [feature/merging-style-components] Initializing locator and provider separately [feature/merging-style-components] Fixing few errors in acp_styles [feature/merging-style-components] Fix notices in acp_styles [feature/merging-style-components] Updating styles in coding guidelines [feature/merging-style-components] Changing acp_styles text [feature/merging-style-components] Updating test cases [feature/merging-style-components] Updating style initialization [feature/merging-style-components] Changing style class [feature/merging-style-components] Changing template class [feature/merging-style-components] Changing resource locator [feature/merging-style-components] Changing path provider [feature/merging-style-components] Renaming style locator [feature/merging-style-components] Changing $style to $style_id [feature/merging-style-components] Creating style class [feature/merging-style-components] New acp_styles template [feature/merging-style-components] New acp_styles ...
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php36
1 files changed, 16 insertions, 20 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 6dad068ecb..2fd2efe9b2 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1568,9 +1568,9 @@ class user extends session
/**
* Setup basic user-specific items (style, language, ...)
*/
- function setup($lang_set = false, $style = false)
+ function setup($lang_set = false, $style_id = false)
{
- global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
+ global $db, $style, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
if ($this->data['user_id'] != ANONYMOUS)
{
@@ -1643,40 +1643,36 @@ class user extends session
{
global $SID, $_EXTRA_URL;
- $style = $style_request;
- $SID .= '&amp;style=' . $style;
- $_EXTRA_URL = array('style=' . $style);
+ $style_id = $style_request;
+ $SID .= '&amp;style=' . $style_id;
+ $_EXTRA_URL = array('style=' . $style_id);
}
else
{
// Set up style
- $style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
+ $style_id = ($style_id) ? $style_id : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
}
- $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_name, c.theme_id
- FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . " c
- WHERE s.style_id = $style
- AND t.template_id = s.template_id
- AND c.theme_id = s.theme_id";
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE . " s
+ WHERE s.style_id = $style_id";
$result = $db->sql_query($sql, 3600);
$this->theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// User has wrong style
- if (!$this->theme && $style == $this->data['user_style'])
+ if (!$this->theme && $style_id == $this->data['user_style'])
{
- $style = $this->data['user_style'] = $config['default_style'];
+ $style_id = $this->data['user_style'] = $config['default_style'];
$sql = 'UPDATE ' . USERS_TABLE . "
- SET user_style = $style
+ SET user_style = $style_id
WHERE user_id = {$this->data['user_id']}";
$db->sql_query($sql);
- $sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_id
- FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . " c
- WHERE s.style_id = $style
- AND t.template_id = s.template_id
- AND c.theme_id = s.theme_id";
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE . " s
+ WHERE s.style_id = $style_id";
$result = $db->sql_query($sql, 3600);
$this->theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -1708,7 +1704,7 @@ class user extends session
}
}
- $template->set_template();
+ $style->set_style();
$this->img_lang = $this->lang_name;