在dedecms首页和列表页、内容页上调用文章的副栏目名称

shape
shape
shape
shape
shape
shape
shape
shape
%title缩略图

在内容页的标签
{dede:field.typeid2 runphp=’yes’}
$dsql= new dedesql();
$ks = split(‘,’, @me);
$type2name=””;
foreach($ks as $k){
$k = trim($k);
if ($k!=””) {
if ($row = $dsql->getOne(“select *,ID as id1 from #@__arctype where id=”.$k)){

$type_path=GetTypeUrl($row[‘id1’],MfTypedir($row[‘typedir’]),$row[‘isdefault’],$row[‘defaultname’],$row[‘ispart’],$row[‘namerule2’],$row[‘siteurl’]);
$type2name.=”<a
href='”.$type_path.”‘target=_blank>”.$row[‘typename’].”</a>
“;
}
}
}
@me=substr($type2name,0,strlen($type2name)-1);
{/dede:field.typeid2}

首页、列表页标签(在arclist、list等文章列表标签里用):

[field:typeid2runphp=’yes’]
$dsql= new dedesql();
$ks = split(‘,’, @me);
$type2name=””;
foreach($ks as $k){
$k = trim($k);
if ($k!=””) {
if ($row = $dsql->getOne(“select *,ID as id1 from #@__arctype where id=”.$k)){

$type_path=GetTypeUrl($row[‘id1’],MfTypedir($row[‘typedir’]),$row[‘isdefault’],$row[‘defaultname’],$row[‘ispart’],$row[‘namerule2’],$row[‘siteurl’]);
$type2name.=”<a
href='”.$type_path.”‘target=_blank>”.$row[‘typename’].”</a>
“;
}
}
}
@me=substr($type2name,0,strlen($type2name)-1);
[/field:typeid2]

[/post]

发表评论