织梦获取单个顶级栏目名

{dede:field name='typeid' runphp='yes'}
global $dsql;
$typeid = @me;
$query = "SELECT topid FROM na_arctype where id = $typeid";
$rs = $dsql->GetOne($query);
$topid = $rs['topid'];
$query2 = "SELECT * FROM na_arctype where id = $topid";
$row = $dsql->GetOne($query2);
$typename = $row['typename'];
@me= $typename;
{/dede:field}

posted @ 2015-11-27 09:56  绿尘枫  阅读(240)  评论(0编辑  收藏  举报