DiscuzX3 Open Mobile version, access to the site will automatically determine whether it comes from the desktop or mobile, how is it done?

Source: Internet
Author: User
Is it a judgment done in PHP, or is it done in Web server?
Is it in the index.php? This file has been processed in front of the host, but does not see the logic associated with the user agent. Want to ask the discuzX3 is where, how to make a judgment?
Thank you ~

Reply content:

Is it a judgment done in PHP, or is it done in Web server?
Is it in the index.php? This file has been processed in front of the host, but does not see the logic associated with the user agent. Want to ask the discuzX3 is where, how to make a judgment?
Thank you ~

没看到和user agent有关的逻辑

You didn't find it!

function Checkmobile () {Global $_g;    $mobile = Array (); Static $touchbrowser _list =array (' iphone ', ' Android ', ' phone ', ' mobile ', ' wap ', ' NetFront ', ' Java ', ' opera Mobi ', ' opera M ' INI ', ' ucweb ', ' Windows CE ', ' Symbian ', ' series ', ' webOS ', ' Sony ', ' BlackBerry ', ' dopod ', ' Nokia ', ' Samsung                ', ' palmsource ', ' xda ', ' pieplus ', ' Meizu ', ' MIDP ', ' CLDC ', ' Motorola ', ' Foma ', ' DoCoMo ', ' Up.browser ',                ' Up.link ', ' blazer ', ' helio ', ' hosin ', ' Huawei ', ' Novarra ', ' Coolpad ', ' webOS ', ' techfaith ', ' PalmSource ', ' Alcatel ', ' Amoi ', ' Ktouch ', ' Nexian ', ' Ericsson ', ' Philips ', ' Sagem ', ' wellcom ', ' Bunjalloo ', ' Maui ', ' SMARTP ' Hone ', ' iemobile ', ' spice ', ' bird ', ' zte-', ' longcos ', ' Pantech ', ' Gionee ', ' portalmmm ', ' Jig browser ', ' Hi    Ptop ', ' BenQ ', ' Haier ', ' ^lct ', ' 320x320 ', ' 240x320 ', ' 176x220 ', ' windows Phone '); static $wmlbrowser _list = Array (' Cect ', ' compal ', ' ctl ', ' LG ', ' nec ', ' tcl ', ' Alcatel ', ' Ericsson ', ' B 'Ird ', ' Daxian ', ' Dbtel ', ' eastcom ', ' Pantech ', ' Dopod ', ' Philips ', ' Haier ', ' Konka ', ' Kejian ', ' Lenovo ', ' BenQ ' , ' mot ', ' Soutec ', ' Nokia ', ' Sagem ', ' sgh ', ' sed ', ' capitel ', ' Panasonic ', ' SonyEricsson ', ' sharp ', ' amoi ', ' PA    NDA ', ' ZTE ');    static $pad _list = Array (' ipad ');    $useragent = Strtolower ($_server[' http_user_agent ');    if (Dstrpos ($useragent, $pad _list)) {return false;        } if ($v = Dstrpos ($useragent, $touchbrowser _list, True)) {$_g[' mobile '] = $v;    Return ' 2 ';        } if ($v = Dstrpos ($useragent, $wmlbrowser _list))) {$_g[' mobile '] = $v; Return ' 3 ';    WML Edition} $brower = Array (' Mozilla ', ' Chrome ', ' Safari ', ' opera ', ' m3gate ', ' winwap ', ' Openwave ', ' myop ');    if (Dstrpos ($useragent, $brower)) return false;    $_g[' mobile '] = ' unknown ';    if (Isset ($_g[' mobiletpl '][$_get[' mobile '])) {return true;    } else {return false; }}
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.