很多dedecms用户想要知道dedecms调用副栏目的标签.
内容页 -标签,代码如下:
- {dede:field.typeid2 runphp='yes'}
- $dsql= new dedesql();
- $ks = split(',', @me);
- $type2name="";
- foreach($ks as $k){
- $k = trim($k);
- if ($k!="") {
- if ($row = $dsql->getOne("select *,ID as id1 from dede_arctype where id=".$k)){
- $type_path=GetTypeUrl($row['id1'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
- $type2name.="<a href='".$type_path."' target=_blank>".$row['typename']."</a> "; //Vevb.com
- }
- }
- }
- @me=substr($type2name,0,strlen($type2name)-1);
- {/dede:field.typeid2}
首页 列表页 -标签,代码如下:
- [field:typeid2 runphp='yes']
- $dsql= new dedesql();
- $ks = split(',', @me);
- $type2name="";
- foreach($ks as $k){
- $k = trim($k);
- if ($k!="") {
- if ($row = $dsql->getOne("select *,ID as id1 from dede_arctype where id=".$k)){
- $type_path=GetTypeUrl($row['id1'],MfTypedir($row['typedir']),$row['isdefault'],$row['defaultname'],$row['ispart'],$row['namerule2'],$row['siteurl']);
- $type2name.="<a href='".$type_path."' target=_blank>".$row['typename']."</a> ";
- }
- }
- }
- @me=substr($type2name,0,strlen($type2name)-1);
- [/field:typeid2]
以上方法,我没有测试,纯属转载、存档.
新闻热点
疑难解答