浏览器检测

浏览器检测 2.4.0

没有下载权限
XF 兼容性
  1. 2.3.x
  2. 2.2.x
摘要
SV BrowserDetection - Lightweight mobile detection add-on for XenForo 2, seamlessly integrates with full-page caching and supports Firefox, Chrome checks in templates & PHP. Enhance your XF site today!
一个轻量级的垫圈 aroundMobile_detectXenForo 2使用(模板中)插件注入了全局变量$mobileDetect,请确保在调用任何方法之前设置该变量,以防止升级时或插件禁用时出现错误。
PHP:
            <xf:if is="$mobileDetect && $mobileDetect.isMobile()"> Is Mobile <xf:else /> Not Mobile </xf:if>
PHP:
           <xf:if is="$mobileDetect && $mobileDetect.is('Firefox')">
Is Firefox
<xf:else />
Not Firefox
</xf:if>
PHP:
            <xf:if is="$mobileDetect && $mobileDetect.is('Chrome')">
Is Chrome
<xf:else />
Not Chrome
</xf:if>
使用(在php)
PHP:
            $mobileDetect = \SV\BrowserDetection\Listener::getMobileDetection();
$isMobile = $mobileDetect && $mobileDetect->isMobile() ? "_m1" : "_m0";
XF2.1 页面缓存在config.php中添加以下代码:
$config['xf']['full_page_caching'] = true;
PHP:
            $config['pageCache']['onSetup'] = function (\XF\PageCache $pageCache) {
$pageCache->setCacheIdGenerator(function(\XF\Http\Request $request) {
return \SV\BrowserDetection\CacheHelper::getPageCacheId($request);
});
};
贡献功能或修复bug请通过“更多信息”链接创建一个GitHub Pull请求。贡献如果你喜欢这个插件,请考虑通过PayPal进行捐赠。详情将在私聊中提供。如果您希望有不同的授权安排,请联系我。许可证查看MobileDetect.md中的许可证(MIT许可)。
  • 点赞
反应: ADYADY
作者
newimage
浏览
1,157
扩展类型
zip
文件大小
43.2 KB
首次发布
上次更新
评分 0.00 星 0 个评分
链接失效了吗? 发送消息 给 NP 团队,我们会尽快为您处理!
支持开发者 如果您对测试满意或项目已成功盈利,可点击「更多信息」按钮,通过购买来支持开发者!

最新更新

  1. 2.4.0 - change log
    Restore XF2.1 support Update Mobile Detect from v3.74.3 => v4.8.06. Note; this...
  2. 2.3.1 - changelog
    XF2.3 support php 8.4 compatibility Update MobileDetect library to 3.74.3
  3. 2.3.0 - changelog
    This add-on is now available on atelieraphelion.com Require XenForo 2.2+ Require php 7.2+...

来自 newimage 的更多资源

FAQ问题模块 N
使用FAQ Pro模块,您可以创建FAQ页面,并将其作为SEO策略的重要部分。
ITD MP3 N
ITD MP3 2.1.0 Patch 1
将远程托管的MP3音频嵌入到您的板上并提供下载选项。
浏览
937
已更新
WHMCS nulled 回调移除 N
新版本 for 主管
浏览
3,750
已更新
顶部