POST TIME:2020-04-10 18:40
DEDECMS的功能已经非常强大,但是需要也是在不断需要的,我们有时也需要去更改一下系统的某些功能,比如说我今天就需要arclist标签能调用副栏目的文章,只需要更改/include/taglib/arclist.lib.php
把
if($CrossID=='') $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).')'; else $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).','.$CrossID.')';替换为
if($CrossID=='') { $orwheres[] = ' (arc.typeid in ('.GetSonIds($typeid).') or arc.typeid2 in ('.GetSonIds($typeid).'))'; } else { $orwheres[] = ' (arc.typeid in ('.GetSonIds($typeid).','.$CrossID.') or arc.typeid2 in ('.GetSonIds($typeid).','.$CrossID.'))'; }之前我没有加括号,造成了很严重的问题。
修改完成后是下面这样
//if($CrossID=='') $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).')'; //else $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).','.$CrossID.')'; if($CrossID=='') { $orwheres[] = ' (arc.typeid in ('.GetSonIds($typeid).') or arc.typeid2 in ('.GetSonIds($typeid).'))'; } else { $orwheres[] = ' (arc.typeid in ('.GetSonIds($typeid).','.$CrossID.') or arc.typeid2 in ('.GetSonIds($typeid).','.$CrossID.'))'; }