Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

coolpad手机useragent问题

[复制链接]
hjh_01 发表于 2014-6-11 11:13:43 | 显示全部楼层 |阅读模式
  1. <?php
  2. #function_core.php  
  3. #function checkmobile
  4. $pad_list = array('pad', 'gt-p1000');
  5. if(dstrpos($useragent, $pad_list)) {
  6.         return false;
  7. }

复制代码

对于酷派手机(coolpad),useragent中带有coolpad.
function_core.php中的checkmobile方法会先判断手机属于pad类型,从而使coolpad手机无法访问手机版页面~~
 楼主| hjh_01 发表于 2014-6-12 09:24:03 | 显示全部楼层
每日一顶啊~~~~
回复

使用道具 举报

氪星辉 发表于 2014-7-9 19:23:30 | 显示全部楼层
恩,我也遇到了这个问题。把几行代码改一下就行了。
$pad_list = array('pad', 'gt-p1000');
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
if(dstrpos($useragent, $pad_list)) {
   ....
}
改成了
$pad_list = array('pad', 'gt-p1000');
$wpad_list = array('coolpad');
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
if(!dstrpos($useragent, $wpad_list) && dstrpos($useragent, $pad_list)) {
    ....
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-3-13 13:58 , Processed in 0.035284 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表