Размер файла: 4.18Kb
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="modx.prosilver.en.xsl"?>
<!--NOTICE: Please open this file in your web browser. If presented with a security warning, you may safely tell it to allow the blocked content.-->
<!--For security purposes, please check: http://www.phpbb.com/mods/ for the latest version of this MOD.\nAlthough MODs are checked before being allowed in the MODs Database there is no guarantee that there are no security problems within the MOD.\nNo support will be given for MODs not found within the MODs Database which can be found at http://www.phpbb.com/mods/-->
<mod xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.phpbb.com/mods/xml/modx-1.2.6.xsd">
<header>
<meta name="generator" content="MODX file generated with PP MODX Creator 1.2.6 by tumba25 (phpBB version)"/>
<license><![CDATA[http://opensource.org/licenses/gpl-license.php GNU General Public License v2]]></license>
<title lang="en"><![CDATA[CSS Style Option]]></title>
<description lang="ru"><![CDATA[Модуль позволяет пользователям сменить стиль оформления для форума.
Используются cookies, для корректной работы они должны быть включены.]]></description>
<author-group>
<author>
<realname><![CDATA[Anvar Stybayev]]></realname>
<username phpbbcom="no"><![CDATA[[email protected]]]></username>
<homepage><![CDATA[apwa.ru]]></homepage>
<email><![CDATA[[email protected]]]></email>
</author>
</author-group>
<mod-version>1.0.0</mod-version>
<installation>
<level>easy</level>
<time>60</time>
<target-version>3.0.11</target-version>
</installation>
</header>
<action-group>
<open src="functions.php">
<edit>
<find><![CDATA['T_STYLESHEET_NAME' => $user->theme['theme_name'],]]></find>
<action type="after-add"><![CDATA['T_STYLESHET_LINK_WAP' => request_var($config['cookie_name'] . '_css', '', false, true) ? "{$web_path}styles/" . rawurlencode($user->theme['theme_path']) . '/theme/' . request_var($config['cookie_name'] . '_css', '', false, true) . '.css' : '',
]]></action>
</edit>
</open>
<open src="index.php">
<edit>
<find><![CDATA[$user->setup('viewforum');]]></find>
<action type="after-add"><![CDATA[// Style css wap
$web_path = (isset($web_path)) ? $web_path : $phpbb_root_path;
if (is_dir("{$web_path}styles/mobile/theme/"))
{
$style_css = request_var('style_css', '');
if ($dh = opendir("{$web_path}styles/mobile/theme/"))
{
$style_css_select = '';
$cookies_css = '';
while (($file = readdir($dh)) !== false)
{
if( preg_match('/(\.css)$/is', $file) )
{
$file = str_replace(".css", "", $file);
$selected = ($file == 'stylesheet') ? ' selected="selected"' : '';
$style_css_select .= '<option value="' . $file . '"' . $selected . '>' . htmlspecialchars($file) . '</option>';
$cookies_css .= ( $style_css == $file ) ? TRUE: FALSE;
}
}
closedir($dh);
}
if ($cookies_css)
{
$style_css = ($style_css != 'stylesheet') ? $style_css : '';
$user->set_cookie('css', $style_css, time() + 31536000);
header('Location: ' . append_sid("{$phpbb_root_path}index.$phpEx"));
}
}
]]></action>
</edit>
<edit>
<find><![CDATA['S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false,]]></find>
<action type="after-add"><![CDATA['S_STYLE_CSS_OPTIONS' => $style_css_select,]]></action>
</edit>
</open>
<open src="mobile/template/index_body.html">
<edit>
<comment lang="ru"><![CDATA[В любое удобное место!]]></comment>
<action type="after-add"><![CDATA[<form method="post" action="{U_INDEX}" id="jumpbox" onsubmit="if(this.f.value == -1){return false;}">
<select name="style_css" id="style_css" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">
{S_STYLE_CSS_OPTIONS}
</select>
<input type="submit" value="Go!" class="subbutton" />
</form>]]></action>
</edit>
</open>
<diy-instructions lang="ru"><![CDATA[Дополнительные стили можно будет загружать в папку styles/mobile/theme/]]></diy-instructions>
</action-group>
</mod>