您的位置:首页 > 运维架构 > 网站架构

dedecms中英文网站之中英文搜索结果实现方法

2014-11-07 12:07 525 查看
本文实例讲述了dedecms中英文网站之中英文搜索结果实现方法。分享给大家供大家参考。具体实现方法如下:

一般来说,我们使用DEDECMS***中英文站时,需要在中文站上只搜索出中文站的内容,而在英文站只会搜索出英文站中的内容,此时就需要给英文站搜索栏目单独做个模板出来,可以按以下方法来实现.

复制plus目录下的serach.php文件 把复制后的更名为 searche.php做为新的搜索文件.

编辑searche.php,找到此行代码
require_once(DEDEINC."/arc.searchview.class.php");
替换为:
require_once(DEDEINC."/arc.searchviewen.class.php");


复制include目录下的 arc.searchview.class.php文件并更名为 arc.searchviewen.class.php

编辑arc.searchviewen.class.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_en.htm";


复制模板中的search.htm,并更名为search_en.htm,此时英文站的模板都已做好,找到英文站的相关搜索代码,如下以示例:
<form action="/plus/searche.php" method="post"></p>
<p><input type="hidden" name="typeid" value="26" />

其中的/plus/searche.php,用searche.php去搜索,name="typeid" value="26" 这个是指定栏目ID.

希望本文所述对大家的dedecms二次开发有所帮助。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: