设为首页
你的,我的,大家的Sjdn!在线投稿
注册 | 社区 | 军事
登录 | 搜索 | 投稿

supesite模版调用程序分析 

字号:T|T

supesite模版调用程序分析 

<!--{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            调用的频道限制

常用:

goodrate 好评排序

viewnum  点击排序

dateline 发布时间排序

lastpost 最后回复时间排序

replynum 回复排序

周:604800

月:2592000

用法 <!--{block name="spaceblog" parameter="dateline/604800/showattach/1/showdetail/1/order/i.dateline DESC/limit/0,1/subjectlen/34/subjectdot/1/messagelen/180/messagedot/1/cachetime/68600/cachename/coolblog/tpl/data"}-->

最新发布 dateline

最新回复 lastpost

浏览数 viewnum

回复数 replynum

用法 <!--{block name="spaceblog" parameter="dateline/604800/showattach/1/showdetail/1/order/i.dateline DESC/limit/0,1/subjectlen/34/subjectdot/1/messagelen/180/messagedot/1/cachetime/68600/cachename/coolblog/tpl/data"}-->

注意: 在一般情况下都是用 i.变量质,但圈子是用 g 而标签是用 t,也就是原本应该是 i.dateline 要改成 t.dateline

一天 86400 (以秒计算)

一周 604800

一月 18144000

递增 ASC

递减 DESC

标题长度 subjectlen

文本长度 messagelen

用法 <!--{block name="spaceblog" parameter="dateline/604800/showattach/1/showdetail/1/order/i.dateline DESC/limit/0,1/subjectlen/34/subjectdot/1/messagelen/180/messagedot/1/cachetime/68600/cachename/coolblog/tpl/data"}-->

调用个数 limit/0,1 (0 是从第几笔数据开始调用,1是要调用几笔数据)

用法 <!--{block name="spaceblog" parameter="dateline/604800/showattach/1/showdetail/1/order/i.dateline DESC/limit/3,10/subjectlen/34/subjectdot/1/messagelen/180/messagedot/1/cachetime/68600/cachename/coolblog/tpl/data"}-->

意思是要从第 3 笔数据开始调用,总共要调用 10 笔数据.通常是不希望内容重覆而使用.

比方说我首页已显示 2 张最新图片,在图片页时我不希望重覆这两张,所以从第 3 笔开始

调用,但写法要写成 2,因为是从 0 开始算起.

显示附件 showattach

显示详情 showdetail

不使用 0

使用 1

用法 <!--{block name="spaceblog" parameter="dateline/604800/showattach/1/showdetail/1/order/i.dateline DESC/limit/3,10/subjectlen/34/subjectdot/1/messagelen/180/messagedot/1/cachetime/68600/cachename/coolblog/tpl/data"}-->

資訊

最新资讯 newnews

人气最旺 hotnews

回复最多 headnews

ps.是不是还有其他变量?我记得有看过一个 coolnews 的变量?

用法 <!--{block name="spacenews" parameter="dateline/604800/showattach/1/showdetail/1/order/i.dateline DESC/limit/0,1/subjectlen/34/subjectdot/1/messagelen/180/messagedot/1/cachetime/18600/cachename/newnews/tpl/data"}-->

<!--{if !empty($_SBLOCK['newnews'])}-->

  <!--{loop $_SBLOCK['newnews'] $value}-->

    <a href="$value[url]" target="_blank"><font color=#000 style="font-weight:bold;font-size:18px;margin-bottom:6px;">$value[subject]</font></a><br>

    <font color=#666666 style="font-size:12px;">$value[message]</font>

  <!--{/loop}-->

<!--{/if}-->

底下这变量是我发现相当实用的,官方却没有发挥出来.效果大家可以看一下

http://www.metro.com.tw 也就是当帖子含有图片附件时,会直接秀出来.

<!--{if !empty($value[a_thumbpath])}-->

  <a href="$value[url]" target="_blank" title="$value[subjectall]"><img src="$value[a_thumbpath]" align="right" width="100" style="padding:2px; border:1px solid silver;" alt="$value[subjectall]" /></a>

<!--{/if}-->

这句加在哪呢?以上面的例子来说

<!--{if !empty($_SBLOCK['newnews'])}-->

  <!--{loop $_SBLOCK['newnews'] $value}-->

     <!--{if !empty($value[a_thumbpath])}-->

        <a href="$value[url]" target="_blank" title="$value[subjectall]"><img src="$value[a_thumbpath]" align="right" width="100" style="padding:2px; border:1px solid silver;" alt="$value[subjectall]" /></a>

     <!--{/if}-->

    <a href="$value[url]" target="_blank"><font color=#000 style="font-weight:bold;font-size:18px;margin-bottom:6px;">$value[subject]</font></a><br>

    <font color=#666666 style="font-size:12px;">$value[message]</font>

  <!--{/loop}-->

<!--{/if}-->

资讯,日志跟论坛皆适用.

资讯分类列表

<!--{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/21/subjectdot/1/cachename/newslist/tpl/data"}-->

       <div class="blockcategory" style="border:1px solid #8076b4;">

           <h3><a href="#action/category/catid/$cat[catid]#">$cat[name]</a></h3>

           <ul class="msgtitlelist" style="padding-left:8px;" nowrap>

               <!--{loop $_SBLOCK['newslist'] $value}-->

                  <li><cite>#date("m-d", $value["dateline"])# </cite><a href="$value[url]">$value[subject]</a></li>

               <!--{/loop}-->

               <li><a href="#action/category/catid/$cat[catid]#" class="more">更多</a></li>

            </ul>

        </div>

<!--{/loop}-->

 

SupeSite/X-Space 3.0 数据字典4[]

 15、站内热门BLOG列表(开站以来)---按浏览数

                        <!--{block name="spaceblog" parameter="order/i.viewnum DESC/limit/0,10/cachetime/17400/subjectlen/40/subjectdot/1/cachename/hotblog3/tpl/data"}-->

                                <!--{loop $_SBLOCK['hotblog3'] $value}-->

                                <li><cite><a href="#uid/$value[uid]/action/space#">$value[username]</a> </cite><a href="$value[url]">$value[subject]</a>($value[viewnum])</li>

                                <!--{/loop}-->

16、带附件图片的博客列表

<!--{block name="spaceblog" parameter="haveattach/1/showattach/1/order/i.lastpost DESC/subjectlen/14/subjectdot/1/limit/0,7/cachetime/8000/cachename/picblog/tpl/data"}-->

                <!--{loop $_SBLOCK['picblog'] $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}-->

17、站内热门BLOG列表(一周)---按评论数

                <!--{block name="spaceblog" 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/>

                                <a href="#uid/$value[uid]/action/space#">$value[username]</a> / <a href="$value[url]">评论($value[replynum])</a>

                                <!--{/loop}-->

18、最新发表(含评论)博客列表

                <!--{block name="spaceblog" parameter="order/i.lastpost DESC/limit/0,20/cachetime/1000/cachename/newblog/tpl/data"}-->

                                <!--{loop $_SBLOCK['newblog'] $value}-->

                                <a href="$value[url]">$value[subject]</a>

                                <a href="#uid/$value[uid]/action/space#">$value[username]</a> / #date("Y-m-d", $value["lastpost"])#

                                <!--{/loop}-->

                               

                               

19、当前分类封面图片及简介

                <!--{if $thecat['thumb'] || $thecat['note']}-->

                        <!--{if $thecat['thumb']}-->

                        <img src="{A_URL}/$thecat[thumb]" alt="" />

                        <!--{/if}-->

                        <!--{if $thecat['note']}-->

                        <p>$thecat[note]</p>

                        <!--{/if}-->

                <!--{/if}-->

               

20、当前分类子分类列表:

                <!--{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}-->

               

21、当前分类专题列表:

                <!--{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}-->

22、当前分类月度关注热点---按浏览数

                <!--{block name="spaceblog" parameter="dateline/2592000/catid/$thecat[subcatid]/order/i.viewnum DESC/limit/0,15/cachetime/17200/cachename/hotnews/tpl/data"}-->

                <!--{if $_SBLOCK['hotnews']}-->

                                <!--{loop $_SBLOCK['hotnews'] $value}-->

                                <a href="$value[url]">$value[subject]</a>

                                <a href="#uid/$value[uid]/action/space#">$value[username]</a> / <a href="$value[url]">点击($value[viewnum])</a>

                                <!--{/loop}-->

                <!--{/if}-->

               

23、当前分类博客最新列表(含分页):

                <!--{if $_SGET['page']<2 || empty($_SGET['mode'])}-->

                <!--{block name="spaceblog" parameter="perpage/20/catid/$thecat[subcatid]/order/i.dateline DESC/showspacename/1/showdetail/1/messagelen/300/messagedot/1/cachename/newlist/tpl/data"}-->

                <!--{if $_SBLOCK['newlist']}-->

                        <h3><strong>$thecat[name]</strong></h3>

                                <!--{loop $_SBLOCK['newlist'] $value}-->

                                <li>

                                        <h4><a href="#uid/$value[uid]/action/space/domain/$value[domain]#"><img src="$value[photo]" alt="$value[spacename]" /></a><a href="$value[url]">$value[subject]</a> <span class="smalltxt">($value[replynum])</span></h4>

                                        <span class="smalltxt" onclick="ColExpIntro(this);">

                                                <a href="#uid/$value[uid]/action/space/domain/$value[domain]#">$value[username]</a>($value[province]) 发表于 #date("Y-m-d", $value["dateline"])#

                                                <!--{if !empty($value['tags'])}-->

                                                关键词:

                                                <!--{loop $value['tags'] $tag}-->

                                                <a href="#action/tag/tagname/$tag#">$tag</a>

                                                <!--{/loop}-->

                                                <!--{/if}-->

                                        </span>

                                        <p onclick="ColExpIntro(this);">$value[message] <a href="$value[url]">...全文</a></p>

                                </li>

                                <!--{/loop}-->

                        <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>

                <!--{/if}-->

                <!--{/if}-->

24、关联论坛新帖列表:

                <!--{if !empty($thecat['bbsmodel'])}-->

                <!--{if $_SGET['page']<2 || !empty($_SGET['mode'])}-->

                <!--{eval $_SGET['mode']='bbs';}-->

                <!--{block name="bbsthread" parameter="perpage/20/$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}-->

25、博客当前分类子分类最新列表:

                <!--{if $_SGET['page']<2}-->

                <!--{loop $_SBLOCK['subarr'] $ckey $cat}-->

                <!--{eval $ctime=1800+30*$ckey;}-->

                <!--{block name="spaceblog" parameter="catid/$cat[subcatid]/order/i.dateline DESC/limit/0,10/cachetime/$ctime/subjectlen/40/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><a href="#uid/$value[uid]/action/space#">$value[username]</a> </cite><a href="$value[url]">$value[subject]</a></li>

                                <!--{/loop}-->

                        </ul>

                </div>

                <!--{/if}-->

                <!--{/loop}-->

                <!--{/if}-->

空间篇.txt

一、空间篇

1、空间分类:

<!--{block name="category" parameter="type/space/isroot/1/ischannel/2/order/c.displayorder/limit/0,100/cachetime/3600/cachename/category/tpl/data"}-->

                                <!--{loop $_SBLOCK['category'] $value}-->

                                <li><a href="$value[url]" target="_self">$value[name]</a></li>

<!--{/loop}-->

2、空间分类及有新内容的空间列表:

<!--{loop $_SBLOCK['category'] $ckey $cat}-->

                <!--{eval $ctime=2800+30*$ckey;}-->

                <!--{block name="userspace" parameter="catid/$cat[subcatid]/limit/0,15/order/u.lastpost DESC/cachetime/$ctime/cachename/sublist/tpl/data"}-->

                <!--{if $_SBLOCK['sublist']}-->

                <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="imgthumblist">

                                <!--{loop $_SBLOCK['sublist'] $value}-->

                                <li class="list2line">

                                        <div><a href="$value[url]" target="_blank"><img src="$value[photo]" alt="$value[spacename]" /></a></div>

                                        <p><a href="$value[url]" target="_blank" title="$value[spacename]">$value[username]</a></p>

                                        <p>信息数value[spaceallnum]</p>

                                </li>

                                <!--{/loop}-->

                        </ul>

                </div>

                <!--{/if}-->

                <!--{/loop}-->

               

3、空间分类封面及介绍

                        <!--{if $thecat['thumb']}-->

                        <img src="{A_URL}/$thecat[thumb]" alt="" />

                        <!--{/if}-->

                        <!--{if $thecat['note']}-->

                        <p>$thecat[note]</p>

                        <!--{/if}-->

4、空间子分类列表:

                <!--{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}-->

--------------------------------------------------------------------------------------------------------------------------

模块学习必备知识收藏

<!--{block name=".."}-->数据

<!--{loop $_SBLOCK['...'] $value}-->调用信息

<a href="$value[url]" target="_blank">$value[subject]</a> 标题

然后结束

<!--{/loop}-->

然后把数据掉使用规则:

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            调用的频道限制

14、goodrate/1,10        好评


 

友情提示:转载请注明出处
http://www.sjdn.net

[错误报告] [推荐] [收藏] [打印] [关闭] [返回顶部]

新闻48小时评论排行

  1. 1 怎么用displayx测电脑屏幕 评论0
  2. 2 红米9A导航建 评论0

图片新闻