网友提供了一个齐博v7使用v9手机端的方法,由于时间关系我还没有实际操作,先保留下来,回头有空测试后再修改标题,当前,仅作资料存档。
一、修改inc目录下的function.inc.php文件,在里面添加如下代码:
/检查是否为手机访问 function is_mobile(){ $regex_match="/(iPad|nokia|iphone|android|motorola|^mot\-|softbank|foma|docomo|kddi|up\.browser|up\.link|"; $regex_match.="htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|"; $regex_match.="blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam\-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|"; $regex_match.="symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte\-|longcos|pantech|gionee|^sie\-|portalmmm|"; $regex_match.="jig\s browser|hiptop|^ucweb|^benq|haier|^lct|opera\s*mobi|opera\*mini|320x320|240x320|176x220"; $regex_match.=")/i"; return isset($_SERVER['HTTP_X_WAP_PROFILE']) or isset($_SERVER['HTTP_PROFILE']) or preg_match($regex_match, strtolower($_SERVER['HTTP_USER_AGENT'])); }
二、修改inc目录下的common.inc.php文件,在里面添加如下代码:
$IsMob = is_mobile(); //判断是否手机浏览然后在do目录下的index.php,list.php,bencandy.php,alonepage.php,里面分别添加如下代码:
列表页面添加 if($IsMob){ header("location:waplist.php?fid=$fid"); exit; } 主页添加 if($IsMob){ header("location:wapindex.php"); exit; } 内容页添加 if($IsMob){ header("location:wapbencandy.php?fid=$fid&id=$id"); exit; } 独立页面添加 if($IsMob){ header("location:wapalonepage.php?id=$id"); exit; }
三、把手机版模板代码放入相应模板目录下即可开始使用。
百度已收录!