<div class="fbox">
<h2 class="ntitle">宝宝睡前小故事</h2>
<ul>
<!--{block/perpage/8/sql/SELECT * FROM `supe_spaceitems` WHERE catid = 40 ORDER BY dateline DESC/cachename/b/cachetime/0}-->
<ul>
<!--{loop $_SBLOCK['b'] $value}-->
<li style="margin:5px;"><a href="http://www.hzmam.com/mama/?action-viewnews-itemid-$value[itemid]" target="_blank" title="$value[subject]" ><font color="#FF6600"> $value[subject] </font></a> </li>
<!--{/loop}-->
</ul>
</div>
BLOCK解释:<!--{block/perpage/8/sql/SELECT * FROM `supe_spaceitems` WHERE catid = 40 ORDER BY dateline DESC/cachename/b/cachetime/0}--> 这个是数据调用的BLOCK代码, 本人是SQL新手, perpage/8/中的8表示调用的数据条数 sql/SELECT * FROM `supe_spaceitems` WHERE catid = 40 ORDER BY dateline DESC 这个是SQL语句
cachename/b这里的b和下面循环语句中的<!--{loop $_SBLOCK['b'] $value}-->的b要保持一直,可以根据自己喜欢改变~cachetime/0 这个是数据缓存时长~ 如果想调用多个栏目的数据 只需要在WHERE catid = 40 后面加 OR catid = 41 OR catid = 42 ........
调用BBS数据
<div class="fbox">
<h2 class="ntitle">发现</h2>
<!--{block/perpage/10/sql/SELECT * FROM `cdb_threads` ORDER BY dateline DESC/cachename/bbs/cachetime/0}-->
<ul>
<!--{loop $_SBLOCK['bbs'] $value}-->
<li style="margin:5px;"><a href="/bbs/viewthread.php?tid=$value[tid]" target="_blank" title="$value[subject]" ><font color="#FF6600"> $value[subject] </font></a> </li>
<!--{/loop}-->
</ul>
</div>
调用其他系统的数据:
<h2 class="ntitle">妈妈影视频道</h2>
<ul>
<!--{block/perpage/8/sql/SELECT * FROM `nm_movies` ORDER BY dateline DESC/cachename/mmtv/cachetime/0}-->
<ul>
<!--{loop $_SBLOCK['mmtv'] $value}-->
循环内容
<!--{/loop}-->
</ul>