跳转页面需要修改
搜索的form添加属性
<form action="/plus/search.php" name="formsearch" method="get" target="_blank">
<input type="hidden" name="keytype" value="0" />
<input type="text" class="shuru" placeholder="信息搜索" name="q">
<input type="image" class="ss_anniu" src="/skin/img/ss1.png">
</form>
1.form整行 2.隐藏input 3.输入框name="q"
正常使用织梦标签(channelartlist,arclist)
打开include/arc.searchview.class.PHP
查找:
require_once(DEDEINC."/taglib/hotwords.lib.php");
require_once(DEDEINC."/taglib/channel.lib.php");
在下面加入:
require_once(DEDEINC."/taglib/arclist.lib.php");
require_once(DEDEINC."/taglib/channelartlist.lib.php");
找到:
else if($tagname=="hotwords")
{
$this->dtp->Assign($tagid,lib_hotwords($ctag,$this));
}
在下面插入:
else if($tagname=="arclist")
{
$this->dtp->Assign($tagid,lib_arclist($ctag,$this));
}
else if($tagname=="channelartlist")
{
$this->dtp->Assign($tagid,lib_channelartlist($ctag,$this));
}
这样就可在dedecms织梦搜索页面使用arclist和channelartlist标签调用数据了。
搜索指定栏目
在模板搜索代码中加入 “<input type='hidden' name='typeid' value="栏目ID号">” 即可
搜索指定多个栏目(好像不用二开直接用就行)
http://www.dede58.com/a/dedejq/8429.html
搜索页页码
打开include/arc.searchview.class.php
修改GetPageListDM方法的内容
中英文分别搜索
在使用织梦dedecms制作中英文站时,需要在中文站中只搜索出中文站的内容,而在英文站中只搜索出英文站的内容,此时就需要给英文站搜索栏目单独做个模板出来,可以按以下方法来实现.
1.复制 plus 目录下的 serach.php 文件,并更名为 search_en.php 做为新的搜索文件.
打开搜索
require_once(DEDEINC."/arc.searchview.class.php");
替换为
require_once(DEDEINC."/arc.searchview_en.class.php");
2.复制 include 目录下的 arc.searchview.class.php 文件,并更名为 arc.searchview_en.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";
3.复制模板中的 search.htm ,并更名为 search_en.htm ,此时英文站的模板都已做好,找到英文站的相关搜索代码,如下以示例:
<form action="/plus/search_en.php" method="post"></p> <p><input type="hidden" name="typeid" value="6" />
其中的 /plus/search_en.php ,用 search_en.php 去搜索,name="typeid" value="6" 这个是指定栏目ID.