Файл: bb3-mobi/contrib/detect_mobile/install_mod.xml
Строк: 257
<?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="http://www.phpbb.com/mods/xml/modx-1.2.5.xsd">
<header>
<meta name="generator" content="MODX file generated with PP MODX Creator by tumba25 (online version)"/>
<license><![CDATA[http://opensource.org/licenses/gpl-license.php GNU General Public License v2]]></license>
<title lang="en"><![CDATA[phpBB Mobile Version]]></title>
<title lang="ru"><![CDATA[Мобильная версия phpBB]]></title>
<description lang="en"><![CDATA[Your phpBB automatically detects mobile browsers and switches to the mobile style. Also this MOD adds links/buttons for quick manual switching: button "Mobile version" in standard style and "Full version" in mobile style.]]></description>
<description lang="ru"><![CDATA[Автоматическое включение мобильного стиля при обнаружении мобильного браузера. Для быстрого ручного переключения добавляются ссылки (кнопки): в стандартном стиле кнопка «Мобильный вид», а в мобильном стиле ссылка «Полная версия».]]></description>
<author-group>
<author>
<username><![CDATA[Nekstati]]></username>
<homepage><![CDATA[http://www.phpbbguru.net]]></homepage>
</author>
</author-group>
<mod-version>1.0.0</mod-version>
<installation>
<level>easy</level>
<time>600</time>
<target-version>3.0.7-PL1</target-version>
</installation>
<link-group>
<link type="language" href="ru.xml" lang="en">Russian</link>
<link type="language" href="ru.xml" lang="ru">Русский</link>
<link type="template" href="subsilver2.xml" lang="en">Subsilver2</link>
</link-group>
</header>
<action-group>
<copy>
<file from="root/styles/prosilver/theme/images/icon_mobile.gif" to="styles/prosilver/theme/images/icon_mobile.gif"/>
</copy>
<open src="index.php">
<edit>
<find><![CDATA[$user->setup('viewforum');]]></find>
<action type="after-add"><![CDATA[$mobile_style = request_var('mobile_style', '');
if ($mobile_style == 'on' || $mobile_style == 'off')
{
$user->set_cookie('mobile', $mobile_style, time() + 31536000);
header('Location: ' . append_sid("{$phpbb_root_path}index.$phpEx"));
}]]></action>
</edit>
</open>
<open src="includes/functions.php">
<edit>
<find><![CDATA[ 'U_FEED' => generate_board_url() . "/feed.$phpEx",]]></find>
<action type="after-add"><![CDATA[ 'U_MOBILE_ON' => append_sid("{$phpbb_root_path}index.$phpEx", 'mobile_style=on'),
'U_MOBILE_OFF' => append_sid("{$phpbb_root_path}index.$phpEx", 'mobile_style=off'),]]></action>
</edit>
</open>
<open src="includes/session.php">
<edit>
<find><![CDATA[ if (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START'))]]></find>
<action type="before-add"><![CDATA[ // Set mobile style for mobile browsers
$is_mobile = false;
$user_browser = strtolower($this->browser);
$browsers_array = array('240x320', '320x240', 'alcatel', 'android', 'audiovox', 'au-mic', 'avantgo', 'blackberry', 'blazer', 'cldc', 'compal', 'danger', 'elaine', 'epoc', 'ericsson', 'ericy', 'fennec', 'hiptop', 'ipaq', 'iphone', 'ipod', 'iris', 'j2me', 'kindle', 'lge', 'maemo', 'midp', 'mmp', 'mobile', 'motorola', 'netfront', 'nitro', 'nokia', 'opera mini', 'opera mobi', 'palm', 'panasonic', 'pda', 'philips', 'phone', 'plucker', 'pocket', 'portalmmm', 'psp', 'rover', 'samsung', 'sanyo', 'series60', 'sharp', 'sony', 'symbian', 't-shark', 'treo', 'up.browser', 'up.link', 'vodafone', 'wap', 'webos', 'windows ce', 'wireless', 'xiino/i');
foreach ($browsers_array as $useragent_match)
{
if (strpos($user_browser, $useragent_match) !== false)
{
$is_mobile = true;
break;
}
}
$mobile_cookie = request_var($config['cookie_name'] . '_mobile', 'not_set', false, true);
if (!$this->data['is_bot'] && ($mobile_cookie == 'on' || ($is_mobile && $mobile_cookie == 'not_set')))
{
$style = $config['mobile_style'];
}]]></action>
</edit>
</open>
<open src="includes/acp/acp_board.php">
<edit>
<find><![CDATA[ 'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),]]></find>
<action type="after-add"><![CDATA[ 'mobile_style' => array('lang' => 'MOBILE_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', 1), 'explain' => true),]]></action>
</edit>
</open>
<open src="language/en/common.php">
<edit>
<find><![CDATA[ 'MINUTES' => 'Minutes',]]></find>
<action type="after-add"><![CDATA[ 'MOBILE_ON' => 'Mobile version',
'MOBILE_OFF' => 'Full version',]]></action>
</edit>
</open>
<open src="language/en/acp/board.php">
<edit>
<find><![CDATA[ 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.',]]></find>
<action type="after-add"><![CDATA[ 'MOBILE_STYLE' => 'Style for mobile devices',
'MOBILE_STYLE_EXPLAIN' => 'This style will be automatically used for mobile browsers. It is recommended to <em>deactivate</em> this style (see tab "Styles").',]]></action>
</edit>
</open>
<open src="styles/prosilver/template/overall_footer.html">
<edit>
<find><![CDATA[ <li class="rightside"><!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a> • <!-- ENDIF --><!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a> • <!-- ENDIF -->{S_TIMEZONE}</li>]]></find>
<inline-edit>
<inline-find><![CDATA[<li class="rightside">]]></inline-find>
<inline-action type="after-add"><![CDATA[<!-- IF not S_IS_BOT --><a href="{U_MOBILE_ON}">{L_MOBILE_ON}</a> • <!-- ENDIF -->]]></inline-action>
</inline-edit>
</edit>
</open>
<open src="styles/prosilver/template/overall_header.html">
<edit>
<find><![CDATA[ <!-- IF U_PRINT_PM --><li class="rightside"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p" class="print">{L_PRINT_PM}</a></li><!-- ENDIF -->]]></find>
<action type="after-add"><![CDATA[ <!-- IF not S_IS_BOT --><li class="rightside"><a href="{U_MOBILE_ON}" title="{L_MOBILE_ON}" accesskey="p" class="print" style="background-image: url({T_THEME_PATH}/images/icon_mobile.gif)">{L_MOBILE_ON}</a></li><!-- ENDIF -->]]></action>
</edit>
</open>
<diy-instructions lang="en"><![CDATA[Go to ACP → Styles and refresh Prosilver template.
Go to ACP → General → Board settings and set mobile style.]]></diy-instructions>
<diy-instructions lang="ru"><![CDATA[Перейдите на вкладку «Стили» администраторского раздела и обновите шаблон стиля Prosilver.
Перейдите на вкладку «Общие» → «Настройки конференции» и выберите стиль для мобильных устройств.]]></diy-instructions>
</action-group>
</mod>