织梦dedecms子栏目中如何调用其所属顶级栏目的名称和简介
发布时间:2021-12-14 14:50 所属栏目:19 来源:互联网
导读:顶级栏目的名称及链接: {dede:field name=id runphp=yes} global $cfg_basehost,$cfg_cmspath,$cfg_indexurl; $dsql = new DedeSql(false); $a=SELECT tp.reid FROM dede_arctype as tp where tp.id=@me; $arcRow = $dsql-GetOne($a); @me=$arcRow[reid]; if(
顶级栏目的名称及链接: {dede:field name='id' runphp="yes"} global $cfg_basehost,$cfg_cmspath,$cfg_indexurl; $dsql = new DedeSql(false); $a="SELECT tp.reid FROM dede_arctype as tp where tp.id=@me"; $arcRow = $dsql->GetOne($a); @me="$arcRow[reid]"; if(@me==0)@me='首页'; else {$b="SELECT * FROM dede_arctype as tp where tp.id=@me"; $tpRow = $dsql->GetOne($b); @me=''.$tpRow[typename].''; $url=$cfg_basehost.$cfg_cmspath; @me=str_replace('{cmspath}',$url,@me); } $dsql->Close(); {/dede:field} 栏目描述: {dede:field name='id' runphp="yes"} $dsql = new DedeSql(false); $a="SELECT tp.reid FROM dede_arctype as tp where tp.id=@me"; $arcRow = $dsql->GetOne($a); @me="$arcRow[reid]"; if(@me==0)@me=''; else {$b="SELECT * FROM dede_arctype as tp where tp.id=@me"; $tpRow = $dsql->GetOne($b); //开源软件:Cuoxin.com @me=$tpRow[description]; $dsql->Close(); {/dede:field} (编辑:ASP站长网) |
相关内容
网友评论
推荐文章
热点阅读