首页 > 运营 > 建站经验 > 正文

dede 子栏目中调用其所属顶级栏目的名称及简介

2019-10-14 22:55:34
字体:
来源:转载
供稿:网友
{dede:field name=’id’ runphp="yes"}
global $cfg_basehost,$cfg_cmspath,$cfg_indexurl;
$dsql = new DedeSql(false);
$a="SELECT tp.reid FROM 2d30_arctype as tp where tp.id=@me";
$arcRow = $dsql->GetOne($a);
@me="$arcRow[reid]";
if(@me==0)@me=’<a href="/">首页</a>’;
else {$b="SELECT * FROM 2d30_arctype as tp where tp.id=@me";
$tpRow = $dsql->GetOne($b);
@me=’<a href="’.$tpRow[typedir].’/">’.$tpRow[typename].’</a>’.$tpRow[description].$tpRow[keywords];
$url=$cfg_basehost.$cfg_cmspath;
@me=str_replace(‘{cmspath}’,$url,@me);
}
$dsql->Close();
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表