织梦手机站搜索与PC同步的方法
之前介绍过织梦手机站搜索与PC站搜索结果一样的解决方法,后来测试发现此方法仅支持织梦默认移动程序。
下面介绍织梦手机站搜索与PC同步的方法:
1、找到/plus/search.php文件,复制一份重命名为search_m.php,这里随意命名都行。
2、找到/include/arc.searchview.class.php文件,复制一份重命名为arc.searchview.class_m.php,这里文件名也可随意。
3、打开新的search_m.php文件,找到:
require_once(DEDEINC."/arc.searchview.class.php");
改成:
require_once(DEDEINC."/arc.searchview.class_m.php");
4、在新的arc.searchview.class_m.php文件中找打
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search.htm";
改成:
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/search_m.htm";
5、在搜索模板找到相应代码按如下所示更改:
<form action="{dede:global.cfg_cmsurl/}/plus/search_m.php" name="formsearch"> <input type="hidden" name="kwtype" value="0"/> <input type="hidden" name="mobile" value="1" /> <input type="text" name="q" class="txt fl" placeholder="想看什么?输入名称试试..."> <input type="submit" name="button" class="btn fr"> </form>
注意:搜索模板名称要改成“search_m.htm”,search_m.php是PC目录下的文件,另外css、js、images路径需要更改。
以上操作完成,如有搜索结果页面的分页无法使用自带标签控制,可以按如下方法修改:
在新的arc.searchview.class_m.php文件中大概856行找打找到:
//获得上一页和下一页的链接 if($this->PageNo != 1)
这里可以去掉td标签修改成自己想要的样式。
继续找到876行一直到906行左右:
//获得数字链接 $listdd=""; $total_list = $list_len * 2 + 1; if($this->PageNo >= $total_list) { $j = $this->PageNo - $list_len; $total_list = $this->PageNo + $list_len; if($total_list > $totalpage) { $total_list = $totalpage; } } else { $j=1; if($total_list > $totalpage) { $total_list = $totalpage; } } for($j; $j<=$total_list; $j++) { if($j == $this->PageNo) { $listdd.= "<td>$j </td>\r\n"; } else { $listdd.="<td><a href='".$purl."PageNo=$j'>[".$j."]</a> </td>\r\n"; } }
这一段代码全部注释或者删掉。
继续找到916到920行直接的代码并注释或者删掉。
if($totalpage>$total_list) { $plist.="<td width='38'><input type='text' name='PageNo' style='width:28px;height:14px' value='".$this->PageNo."' /></td>\r\n"; $plist.="<td width='30'><input type='submit' name='plistgo' value='GO' style='width:30px;height:22px;font-size:9pt' /></td>\r\n"; }
至此,全部完成。
免责声明:本站所有文章和图片均来自用户分享和网络收集,文章和图片版权归原作者及原出处所有,仅供学习与参考,请勿用于商业用途,如果损害了您的权利,请联系网站客服处理。
☉本站的源码不会像其它下载站一样植入大量的广告。为了更好的用户体验以后坚持不打水印
☉本站只提供精品织梦源码,源码在于可用,不在多!!希望在这里找到你合适的。
☉本站提供的整站织梦程序,均带数据及演示地址。可以在任一源码详情页查看演示地址
☉本站所有资源(包括源码、模板、素材、特效等)仅供学习与参考,请勿用于商业用途。
☉如有其他问题,请加网站客服QQ进行交流。
- dedecms SQL注入漏洞 member/album_add.php 修复
- dedecms cookies泄漏导致SQL漏洞 /member/article_add
- Windows虚拟主机指定目录禁用脚本执行权限方法
- 西部数码虚拟主机设置禁止脚本执行权限
- 阿里云主机设置织梦程序禁止脚本执行权限及禁止写入
- dedecms织梦导致CPU峰值现象的解决办法
- 织梦程序网站被挂马或快照劫持终极解决办法
- 阿里云提醒/member/reg_new.php注入漏洞解决办法
- 织梦安全:更改plus名称
- 织梦栏目属性增加链接rel、nofollow和新窗口target
- 织梦问答模块PHP7报错解决方法
- dedecms解决移动端首页不自动更新问题