織夢Dedecms獲取上級欄目名稱及鏈接方法:直接上代碼
{dede:field name='typeid' runphp='yes'}
global $dsql;
/*獲取當(dāng)前欄目信息*/
$typeid = @me;
$query = "SELECT reid FROM dede_arctype where id = $typeid";
$rs = $dsql->GetOne($query);
$reid = $rs['reid'];//獲取到欄目的上級欄目
/*獲取上級欄目信息*/
$query2 = "SELECT * FROM dede_arctype where id = $reid";
$row = $dsql->GetOne($query2);
/*打印欄目上級欄目鏈接信息*/
$typename = $row['typename'];
$link = GetTypeUrl($row['typeid'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['moresite'],$row['siteurl'],$row['sitepath']);
@me = "<a href='{$link}'>$typename</a>";
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 織夢Dedecms獲取上級欄目名稱及鏈接方法