|
标签调用代码
{dede:arclist row='2' titlelen='100'typeid=2 orderby='id' }
[url=,[field:typename/][/url]
[field:typeid2 function="get_url_by_typeid2(@me)"/]
{/dede:arclist}
函数代码,在\include\extend.func.php 中增加如下代码:
//得到副栏目信息,并组织字符串
function get_url_by_typeid2($typeid2){
$arrs=explode(",",$typeid2);//解析副栏目字段
if($typeid2==0){
return '';
}else{
$url='';
foreach($arrs as $v){
$url.='[url=,'.get_typename($v).'[/url]';
}
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.",%')"; |
|