位置: IT常识 - 正文
推荐整理分享织梦手机站搜索后显示是电脑端的搜索结果模板的解决方法(织梦怎么建站),希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:织梦如何采集文章,织梦cms怎么样,织梦设置的关键词看不到,织梦怎么建站,织梦cms官网,织梦怎么建站,织梦cms官网,织梦怎么建站,内容如对您有帮助,希望把文章链接给更多的朋友!
有使用织梦dedecms最新程序移动版的同学肯定遇到过,手机版搜索结果跳转到的是电脑版搜索结果页面去了。
解决方法
1、在手机站模板的搜索框代码上加入 <input type="hidden" name="mobile" value="1" />
action用电脑站的/plus/search.php ,如下
<form name="formsearch" action="{dede:global.cfg_basehost/}/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>2、打开 /plus/search.php 找到
$mid = (isset($mid) && is_numeric($mid)) ? $mid : 0;
在它的下面加入
if($mobile==1) define('DEDEMOB', 'Y');
3、打开 /include/arc.searchview.class.php 找到
$purl .= "?".$geturl;
在它上面加入
if(defined('DEDEMOB'))$geturl .= "mobile=1&";
这样修改后,织梦移动站的搜索结果模板就是 search_m.htm ,搜索结果就可以显示为移动站的了。
免责
下一篇:phpcms中默认站点怎么填(php的默认网站目录是)
友情链接: 武汉网站建设