OPEN includes/functions.php
FIND
'S_TOPIC_ID' => $topic_id,
ADD AFTER
'STYLE_COOKIE' => request_var('style_cookie', '', false, true),OPEN styles/prosilver/template/overall_header.html
FIND
ADD BEFORE
<!-- IF STYLE_COOKIE -->
<meta http-equiv="Default-Style" content="{STYLE_COOKIE}" />
<!-- ENDIF -->FIND
<link href="{T_THEME_PATH}/normal.css" rel="stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet" type="text/css" title="A++" />REPLACE WITH
<link href="{T_THEME_PATH}/normal.css" rel="<!-- IF STYLE_COOKIE !== 'A' -->alternate <!-- ENDIF -->stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="<!-- IF STYLE_COOKIE !== 'A+' -->alternate <!-- ENDIF -->stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="<!-- IF STYLE_COOKIE !== 'A++' -->alternate <!-- ENDIF -->stylesheet" type="text/css" title="A++" />OPEN styles/prosilver/template/simple_header.html
FIND
ADD BEFORE
<!-- IF STYLE_COOKIE -->
<meta http-equiv="Default-Style" content="{STYLE_COOKIE}" />
<!-- ENDIF -->FIND
<link href="{T_THEME_PATH}/normal.css" rel="stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet" type="text/css" title="A++" />REPLACE WITH
<link href="{T_THEME_PATH}/normal.css" rel="<!-- IF STYLE_COOKIE !== 'A' -->alternate <!-- ENDIF -->stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="<!-- IF STYLE_COOKIE !== 'A+' -->alternate <!-- ENDIF -->stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="<!-- IF STYLE_COOKIE !== 'A++' -->alternate <!-- ENDIF -->stylesheet" type="text/css" title="A++" />OPEN styles/prosilver/template/styleswitcher.js
FIND
function setActiveStyleSheet(title)
{
var i, a, main;
for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
{
if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title'))
{
a.disabled = true;
if (a.getAttribute('title') == title)
{
a.disabled = false;
}
}
}
}REPLACE WITH
function setActiveStyleSheet(title)
{
var i, a, main;
for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
{
if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title'))
{
a.disabled = true;
if (a.getAttribute('title') == title)
{
a.disabled = false;
}
}
}
createCookie('style_cookie', title, 365);
}function getActiveStyleSheet()
{
var i, a;
for (i = 0; (a = document.getElementsByTagName('link')[i]); i++)
{
if (a.getAttribute('rel').indexOf('style') != -1 && a.getAttribute('title') && !a.disabled)
{
return a.getAttribute('title');
}
}
return null;
}REPLACE WITH
function getActiveStyleSheet()
{
var cookie = readCookie('style_cookie');
var title = cookie ? cookie : getPreferredStyleSheet();
return title;
}FIND
document.cookie = name + '=' + value + expires + style_cookie_settings;
REPLACE WITH
document.cookie = name + '=' + urlencode(value) + expires + style_cookie_settings;
FIND
return c.substring(nameEQ.length, c.length);
REPLACE WITH
return urldecode(c.substring(nameEQ.length, c.length));
FIND
onload_functions.push('load_cookie()');REPLACE WITH
function urlencode(str)
{
return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}
function urldecode(str)
{
return unescape(str.replace('+', ' '));
}
// onload_functions.push('load_cookie()');Думается мне, что на оффе такая правка не пройдёт. Правки не совсем тривиальные, и эффект проявляется только при отсутствии CSS в кэше браузера.