mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-25 04:23:38 +01:00
[feature/merging-style-components] Changing $style to $style_id
Changing $style to $style_id in user::setup to avoid conflict with new global style variable PHPBB3-10632
This commit is contained in:
parent
3997ffac2a
commit
c83f386c92
@ -1568,7 +1568,7 @@ class user extends session
|
|||||||
/**
|
/**
|
||||||
* Setup basic user-specific items (style, language, ...)
|
* 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, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
|
||||||
|
|
||||||
@ -1643,36 +1643,36 @@ class user extends session
|
|||||||
{
|
{
|
||||||
global $SID, $_EXTRA_URL;
|
global $SID, $_EXTRA_URL;
|
||||||
|
|
||||||
$style = $style_request;
|
$style_id = $style_request;
|
||||||
$SID .= '&style=' . $style;
|
$SID .= '&style=' . $style_id;
|
||||||
$_EXTRA_URL = array('style=' . $style);
|
$_EXTRA_URL = array('style=' . $style_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Set up style
|
// 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 *
|
$sql = 'SELECT *
|
||||||
FROM ' . STYLES_TABLE . " s
|
FROM ' . STYLES_TABLE . " s
|
||||||
WHERE s.style_id = $style";
|
WHERE s.style_id = $style_id";
|
||||||
$result = $db->sql_query($sql, 3600);
|
$result = $db->sql_query($sql, 3600);
|
||||||
$this->theme = $db->sql_fetchrow($result);
|
$this->theme = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
// User has wrong style
|
// 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 . "
|
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||||
SET user_style = $style
|
SET user_style = $style_id
|
||||||
WHERE user_id = {$this->data['user_id']}";
|
WHERE user_id = {$this->data['user_id']}";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
||||||
$sql = 'SELECT *
|
$sql = 'SELECT *
|
||||||
FROM ' . STYLES_TABLE . " s
|
FROM ' . STYLES_TABLE . " s
|
||||||
WHERE s.style_id = $style";
|
WHERE s.style_id = $style_id";
|
||||||
$result = $db->sql_query($sql, 3600);
|
$result = $db->sql_query($sql, 3600);
|
||||||
$this->theme = $db->sql_fetchrow($result);
|
$this->theme = $db->sql_fetchrow($result);
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user