|
标签调用代码
{dede:arclist row='2' titlelen='100'typeid=2 orderby='id' }
[url=,[field:typename/,[/url]
[field:typeid2 function="get_url_by_typeid2(@me)"/,
{/dede:arclist}
函数代码,在includeextend.func.php 中增加如下代码:
//得到副栏目信息,并组织字符串
01
function get_url_by_typeid2($typeid2){
02
$arrs=explode(",",$typeid2);//解析副栏目字段
03
if($typeid2==0){
04
return '';
05
}else{
06
$url='';
07
foreach($arrs as $v){
08
$url.='[url=,"javascript:"
09
onclick="javascript:change_tab('.$v.');">'.get_typename($v).'[/url]';
10
}
11
return $url;
12
}
13
}
//织梦模版根据栏目编号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.",%')"; |
|