分类输出论坛版块问题
用的是smarty模板,求大神给个思路,有代码最好,不用太详细也可以。谢谢!!!
想要实现的效果如下:
大版块1
------>小版块1
------>主题:324帖子:3242
------>最近发表:2012-6-28 12:00:00
大版块2
------>小版块1
------>主题:324帖子:3242
------>最近发表:2012-6-28 12:00:00
------>小版块2
------>主题:324帖子:3242
------>最近发表:2012-6-28 12:00:00
表结构如下:
------------------------
id | name | parent_id | theme_count | reply_count | time |
------------------------
1 | 版块1 | 0 | 123 | 123 | 2012-6-28 12:00:00 |
------------------------
假设smarty模板如下:
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> <p>大版块</p>
$arr=array( '大版块1'=>array( 0=>array('小版块1','324','3242','2012-6-28 12:00:00'), 1=>array('小版块2','324','3242','2012-6-28 12:00:00') ), '大版块2'=>array( 0=>array('小版块1','324','3242','2012-6-28 12:00:00'), 1=>array('小版块2','324','3242','2012-6-28 12:00:00') ) ) <div class="clear"> </div>