织梦Dedecms怎么获取上一级栏目名称及链接

wdzsjl 2个月前 (10-10) 阅读数 8 #PbootCMS
{dede:field name=&#39;typeid&#39; runphp=&#39;yes&#39;}                                 global $dsql;                                 /*获取当前栏目信息*/                                 $typeid = @me;                                 $query = "SELECT reid FROM dede_arctype where id = $typeid";                                 $rs = $dsql->GetOne($query);                                 $reid = $rs[&#39;reid&#39;];//获取到栏目的上级栏目                                                                  /*获取上级栏目信息*/                                 $query2 = "SELECT * FROM dede_arctype where id = $reid";                                 $row = $dsql->GetOne($query2);                                                                  /*打印栏目上级栏目链接信息*/                                 $typename = $row[&#39;typename&#39;];                                 $link = GetTypeUrl($row[&#39;typeid&#39;],MfTypedir($row[&#39;typedir&#39;]),$row[&#39;isdefault&#39;],$row[&#39;defaultname&#39;],$row[&#39;ispart&#39;],$row[&#39;namerule2&#39;],$row[&#39;moresite&#39;],$row[&#39;siteurl&#39;],$row[&#39;sitepath&#39;]);                                 @me = "<a href=&#39;{$link}&#39;>$typename</a>";                                                             {/dede:field}

 

wx.jpg ywfw.jpg
热门