When discuzX3 is enabled for the mobile phone version, the website will automatically determine whether it is from the desktop or mobile end. How can this problem be solved?

Source: Internet
Author: User
Is it in PHP or webserver? Is it in index. php? The host is processed before this file, but the logic related to useragent is not seen. I would like to know where discuzX3 is and how to judge it? Thank you ~ Is it in PHP or in web server?
Is it in index. php? The host is processed before the file, but no logic related to the user agent is found. I would like to know where discuzX3 is and how to judge it?
Thank you ~

Reply content:

Is it in PHP or in web server?
Is it in index. php? The host is processed before the file, but no logic related to the user agent is found. I would like to know where discuzX3 is and how to judge it?
Thank you ~

No user agent-related logic is found.

You did not find it!

Function checkmobile () {global $ _ G; $ mobile = array (); static $ touchbrowser_list = array ('iphone ', 'android', 'phone', 'mobile ', 'wap ', 'netfront', 'java', 'Opera mobi', 'Opera mini ', 'ucweb', 'windows ce', 'symbian ', 'series ', 'webos ', 'sony', 'blackberry ', 'dopod', 'nokia ', 'samsung', 'palmsource', 'xda', 'pieplus ', 'meizu ', 'midp ', 'cldc', 'motorola', 'fom', 'docomo', 'Up. browser ', 'Up. link ', 'blazer', 'helio', 'hosin ', 'huawei', 'novara', 'coolpad ', 'webos', 'techfaith ', 'palmsource ', 'alcatel', 'amodi', 'ktouch', 'nexian ', 'ericsson', 'philips ', 'sagem', 'wellcom', 'bunjalloo', 'maui ', 'smartphone', 'iemobile ', 'spice', 'bird ', 'zte-', 'longcos ', 'pantech', 'gionee ', 'portalmmm ', 'jig browser ', 'hiptop', 'benq', 'haier ',' ^ lct ', '320x320', '240x320', '176x220', 'windows phone '); static $ wmlbrowser_list = array ('cect ', 'compal', 'ctl', 'lg ', 'nec', 'tcl ', 'alcatel', 'ericsson ', 'bird ', 'daxian', 'dbtel ', 'eastcom', 'pantech', 'dopo', 'philips ', 'haier', 'konka ', 'kejian ', 'lenovo ', 'benq', 'mot', 'soutec', 'nokia ', 'sagem', 'sgh', 'sed ', 'capitel', 'panasonic ', 'sonyericsson ', 'sharp', 'amodi', 'panda', '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 version} $ brower = array ('mozilla ', 'chromi', 'safari', 'Opera ', 'mshortate', 'winwap', 'openwave ', 'myop'); if (dstrpos ($ useragent, $ brower) return false; $ _ G ['mobile'] = 'unknown '; if (isset ($ _ G ['letletpl'] [$ _ GET ['mobile']) {return true;} else {return false ;}}

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.