Thanks for this great mod,
when i set a new default style in acp + overide user style, it don't works for guest (but it's fine if you log in)
So it seem's not to override the anonymous "user_style", i have some support on french phpbb forum, but after several test on other forums, it seem's not to be the normal behaviour, when the override option is checked (would be normal, if it was not checked)
I have searched a long time to find the part of code who is concerned by the overriding style function, and perhaps coul be a relation with your mod
So could you check my includes/session.php with this part of code with your mod change, to see if it could be caused by this change, please
- Code: Select all
// BEGIN UCP STYLE PREVIEW MOD
if (!empty($_GET['style_preview']) && isset($config['style_preview']) && $config['style_preview'])
{
global $SID, $_EXTRA_URL;
$style = request_var('style_preview', 0);
$SID .= '&style=' . $style;
$_EXTRA_URL = array('style=' . $style);
}
// following lines were altered, to remove mod replace below with
// if (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
// END UCP STYLE PREVIEW MOD
elseif (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
{
global $SID, $_EXTRA_URL;
$style = request_var('style', 0);
$SID .= '&style=' . $style;
$_EXTRA_URL = array('style=' . $style);
}
else
{
// Set up style
//-- mod: Prime Quick Style -------------------------------------------------//
include($phpbb_root_path . 'includes/prime_quick_style.' . $phpEx);
$prime_quick_style->set_guest_style($style);
//-- end: Prime Quick Style -------------------------------------------------//
$style = ($style) ? $style : ((!$config['override_user_style']) ? $this->data['user_style'] : $config['default_style']);
}
$sql = 'SELECT s.style_id, t.template_storedb, 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_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i
WHERE s.style_id = $style
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id
AND i.imageset_id = s.imageset_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'])
{
$style = $this->data['user_style'] = $config['default_style'];
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_style = $style
WHERE user_id = {$this->data['user_id']}";
$db->sql_query($sql);
$sql = 'SELECT s.style_id, t.template_storedb, t.template_path, t.template_id, t.bbcode_bitfield, c.theme_path, c.theme_name, c.theme_storedb, c.theme_id, i.imageset_path, i.imageset_id, i.imageset_name
FROM ' . STYLES_TABLE . ' s, ' . STYLES_TEMPLATE_TABLE . ' t, ' . STYLES_THEME_TABLE . ' c, ' . STYLES_IMAGESET_TABLE . " i
WHERE s.style_id = $style
AND t.template_id = s.template_id
AND c.theme_id = s.theme_id
AND i.imageset_id = s.imageset_id";
$result = $db->sql_query($sql, 3600);
$this->theme = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
}
Thanks a lot
