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
查看
240
首次发布
最后更新

评级

0.00 星 0 星

来自波坤太叔的更多资源

  • App for Cloudflare®
    App for Cloudflare®
    一切都可以通过Cloudflare API从XenForo内部获得(您不需要去Cloudflare获取东西)。这允许您授予管理员执行某些操作的权限(例如,在 Cloudflare 中阻止 IP 地址,
  • Redis Cache By Xon
    Redis Cache By Xon
    此附加组件使用Credis与自定义缓存提供商为 Redis (基于Cm_Cache_Backend_Redis)。为了获得最佳性能,请安装 php 扩展:您必须安装一个 Redis 实例,这很可能无法
  • Mentor LMS - Learning Management System
    内容 Mentor LMS - Learning Management System
    Mentor LMS——轻松打造您自己的电子学习业务
  • BeLink - Bio Link & URL Shortener Platform
    BeLink - Bio Link & URL Shortener Platform
    BeLink 是生物创建器中质量最高、最先进的 url 缩短器和链接
  • Diamond Pro Sngine Theme
    内容 Diamond Pro Sngine Theme
    Diamond Pro 是一款现代化、高性能且视觉效果出色的高端主题模板,专为 Sngine PHP 脚本设计而成。
社区
规则 帮助 用户
  • 目前没有人在聊天。
聊天中还没有人留言。快跟大家说声Hi!
用户活动
刚才 · 5318资源社区