destoon实现调用当前栏目分类及子分类和三级分类的方法


本文整理自网络,侵删。

调用当前栏目分类及子分类和三级分类是程序设计里常用的方法,本文就来详细讲述destoon实现调用当前栏目分类及子分类和三级分类的方法。具体操作如下:

在destoon中提供了如下的调用语句:

一级分类名:

{$m[catname]} 

二级分类名:

{$c[catname]} 

三级分类名:

{$b[catname]} 

具体调用示例如下:

一、直接调用分类名称和链接:

{loop $maincat $i $m}<dl>
   {php $child = get_maincat($maincat, $CATEGORY, 1);}
   <dt><a  rel="external nofollow" rel="external nofollow" >{$m[catname]}</a></dt>
   {php $childs = get_maincat($m[catid], $CATEGORY, 1);}
   {loop $childs $i $c}<dd><a  rel="external nofollow" rel="external nofollow" rel="external nofollow" >{$c[catname]}</a></dd>{/loop}
</dl>{/loop}

二、调用分类名和其下最新文章:

{loop $maincat $i $m}
{php $child = get_maincat($maincat, $CATEGORY, 1);}
 <div class="hq01">
  <div class="hq-tt">
  <p><h4>{$m[catname]}</h4>
{php $a = get_maincat($m[catid], $CATEGORY, 1);}
  {loop $a $g}
  {php $f = get_maincat($g[catid], $CATEGORY, 1);}
  {loop $f $i $b}
  <span><a  rel="external nofollow" rel="external nofollow" rel="external nofollow" >{$b[catname]}</a></span>
  {/loop}
  {/loop}
  <span class="hqmore"><a  rel="external nofollow" rel="external nofollow" >[更多]</a></span> </p>
  </div>
  <div class="clear"></div>
  {php $childs = get_maincat($m[catid], $CATEGORY, 1);}
  {loop $childs $i $c}
  <div class="hq-cc">
  <!--{php $tags=tag("moduleid=$moduleid&condition=status=3&areaid=$cityid&length=40&catid=".$c[catid]."&order=".$MOD[order]."&pagesize=5&datetype=2&target=_blank&template=null")}-->
  <ul>
   <li class="li-t"><span><a  rel="external nofollow" rel="external nofollow" rel="external nofollow" >---更多</a></span>{$c[catname]}</li>
   {loop $tags $t}
      <li><!-- <span class="f_r">{date('Y-m-d', $t[addtime])} </span> -->
   <a  rel="external nofollow" {if $target} target="{$target}"{/if}>{$t[title]}</a>
   </li>
   {/loop}
   
  </ul>
  </div>
  {/loop}
  
  <div class="clear"></div>
 </div>
 <div class="clear"></div>
{/loop}

希望本文所述方法对大家destoon开发有所帮助。

更多相关Discuz论坛的内容来自木庄网络博客


标签:Discuz论坛

相关阅读 >>

discuz! 6.0.0到discuz! 7.0.0升级教程

win2003 r2 sp2 64位服务器系统 配置php+iis6

discuz! passport 通行证整合

discuz! 应用中心操作指南(图文教程)

2015年免费wordpress主题推荐(国内精选)

Discuz论坛用户通过邮件验证的设置方法[图文]

destoon数据库表说明汇总

php通过curl模拟登陆dz论坛

discuz!7.0论坛帮助功能详解

渗透测试信息收集之常用端口信息

更多相关阅读请进入《Discuz论坛》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...