A light-weight shim around Mobile_detect for XenForo 2
Usage (in templates)
The add-on injects the global variable $mobileDetect, check that the variable is set before calling any methods to prevent errors during upgrades or if the add-on is disabled.
Code:
<xf:if is="$mobileDetect && $mobileDetect.isMobile()">
Is Mobile
<xf:else />
Not Mobile
</xf:if>
Code...
- Require php 7.0+
- Require XenForo 2.1+
- Inject is-mobile or is-tablet into PAGE_CONTAINER html class attribute based on detected user-agent
Update MobileDetect library to v2.8.37
- 3rd party add-on compatibility fix, rework how html element css injection works
- Implement caching wrapper around Mobile_detect::match calls.
- Forward unknown function calls to the wrapped Mobile_detect instance
This add-on is now available on atelieraphelion.com
- Require XenForo 2.2+
- Require php 7.2+
- Update MobileDetect library to 3.74.0 (Patched to support php 7.2, instead of php 7.4+)
XF2.3 support
php 8.4 compatibility
Update MobileDetect library to 3.74.3