Kaynak ikonu

xF2 Eklenti Browser Detection 2.3.1

indirmek için izniniz yok
Uyumlu XF Sürümleri
  1. 2.2.X
  2. 2.3.X
The add-on injects the global variable $xf.mobileDetect, check that the variable is set before calling any methods to prevent errors during upgrades or if the add-on is disabled.

HTML:
<xf:if is="$xf.mobileDetect && $xf.mobileDetect.isMobile()">
    Is Mobile
<xf:else />
    Not Mobile
</xf:if>

HTML:
<xf:if is="$xf.mobileDetect && $xf.mobileDetect.is('Firefox')">
    Is Firefox
<xf:else />
    Not Firefox
</xf:if>

HTML:
<xf:if is="$xf.mobileDetect && $xf.mobileDetect.is('Chrome')">
    Is Chrome
<xf:else />
    Not Chrome
</xf:if>

PHP:

PHP:
$mobileDetect = \SV\BrowserDetection\Listener::getMobileDetection();
$isMobile = $mobileDetect && $mobileDetect->isMobile() ? "_m1" : "_m0";

Mobil algılama için aşağıdaki kodu config.php dosyasına ekleyin:

Kod:
$config['pageCache']['onSetup'] = function (\XF\PageCache $pageCache) {
    $pageCache->setCacheIdGenerator(function(\XF\Http\Request $request) {
        return \SV\BrowserDetection\CacheHelper::getPageCacheId($request);
    });
};

Benzer kaynaklar

AndyB - Attachment browser TRXFTR
Eklenti, üye profilinde eklediği ekleri göstermeye olanak tanır.
Forum Copilot - Automatic Spam and NSFW Image Detection with OpenAI ChatGPT TRXFTR
Eklenti, OpenAI ChatGPT API'sini kullanarak Spam ve NSFW içeriğini otomatik onay sırasına taşır.
[XenBg] AdBlock Detection TRXFTR
Eklenti, AdBlock etkinleştirmiş kullanıcıları belirlemeye olanak tanır.
Geri
Üst