织梦Dedecms获取上一级栏目名称及链接的代码

2022-08-18

{dede:field name='typeid' runphp='yes'}
global $dsql;
/*获取当前栏目信息*/
$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 = "$typename";                               
{/dede:field}

非凡技术导航 优秀网址导航免费网站收录 网站地图

本站收录的网站若侵害到您的利益,请联系我们删除处理

Copyright ©2020 Guojiz V 5.5All Rights Reserved.

备案号 )| 452133545|