久久久久av_欧美日韩一区二区在线_国产精品三区四区_日韩中字在线

Discuz! 官方交流社區

標題: 解決discuz論壇ipad平板訪問使用手機模板的問題 [打印本頁]

作者: 人民群眾    時間: 2019-6-16 03:12
標題: 解決discuz論壇ipad平板訪問使用手機模板的問題
本人親自測試過~
現在用平板ipad不管是那個型號平板都會自動訪問disicuz的電腦端PC界面,這樣體驗不是很好,如何讓他訪問手機版或者觸屏版手機模板呢,下面教大家如何解決discuz論壇ipad平板訪問使用手機模板的問題這個問題。
找到打開這文件個  discuz/source/function/function_core.php  修改為如下:


  1. function checkmobile() {
  2. 02
  3.     global $_G;
  4. 03
  5.     $mobile = array();
  6. 04
  7.     static $touchbrowser_list =array('iphone', 'android', 'phone', 'mobile', 'wap', 'netfront', 'java', 'opera mobi', 'opera mini',
  8. 05
  9.                 'ucweb', 'windows ce', 'symbian', 'series', 'webos', 'sony', 'blackberry', 'dopod', 'nokia', 'samsung',
  10. 06
  11.                 'palmsource', 'xda', 'pieplus', 'meizu', 'midp', 'cldc', 'motorola', 'foma', 'docomo', 'up.browser',
  12. 07
  13.                 'up.link', 'blazer', 'helio', 'hosin', 'huawei', 'novarra', 'coolpad', 'webos', 'techfaith', 'palmsource',
  14. 08
  15.                 'alcatel', 'amoi', 'ktouch', 'nexian', 'ericsson', 'philips', 'sagem', 'wellcom', 'bunjalloo', 'maui', 'smartphone',
  16. 09
  17.                 'iemobile', 'spice', 'bird', 'zte-', 'longcos', 'pantech', 'gionee', 'portalmmm', 'jig browser', 'hiptop',
  18. 10
  19.                 'benq', 'haier', '^lct', '320x320', '240x320', '176x220', 'windows phone',***'ipad'***);
  20. 11
  21.     static $wmlbrowser_list = array('cect', 'compal', 'ctl', 'lg', 'nec', 'tcl', 'alcatel', 'ericsson', 'bird', 'daxian', 'dbtel', 'eastcom',
  22. 12
  23.             'pantech', 'dopod', 'philips', 'haier', 'konka', 'kejian', 'lenovo', 'benq', 'mot', 'soutec', 'nokia', 'sagem', 'sgh',
  24. 13
  25.             'sed', 'capitel', 'panasonic', 'sonyericsson', 'sharp', 'amoi', 'panda', 'zte');
  26. 14

  27. 15
  28.     ***//static $pad_list = array('ipad');***
  29. 16

  30. 17
  31.     $useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
  32. 18

  33. 19
  34.     if(dstrpos($useragent, $pad_list)) {
  35. 20
  36.         return false;
  37. 21
  38.     }
  39. 22
  40.     if(($v = dstrpos($useragent, $touchbrowser_list, true))){
  41. 23
  42.         $_G['mobile'] = $v;
  43. 24
  44.         return '2';
  45. 25
  46.     }
復制代碼
1、static $pad_list = array(‘ipad’); 注釋掉

2、 $touchbrowser_list 里面添加值: ipad



作者: 人民群眾    時間: 2019-6-16 03:17
1、***//static $pad_list = array('ipad');***注釋掉六顆星
2、 $touchbrowser_list 里面添加值: ipad以上代碼
'benq', 'haier', '^lct', '320x320', '240x320', '176x220', 'windows phone',***'ipad'***);注釋掉六顆星

作者: susongren    時間: 2019-10-26 15:11
我按照這樣修改了還是不行
作者: 學習運營    時間: 2019-10-29 20:18
好用,感謝分享

(, 下載次數: 45)





歡迎光臨 Discuz! 官方交流社區 (http://www.9999xn.com/) Powered by Discuz! W1.0