DEDECMS获取当前栏目的上一级栏目的链接及栏目名
发布:smiling 来源: PHP粉丝网 添加日期:2014-11-12 08:22:31 浏览: 评论:0
DEDECMS获取当前栏目的上一级栏目的链接及栏目名.
- {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}
测试可用:5.7 {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']); //开源软件:phpfensi.com
- @me = "$typename";
- {/dede:field}
Tags: DEDECMS当前栏目 DEDECMS上级栏目
相关文章
- ·DEDECMS列表页调用当前栏目的父级栏目(2014-11-04)
- ·dedecms获取当前栏目的顶级栏目名称(2014-11-08)
- ·dedecms获取当前栏目的顶级栏目名称(2014-11-08)
- ·调用当前栏目ID,当前栏目顶级ID以及上级栏目ID(2014-11-01)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)