{dede:arclist row='2' titlelen='100'typeid=2 orderby='id' }
[field:typename/]
[field:typeid2 function="get_url_by_typeid2(@me)"/]
{/dede:arclist}
函数代码,在includeextend.func.php 中增加如下代码:
//得到副栏目信息,并组织字符串
function get_url_by_typeid2($typeid2){ $arrs=explode(",",$typeid2);//解析副栏目字段 if($typeid2==0){ return ''; }else{ $url=''; foreach($arrs as $v){ $url.=''.get_typename($v).''; } return $url; } }
//织梦根据栏目编号typeid调用typename栏目名
function get_typename($typeid){
global $dsql;
$rs=$dsql->getOne("select typename from arctype where id='$typeid'");
return $rs['typename'];
}
注意:织梦标签artlist不能调用副栏目中的文章内容的问题,即文章属于互联网这个副栏目,但互联网栏目中却不显示这个文章。需要修改系统文件./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).") or CONCAt( ',', arc.typeid2, ',' ) LIKE '%,".$typeid.",%' )";
else
$orwheres[] = " (arc.typeid in (".GetSonIds($typeid).",".$CrossID.") or arc.typeid2 in (".GetSonIds($typeid).",".$CrossID.") or CONCAt( ',', arc.typeid2, ',' ) LIKE '%,".$typeid.",%')";
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)