自丢网

标题: dz!x论坛程序ipad平板访问使用手机模板的问题解决方案教程 [打印本页]

作者: admin    时间: 2020-2-20 17:58
标题: dz!x论坛程序ipad平板访问使用手机模板的问题解决方案教程
现在用平板ipad不管是那个型号平板都会自动访问disicuz的电脑端PC界面,这样体验不是很好,如何让他访问手机版或者触屏版手机模板呢,下面教大家如何解决discuz论坛ipad平板访问使用手机模板的问题这个问题。
找到打开这文件个  discuz/source/function/function_core.php  修改为如下:
  1. function checkmobile() {
  2.     global $_G;
  3.     $mobile = array();
  4.     static $touchbrowser_list =array('iphone', 'android', 'phone', 'mobile', 'wap', 'netfront', 'java', 'opera mobi', 'opera mini',
  5.                 'ucweb', 'windows ce', 'symbian', 'series', 'webos', 'sony', 'blackberry', 'dopod', 'nokia', 'samsung',
  6.                 'palmsource', 'xda', 'pieplus', 'meizu', 'midp', 'cldc', 'motorola', 'foma', 'docomo', 'up.browser',
  7.                 'up.link', 'blazer', 'helio', 'hosin', 'huawei', 'novarra', 'coolpad', 'webos', 'techfaith', 'palmsource',
  8.                 'alcatel', 'amoi', 'ktouch', 'nexian', 'ericsson', 'philips', 'sagem', 'wellcom', 'bunjalloo', 'maui', 'smartphone',
  9.                 '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.     ***//static $pad_list = array('ipad');***
  15.     $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
  16.     if(dstrpos($useragent, $pad_list)) {
  17.         return false;
  18.     }
  19.     if(($v = dstrpos($useragent, $touchbrowser_list, true))){
  20.         $_G['mobile'] = $v;
  21.         return '2';
  22.     }
复制代码
1、static $pad_list = array(‘ipad’); 注释掉
2、 $touchbrowser_list 里面添加值: ipad
  1. 1、***//static $pad_list = array('ipad');***注释掉六颗星
  2. 2、 $touchbrowser_list 里面添加值: ipad以上代码
  3. 'benq', 'haier', '^lct', '320x320', '240x320', '176x220', 'windows phone',***'ipad'***);注释掉六颗星
复制代码






欢迎光临 自丢网 (https://www.zidiu.com/) Powered by Discuz! X3.5