📢 重要通知 🚀

网站重新整理了一下,清除了沉余数据,目前开放免费任何资源下载 🙂. 网站等待xenforo 2.4 大更新版本后再花精力设计网站.

Browser Detection

Browser Detection 2.3.1

没有下载权限
XF兼容
  1. 2.1.x
  2. 2.2.x
用法的轻量级垫片Mobile_detect(在模板中)
该插件注入全局变量,在调用任何方法之前检查是否设置了该变量,以防止在升级期间出现错误或是否禁用了该插件.$xf.mobileDetect
CSS:
<xf:if is="$xf.mobileDetect && $xf.mobileDetect.isMobile()">
    Is Mobile
<xf:else />
    Not Mobile
</xf:if>
XML:
<xf:if is="$xf.mobileDetect && $xf.mobileDetect.is('Firefox')">
    Is Firefox
<xf:else />
    Not Firefox
</xf:if>
XML:
<xf:if is="$xf.mobileDetect && $xf.mobileDetect.is('Chrome')">
    Is Chrome
<xf:else />
    Not Chrome
</xf:if>
[CODE lang="php" title="PHP用法"]$mobileDetect = \SV\BrowserDetection\Listener::getMobileDetection();
$isMobile = $mobileDetect && $mobileDetect->isMobile() ? "_m1" : "_m0";[/CODE]
与XF2.1+整页缓存集成移动检测,添加到config.php这个;
[CODE lang="php" title="XF2.1页面缓存"]$config['pageCache']['onSetup'] = function (\XF\PageCache $pageCache) {
$pageCache->setCacheIdGenerator(function(\XF\Http\Request $request) {
return \SV\BrowserDetection\CacheHelper::getPageCacheId($request);
});
};[/CODE]
作者
波坤太叔
下载
0
查看
23
首次发布
最后更新

评级

0.00 星 0 星

来自波坤太叔的更多资源

  • SV Standard Library
    SV Standard Library
    一些旨在简化附加开发的辅助实用程序没有任何直接面向用户的更改。上传到资源经理,以帮助依赖性跟踪,并允许更新,而无需更新每个单独的附加 组件
  • [MMO] Rename Attachments
    [MMO] Rename Attachments
    该插件允许您为附件添加前缀
  • [Xen-Soluce] Upgrade Coupons
    [Xen-Soluce] Upgrade Coupons
    此附加组件允许您为用户升级添加折扣代码。
  • Ultimate Landing Page
    Ultimate Landing Page
    游戏社区的登陆页面
  • [TaylorJ] Blogs
    [TaylorJ] Blogs
    为您的用户提供一种在他们自己的个人区域中进一步表达自己的方式!
后退