织梦搜索指定多个栏目的文档

2022-08-18

在搜索框表单里加个typeid提交过去    




在/plus/search.php 找到

$typeid = (isset($typeid) && is_numeric($typeid)) ? $typeid : 0;

注销或者删除它

继续找到

$typeid = intval($typeid);

注销或者删除它

最后打开 \include\arc.searchview.class.php 找到

$ksqls[] = " typeid IN (".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->TypeID).") ";
}

完成

非凡技术导航 优秀网址导航免费网站收录 网站地图

本站收录的网站若侵害到您的利益,请联系我们删除处理

Copyright ©2020 Guojiz V 5.5All Rights Reserved.

备案号 )| 452133545|