在搜索框表单里加个typeid提交过去
<form name="formsearch" action="/plus/search.php"> <input type="hidden" name="typeid" value="1,2,3"> </form>
在/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).") "; }
完成
织梦二次开发QQ群
本站客服QQ号:862782808(点击左边QQ号交流),群号(383578617) 如果您有任何织梦问题,请把问题发到群里,阁主将为您写解决教程!
转载请注明: 织梦模板 » 织梦搜索指定多个栏目的文档