现在用平板ipad不管是那个型号平板都会自动访问disicuz的电脑端PC界面,这样体验不是很好,如何让他访问手机版或者触屏版手机模板呢,下面教大家如何解决discuz论坛ipad平板访问使用手机模板的问题这个问题。
找到打开这文件个 discuz/source/function/function_core.php 修改为如下:
- 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', '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', 'smartphone',
- 'iemobile', 'spice', 'bird', 'zte-', 'longcos', 'pantech', 'gionee', 'portalmmm', 'jig browser', 'hiptop',
- 'benq', 'haier', '^lct', '320x320', '240x320', '176x220', 'windows phone',***'ipad'***);
- static $wmlbrowser_list = array('cect', 'compal', 'ctl', 'lg', 'nec', 'tcl', 'alcatel', 'ericsson', 'bird', 'daxian', 'dbtel', 'eastcom',
- 'pantech', 'dopod', 'philips', 'haier', 'konka', 'kejian', 'lenovo', 'benq', 'mot', 'soutec', 'nokia', 'sagem', 'sgh',
- 'sed', 'capitel', 'panasonic', 'sonyericsson', 'sharp', 'amoi', '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';
- }
复制代码 1、static $pad_list = array(‘ipad’); 注释掉
2、 $touchbrowser_list 里面添加值: ipad
- 1、***//static $pad_list = array('ipad');***注释掉六颗星
- 2、 $touchbrowser_list 里面添加值: ipad以上代码
- 'benq', 'haier', '^lct', '320x320', '240x320', '176x220', 'windows phone',***'ipad'***);注释掉六颗星
复制代码
|