本帖最后由 banish 于 2009-6-25 00:35 编辑
现在举例说明- <!--{block name="spacenews" parameter="dateline/2592000/grade/4/showattach/1/showdetail/1/catid/1,2/order/i.dateline DESC/limit/0,1/subjectlen/34/subjectdot/1/messagelen/80/messagedot/1/cachetime/18600/cachename/headnews/tpl/data"}-->
复制代码 1、 name="spacenews" 意思是规定调用资讯模块的内容
2、 grade/4/ 调用审核等级为4的内容
3、 showattach/1 是否显示图片附件1为显示 0 为不显示
3、 showdetail/1 是否显示缩略信息1为显示 0为不显示
4、 order/i.dateline 按照发布时间排序
5、 limit/0,1 0是从头一条开始 1是调用1条
6、 subjectlen/34 调用标题的字节数
7、 subjectdot/1 标题是够显示省略号1为显示 0 为不显示
8、 messagelen/80 缩略内容显示字节数
9、 messagedot/1 缩略内容是否显示省略号
10、cachetime/18600 缓存更新时间
11、cachename/headnews 调用变量的名称
12、dateline/2592000 调用的时间范围
13、catid/1,2 调用的频道限制
subjectlen/34/subjectdot/1/
常用:
goodrate 好评排序
viewnum 点击排序
dateline 发布时间排序
lastpost 最后回复时间排序
replynum 回复排序
三、资讯篇
1、资讯根分类列表- <!--{block name="category" parameter="type/news/isroot/1/ischannel/2/order/c.displayorder/limit/0,100/cachetime/10800/cachename/category/tpl/data"}-->
- <!--{loop $_SBLOCK['category'] $value}-->
- <li><a href="$value[url]" target="_self">$value[name]</a></li>
- <!--{/loop}-->
复制代码 2、资讯最新主题列表(以等级2为例)- <!--{block name="spacenews" parameter="grade/2/order/i.dateline DESC/limit/0,10/subjectlen/30/subjectdot/1/cachetime/18000/cachename/recommend2news/tpl/data"}-->
- <!--{loop $_SBLOCK['recommend2news'] $value}-->
- <li><a href="$value[url]" title="$value[subjectall]">$value[subject]</a></li>
- <!--{/loop}-->
-
复制代码 -----说明:grade/2/ recommend2news表示等级2,余类推。
3、图文资讯幻灯片- <!--{block name="spacenews" parameter="grade/4/haveattach/1/showattach/1/order/i.dateline DESC/limit/0,4/cachetime/11930/cachename/picnews/tpl/data"}-->
- <div>
- <!--{eval $picarr=$linkarr=$textarr=array();}-->
- <!--{loop $_SBLOCK['picnews'] $ikey $value}-->
- <!--{eval $picarr[] = '"'.$value[a_filepath].'"';}-->
- <!--{eval $linkarr[] = '"'.$value[url].'"';}-->
- <!--{eval $textarr[] = '"'.$value[subject].'"';}-->
- <!--{/loop}-->
- <!--{eval $pics = implode(',', $picarr);}-->
- <!--{eval $links = implode(',', $linkarr);}-->
- <!--{eval $texts = implode(',', $textarr);}-->
- <script type="text/javascript" language="javascript">
- <!--
- var focus_width=208;
- var focus_height=208;
- var text_height=20;
-
- var xsImgs = new Array({$pics});
- var xsImgLinks = new Array({$links});
- var xsImgTexts = new Array({$texts});
- var xsImgSize = new Array(focus_width, focus_height);
- //-->
- </script>
- <script language="javascript" type="text/javascript" src="{S_URL}/include/js/slide.js"></script>
- </div>
复制代码 4、头条新闻列表(内容截取、略图):- <!--{block name="spacenews" parameter="grade/5/showattach/1/showdetail/1/order/i.dateline DESC/limit/0,1/subjectlen/34/subjectdot/1/messagelen/80/messagedot/1/cachetime/18600/cachename/headnews/tpl/data"}-->
- <!--{loop $_SBLOCK['headnews'] $value}-->
- <!--{if !empty($value['a_thumbpath'])}--><a href="$value[url]"><img src="$value[a_thumbpath]" alt="" /></a><!--{/if}-->
- <strong><a href="$value[url]">$value[subject]</a></strong>
- <p>$value[message]</p>
- <!--{/loop}-->
复制代码 5、站内最新资讯列表- <!--{block name="spacenews" parameter="order/i.dateline DESC/limit/0,15/showspacename/1/subjectlen/40/subjectdot/1/cachetime/1800/cachename/newgradenews/tpl/data"}-->
- <!--{loop $_SBLOCK['newgradenews'] $value}-->
- <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a></li>
- <!--{/loop}-->
-
复制代码 6、最热资讯TAG列表- <!--{block name="tag" parameter="order/spacenewsnum DESC/limit/0,20/cachetime/18000/cachename/hottag/tpl/data"}-->
- <!--{loop $_SBLOCK['hottag'] $value}-->
- <a href="$value[url]">$value[tagname]<em>($value[spacenewsnum])</em></a>
- <!--{/loop}-->
复制代码 7、站内热门资讯列表(一周)--以浏览数- <!--{block name="spacenews" parameter="dateline/604800/order/i.viewnum DESC/limit/0,10/cachetime/15400/subjectlen/40/subjectdot/1/cachename/hotnews1/tpl/data"}-->
- <!--{loop $_SBLOCK['hotnews1'] $value}-->
- <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a>($value[viewnum])</li>
- <!--{/loop}-->
-
复制代码 8、站内热门资讯列表(一月)--以浏览数- <!--{block name="spacenews" parameter="dateline/2592000/order/i.viewnum DESC/limit/0,10/cachetime/17200/subjectlen/40/subjectdot/1/cachename/hotnews2/tpl/data"}-->
- <!--{loop $_SBLOCK['hotnews2'] $value}-->
- <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a>($value[viewnum])</li>
- <!--{/loop}-->
复制代码 9、站内热门资讯列表(开站以来)--以浏览数- <!--{block name="spacenews" parameter="order/i.viewnum DESC/limit/0,10/cachetime/17400/subjectlen/40/subjectdot/1/cachename/hotnews3/tpl/data"}-->
- <!--{loop $_SBLOCK['hotnews3'] $value}-->
- <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a>($value[viewnum])</li>
- <!--{/loop}-->
复制代码 10、图片资讯(略图、标题)- <!--{block name="spacenews" parameter="haveattach/1/showattach/1/order/i.dateline DESC/subjectlen/12/subjectdot/1/limit/0,7/cachetime/8000/cachename/picnews/tpl/data"}-->
- <!--{loop $_SBLOCK['picnews'] $value}-->
- <li><div><a href="$value[url]"><img src="$value[a_thumbpath]" alt="$value[subjectall]" /></a></div>
- <p><a href="$value[url]">$value[subject]</a></p></li>
- <!--{/loop}-->
复制代码 11、站内热门资讯列表(一周)---按评论数- <!--{block name="spacenews" parameter="lastpost/604800/order/i.replynum DESC/limit/0,10/cachetime/15400/subjectlen/40/subjectdot/1/cachename/replyhot/tpl/data"}-->
- <!--{loop $_SBLOCK['replyhot'] $value}-->
- <a href="$value[url]">$value[subject]</a><br/>
- #date("m-d", $value["lastpost"])# / <a href="$value[url]">评论($value[replynum])</a>
- <!--{/loop}-->
复制代码 12、最新发表(含评论)资讯列表- <!--{block name="spacenews" parameter="order/i.lastpost DESC/limit/0,20/cachetime/1500/cachename/newnews/tpl/data"}-->
- <!--{loop $_SBLOCK['newnews'] $value}-->
- <a href="$value[url]">$value[subject]</a><br/>
- #date("m-d", $value["lastpost"])# / <a href="$value[url]">评论($value[replynum])</a>
- <!--{/loop}-->
复制代码 13、月度关注热点---按评论数- <!--{block name="spacenews" parameter="lastpost/2592000/order/i.replynum DESC/limit/0,50/cachetime/35400/subjectlen/40/subjectdot/1/cachename/replyhot/tpl/data"}-->
- <!--{loop $_SBLOCK['replyhot'] $value}-->
- <a href="$value[url]">$value[subject]</a>
- #date("m-d", $value["lastpost"])# / <a href="$value[url]">评论($value[replynum])</a>
- <!--{/loop}-->
复制代码 14、各分类最新资讯列表- <!--{loop $_SBLOCK['category'] $ckey $cat}-->
- <!--{eval $ctime=1800+30*$ckey;}-->
- <!--{block name="spacenews" parameter="catid/$cat[subcatid]/order/i.dateline DESC/limit/0,10/cachetime/$ctime/subjectlen/40/subjectdot/1/cachename/newslist/tpl/data"}-->
- <div class="category">
- <h3>
- <strong><a href="#action/category/catid/$cat[catid]#" target="_self">$cat[name]</a></strong>
- <a href="#action/category/catid/$cat[catid]#" class="more" target="_self">更多</a>
- </h3>
- <ul class="msgtitlelist">
- <!--{loop $_SBLOCK['newslist'] $value}-->
- <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a></li>
- <!--{/loop}-->
- </ul>
- </div>
- <!--{/loop}-->
复制代码 15、当前分类月度关注热点----按浏览数- <!--{block name="spacenews" parameter="catid/$thecat[subcatid]/dateline/2592000/order/i.viewnum DESC/limit/0,10/cachetime/28800/cachename/hotnews/tpl/data"}-->
- <!--{loop $_SBLOCK['hotnews'] $value}-->
- <a href="$value[url]">$value[subject]</a><br/>
- <a href="#uid/$value[uid]/action/space#">$value[username]</a> / <a href="$value[url]">点击($value[viewnum])</a>
- <!--{/loop}-->
复制代码 16、当前分类最新资讯- <!--{block name="spacenews" parameter="catid/$thecat[subcatid]/order/i.dateline DESC/limit/0,10/cachetime/7280/cachename/newnews/tpl/data"}-->
- <!--{loop $_SBLOCK['newnews'] $value}-->
- <a href="$value[url]">$value[subject]</a>
- <!--{/loop}-->
复制代码 17、当前资讯相关文章-->- <!--{if !empty($news[relativeitemids])}-->
- <!--{block name="spacenews" parameter="itemid/$news[relativeitemids]/order/i.dateline DESC/limit/0,20/cachetime/17680/cachename/relativeitem/tpl/data"}-->
- <!--{loop $_SBLOCK['relativeitem'] $ikey $value}-->
- <a href="$value[url]" target="_blank" title="$value[subjectall]">$value[subject]</a>
- <!--{/loop}-->
- <!--{/if}-->
复制代码 18、资讯浏览页:
标题:$news[subject]
作者:$news[newsauthor]
时间:#date('Y-n-d H:i', $news["dateline"])#
来源: $news[newsfrom]
内容:$news[message]
图片附件:- <!--{loop $news['attacharr'] $attach}-->
- <br /><a href="$attach[url]" target="_blank"><img src="$attach[thumbpath]" alt="$attach[subject]" /></a><br />$attach[subject]<br />
- <!--{/loop}-->
- <br />
复制代码 TAG:- <!--{if !empty($relativetagarr)}-->
- <br /><strong>TAG:</strong>
- <!--{loop $relativetagarr $value}-->
- <!--{eval $svalue = rawurlencode($value);}-->
- <a href="#action/tag/tagname/$svalue#" target="_blank">$value</a>
- <!--{/loop}-->
- <!--{/if}-->
复制代码 分页:$multipage
19、查看最新评论:- <!--{if !empty($commentlist)}-->
- <div id="commentlist">
- <h3>
- <a href="#action/viewcomment/itemid/$news[itemid]#" class="more" target="_self">查看全部评论($news[replynum])</a>
- <strong>最新评论</strong>
- </h3>
- <ul class="messagelist">
- <!--{loop $commentlist $value}-->
- <li>
- <h4><a href="#action/viewcomment/itemid/$value[itemid]/cid/$value[cid]/op/delete/php/1#" class="more">删除</a>
- <!--{if empty($value[authorid])}-->
- $value[author]
- <!--{else}-->
- <a href="{B_URL}/viewpro.php?uid=$value[authorid]" target="_blank">$value[author]</a>
- <!--{/if}-->
- <span class="smalltxt">(#date("Y-n-d H:i:s", $value["dateline"])#, 评 <strong>$value[rates]</strong> 分)</span></h4>
- <p>$value[message]</p>
- </li>
- <!--{/loop}-->
- </ul>
- </div>
- <!--{/if}-->
复制代码 20、内容页多媒体及图片链接作用js:- <script language="javascript" type="text/javascript">
- <!--
- addMediaAction('articlebody');
- addImgLink("articlebody");
- //-->
- </script>
复制代码 21、资讯当前类别封面图片及简介:- <!--{if $thecat['thumb'] || $thecat['note']}-->
- <div>
- <!--{if $thecat['thumb']}-->
- <div><img src="{A_URL}/$thecat[thumb]" alt="" /></div>
- <!--{/if}-->
- <!--{if $thecat['note']}-->
- <p>$thecat[note]</p>
- <!--{/if}-->
- </div>
- <!--{/if}-->
复制代码 22、当前类别资讯子分类- <!--{block name="category" parameter="upid/$thecat[catid]/ischannel/2/order/c.displayorder/limit/0,100/cachetime/10900/cachename/subarr/tpl/data"}-->
- <!--{if $_SBLOCK['subarr']}-->
- <!--{loop $_SBLOCK['subarr'] $value}-->
- <li><a href="$value[url]" target="_self">$value[name]</a></li>
- <!--{/loop}-->
- <!--{/if}-->
复制代码 23、当前类别资讯子分类列表- <!--{block name="category" parameter="upid/$thecat[catid]/ischannel/1/showattach/1/order/c.displayorder/limit/0,100/cachetime/16400/cachename/channel/tpl/data"}-->
- <!--{if $_SBLOCK['channel']}-->
- <!--{loop $_SBLOCK['channel'] $value}-->
- <li>
- <a href="#action/category/catid/$value[catid]#" target="_self"><img src="$value[thumb]" alt="" /></a>
- <p><a href="#action/category/catid/$value[catid]#" target="_self">$value[name]</a></p>
- </li>
- <!--{/loop}-->
- <!--{/if}-->
复制代码 24、当前类别根分类最新资讯列表- <!--{if $_SGET['page']<2 || empty($_SGET['mode'])}-->
- <!--{block name="spacenews" parameter="perpage/40/catid/$thecat[subcatid]/order/i.dateline DESC/cachename/newlist/tpl/data"}-->
- <!--{if $_SBLOCK['newlist']}-->
- <div class="category">
- <h3><strong>$thecat[name]</strong></h3>
- <ul class="msgtitlelist">
- <!--{loop $_SBLOCK['newlist'] $value}-->
- <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a></li>
- <!--{/loop}-->
- </ul>
-
- <div class="pages">
- <!--{if $_SBLOCK[newlist_multipage]}-->
- $_SBLOCK[newlist_multipage]
- <!--{else}-->
- <table summary="" class="xspace-page"><tr><td class="xspace-totlerecord">当前只有一页</td></tr></table>
- <!--{/if}-->
- </div>
- </div>
- <!--{/if}-->
- <!--{/if}-->
复制代码 25、当前类别关联论坛最新帖子:- <!--{if !empty($thecat['bbsmodel'])}-->
- <!--{if $_SGET['page']<2 || !empty($_SGET['mode'])}-->
- <!--{eval $_SGET['mode']='bbs';}-->
- <!--{block name="bbsthread" parameter="perpage/40/$thecat[blockparameter]/cachename/bbsthreadlist/tpl/data"}-->
- <!--{if $_SBLOCK['bbsthreadlist']}-->
- <!--{loop $_SBLOCK['bbsthreadlist'] $value}-->
- <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a></li>
- <!--{/loop}-->
- <div class="pages">
- <!--{if $_SBLOCK[bbsthreadlist_multipage]}-->
- $_SBLOCK[bbsthreadlist_multipage]
- <!--{else}-->
- <table summary="" class="xspace-page"><tr><td class="xspace-totlerecord">当前只有一页</td></tr></table>
- <!--{/if}-->
- </div>
- <!--{/if}-->
- <!--{/if}-->
- <!--{/if}-->
复制代码 26、当前类别子分类资讯列表- <!--{if $_SGET['page']<2}-->
- <!--{loop $_SBLOCK['subarr'] $ckey $cat}-->
- <!--{eval $ctime=1800+30*$ckey;}-->
- <!--{block name="spacenews" parameter="catid/$cat[subcatid]/order/i.dateline DESC/limit/0,10/cachetime/$ctime/cachename/subnewlist/tpl/data"}-->
- <!--{if $_SBLOCK['subnewlist']}-->
- <div class="category">
- <h3>
- <strong><a href="#action/category/catid/$cat[catid]#" target="_self">$cat[name]</a></strong>
- <a href="#action/category/catid/$cat[catid]#" class="more" target="_self">更多</a>
- </h3>
- <ul class="msgtitlelist">
- <!--{loop $_SBLOCK['subnewlist'] $value}-->
- <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a></li>
- <!--{/loop}-->
- </ul>
- </div>
- <!--{/if}-->
- <!--{/loop}-->
- <!--{/if}-->
- 27、当前资讯评论:
- <div id="commentlist">
- <h3 style="text-align: center;"><strong>评论 << <a href="#action/viewnews/itemid/$item[itemid]#">$item[subject]</a> >></strong></h3>
- <h5 style="margin: 1em 0; font-size: 1em;">
- 查看数: $item[viewnum] /
- 评论数: $item[replynum] /
- 好评分: $item[goodrate] /
- 差评分: $item[badrate]
- </h5>
- <ul class="messagelist">
- <!--{loop $iarr $value}-->
- <li>
- <h4><a href="#action/viewcomment/itemid/$value[itemid]/cid/$value[cid]/op/delete/php/1#" class="more">删除</a>
- <!--{if empty($value[authorid])}-->$value[author]<!--{else}--><a href="{B_URL}/viewpro.php?uid=$value[authorid]" target="_blank">$value[author]</a><!--{/if}-->
- <span class="smalltxt">(第{$value[num]}楼, #date("Y-n-d H:i:s", $value["dateline"])#, 评 <strong>$value[rates]</strong> 分)</span></h4>
- <p>$value[message]</p>
- </li>
- <!--{/loop}-->
- </ul>
- </div>
复制代码 |