dedecms列表arclist,如何列出主栏目和副栏目内容

2016-02-25 540 0

织梦arclist调用副栏目不显示的解决办法:

打开/include/taglib/arclist.lib.php,代码约位于295-296行,查找以下两行代码:

if($CrossID=='') $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).')';
else $orwheres[] = ' arc.typeid IN ('.GetSonIds($typeid).','.$CrossID.')';

改成

$vicewheres = "";
$typeids = explode(",",GetSonIds($typeid));
$crossids = explode(",",$CrossID);
$typeidss = array_merge($typeids,$crossids);
$typeidss = array_unique($typeidss);
foreach($typeidss as $tid){
$liketypeid2 = ",".$tid.",";
$vicewheres.= " or CONCAT(',',arc.typeid2,',') like '%$liketypeid2%' ";
}
if($CrossID==''){
if($vicewheres!="")
$orwheres[] = ' (arc.typeid in ('.GetSonIds($typeid).') '.$vicewheres.') ';
else
$orwheres[] = ' arc.typeid in ('.GetSonIds($typeid).') ';
}else{
if($vicewheres!="")
$orwheres[] = ' (arc.typeid in ('.GetSonIds($typeid).','.$CrossID.') '.$vicewheres.') ';
else
$orwheres[] = ' arc.typeid in ('.GetSonIds($typeid).','.$CrossID.') ';
}

相关文章

dedecms清空文章,保持ID从1开始
修改DedeCMS系统数据库表前缀的方法
dedecms专题模版{dede:field.note/}样式修改
dedecms专题节点分页方法
dedecms专题目录生成路径
dedecms自由列表,实现全站文章列表

发布评论