原文来自:https://www.zixuephp.com
DEDECMS获取当前栏目的上一级栏目的链接及栏目名
DEDECMS获取当前栏目的上一级栏目的链接及栏目名.
- {dede:fieldname='typeid'runphp='yes'}
- global$dsql;
- $typeid=@me;
- $query="SELECTreidFROMdede_arctypewhereid=$typeid";
- $rs=$dsql->GetOne($query);
- $reid=$rs['reid'];//获取到栏目的上级栏目
- $query2="SELECT*FROMdede_arctypewhereid=$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="$typename";