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[] = " arc.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).") ";
}
本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!