打開/include/extend.func.php,在最底部加入下面代碼:
//獲取頂級欄目名稱
function GetTopTypename($id)
{
global $dsql;
$row = $dsql->GetOne("SELECT typename,topid FROM dede_arctype WHERE id= $id");
if ($row['topid'] == '0')
{
return $row['typename'];
}
else
{
$row1 = $dsql->GetOne("SELECT typename FROM dede_arctype WHERE id= $row[topid]");
return $row1['typename'];
}
}
用在需要調(diào)用的地址用下面調(diào)用標簽即可調(diào)用出當前頂級欄目名稱:
{dede:field.typeid function=getredtype(@me,typename)/}
]]>