導讀:織夢技術織夢技術針對織夢高級開發教程會用到,指定欄目搜索及多個欄目合并搜索的要求。織夢DedeCMS默認的搜索可以搜索全部欄目或者指定的搜索某一個欄目,不能搜索指定的多個欄目,dede網站模板夢織模板。
針對織夢高級開發教程會用到,指定欄目搜索及多個欄織夢模板目合并搜索的要求。織夢DedeCMS默認的搜索可以搜索全部欄目或者指定的搜索某一個欄目,不能搜索指定的多個欄目,需要修改后臺文件才能實現。
1、在搜索框表單里加個typeid提交過去
例如
<form name="search" action="/plus/search.php">
<input type="hidden" name="typeid" value="1,2,3">
</form>
|
2、打開/plus/search.php找到
$typeid = (isset($typeid) && is_numeric($typeid)) ? $typeid : 0;
|
刪除這一行后,繼續找到
$typeid = intval($typeid);
|
也刪除這一行
3、打開 /include/arc.searchview.class.php 找到
$ksqls[] = " typeid IN (&qdede會員中心模板uot;.GetSonIds($this->TypeID).") ";
|
改成
//指定了多個欄目時
if( preg_match('#,#', $this->TypeID) )
{
$typeids = explode(',', $this->TypeID);
foreach($typeids as $ttid) {
$typeidss[] = GetSonIds($ttid);
}
$typeidStr = join(',', $typeidss);
$typeidss = explode(',', $typeidStr);
$typeidssok = array_unique($typeidss);
$typeid = join(',', $typeidssok);
$ksqls[] = " arc.typeid IN ($typeid) ";
}
else
{
$ksqls[] = " arc.typeid IN (".GetSonIds($this-&g織夢模板修改t;TypeID).") ";
}
|
完成,這樣就可以搜索指定的多個欄目的文章了。相關dede網站模板夢織模板。
關鍵詞標簽: 欄目 CMS 多個
聲明: 本文由我的SEOUC技術文章主頁發布于:2023-07-17 ,文章織夢DedeCMS搜索指定多個欄目的文檔,織夢技術主要講述多個,欄目,CMS網站建設源碼以及服務器配置搭建相關技術文章。轉載請保留鏈接: http://www.bifwcx.com/article/web_28550.html