本人亲自测试过~
现在用平板ipad不管是那个型号平板都会自动访问disicuz的电脑端PC界面,这样体验不是很好,如何让他访问手机版或者触屏版手机模板呢,下面教大家如何解决discuz论坛ipad平板访问使用手机模板的问题这个问题。
找到打开这文件个 discuz/source/function/function_core.php 修改为如下:
- function checkmobile() {
- 02
- global $_G;
- 03
- $mobile = array();
- 04
- static $touchbrowser_list =array('iphone', 'android', 'phone', 'mobile', 'wap', 'netfront', 'java', 'opera mobi', 'opera mini',
- 05
- 'ucweb', 'windows ce', 'symbian', 'series', 'webos', 'sony', 'blackberry', 'dopod', 'nokia', 'samsung',
- 06
- 'palmsource', 'xda', 'pieplus', 'meizu', 'midp', 'cldc', 'motorola', 'foma', 'docomo', 'up.browser',
- 07
- 'up.link', 'blazer', 'helio', 'hosin', 'huawei', 'novarra', 'coolpad', 'webos', 'techfaith', 'palmsource',
- 08
- 'alcatel', 'amoi', 'ktouch', 'nexian', 'ericsson', 'philips', 'sagem', 'wellcom', 'bunjalloo', 'maui', 'smartphone',
- 09
- 'iemobile', 'spice', 'bird', 'zte-', 'longcos', 'pantech', 'gionee', 'portalmmm', 'jig browser', 'hiptop',
- 10
- 'benq', 'haier', '^lct', '320x320', '240x320', '176x220', 'windows phone',***'ipad'***);
- 11
- static $wmlbrowser_list = array('cect', 'compal', 'ctl', 'lg', 'nec', 'tcl', 'alcatel', 'ericsson', 'bird', 'daxian', 'dbtel', 'eastcom',
- 12
- 'pantech', 'dopod', 'philips', 'haier', 'konka', 'kejian', 'lenovo', 'benq', 'mot', 'soutec', 'nokia', 'sagem', 'sgh',
- 13
- 'sed', 'capitel', 'panasonic', 'sonyericsson', 'sharp', 'amoi', 'panda', 'zte');
- 14
-
- 15
- ***//static $pad_list = array('ipad');***
- 16
-
- 17
- $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
- 18
-
- 19
- if(dstrpos($useragent, $pad_list)) {
- 20
- return false;
- 21
- }
- 22
- if(($v = dstrpos($useragent, $touchbrowser_list, true))){
- 23
- $_G['mobile'] = $v;
- 24
- return '2';
- 25
- }
复制代码 1、static $pad_list = array(‘ipad’); 注释掉
2、 $touchbrowser_list 里面添加值: ipad
|
|