織夢系統-手機端搜索頁面跳轉到電腦端問題解決方法
阿新 • • 發佈:2017-09-09
numeric name inpu 電腦 使用 sea 顯示 spa 童鞋
使用dedecms最新程序移動版的童鞋如果遇到,手機版搜索結果跳轉到的是電腦版搜索結果頁面去;
解決方法
移動版模板搜索代碼中要帶有(下面標紅的代碼)
<form name="formsearch" action="/plus/search.php">
<input type="hidden" name="pagesize" value="15">
<input type="hidden" name="kwtype" value="0"/>
<input type="hidden" name="mobile" value="1" />
<input name="q" type="text" placeholder="輸入關鍵詞">
<button type="submit">搜索</button>
</form>
然後打開 \plus\search.php 找到
$mid = (isset($mid) && is_numeric($mid)) ? $mid : 0;
在它的下面加入
if ( $mobile==1 )
{
define(‘DEDEMOB‘, ‘Y‘);
}
移動版的搜索結果模板就是search_m.htm,搜索結果就可以顯示為移動版了
織夢系統-手機端搜索頁面跳轉到電腦端問題解決方法