如下图所示,手机端网站开发效果,文章内容页调用板块最新帖子内容。
Discuz手机模板调用最新帖子
那么Discuz手机模板制作中,如何调用板块最新内容呢:
- <ul>
- <!--{eval $latest_result=DB::fetch_all("SELECT tid,subject,views from ".DB::table('forum_thread')." where fid='$_G[fid]' order by tid desc limit 5");}-->
- <!--{loop $latest_result $latest}-->
- <li>
- <span class="latest_title"><a href="/thread-$latest[tid]-1-1.html">$latest[subject]</a></span>
- <span class="latest_views"><i class="icon-eye1"></i>$latest[views]</span>
- </li>
- <!--{/loop}-->
- </ul>
通过以上SQL查询语句及loop循环,就可以查询板块最新帖子并显示