PHPcom CMS的模板标签收集

作者:Admin_qqzy | 分类:免费资源 | 点击:1546

PHPcom CMS的模板标签收集

<!–# 调用主题标签:
# 属性:chanid=频道ID,catid=指定分类ID, limit=限制数量,length=标题长度,ellipsis=省略号,format=日期格式,top=排行模式
# top排行:new=最新,hot=热门,recommend=推荐,topline=头条,focus=焦点,comment=评论,vote=投票,voteup=评价
# d=日,w=周,m=月,y=年
# 字段:title=标题,url=连接地址,date=日期,highlight=高亮风格,curl=分类URL,target=连接目标
#–>
{phpcom:fetchthread value=”$row” chanid=”0″ catid=”0″ softtype=”国产软件” limit=”5″ length=”50″ ellipsis=”…” format=”Y-m-d”}
<li><span><a href=”{$row.caturl}”{$row.target}{$row.color}>{$row.subname}</a></span> | <a href=”{$row.url}”{$row.highlight}>{$row.title}</a> {$row.date}</li>
{/phpcom:fetchthread}

{phpcom:threadlist value=”$row” chanid=”0″ catid=”0″ limit=”5″ length=”50″ ellipsis=”…” format=”Y-m-d” top=”new”}
<li><span><a href=”{$row.caturl}”{$row.target}{$row.color}>{$row.subname}</a></span> | <a href=”{$row.url}”{$row.highlight}>{$row.title}</a> {$row.date}</li>
{/phpcom:threadlist}

<!–# 调用分类标签:
# 属性:chanid=频道ID,catid=指定分类ID, rootid=指定根分类ID, limit=限制分类数
#–>
<dl>
{phpcom:category value=”$cat” chanid=”2″}
<dt style=”font-weight:bold;clear:both;”>{$cat.name}</dt>
{phpcom:if test=”$cat.child”}
{phpcom:category value=”$subcat” catid=”$cat.catid” chanid=”2″}
<dd style=”float:left;margin-right:5px;”><a{$cat.target} href=”{$subcat.url}”>{$subcat.name}</a></dd>
{/phpcom:category}
{/phpcom:if}
{/phpcom:category}
</dl>

<!–# 调用所有分类标签:chanid=频道ID, depth=调用几级分类(0-3),limit=限制子分类数,first=一级分类数#–>
<dl>
{phpcom:fullcategory value=”$cat” chanid=”2″ depth=”3″ limit=”0″ first=”0″}
{phpcom:if test=”$cat.depth==0″}
<dt style=”font-weight:bold;clear:both;”>{$cat.index} {$cat.name}</dt>
{phpcom:else}
<dd style=”float:left;margin-right:5px;”>{$cat.index} <a{$cat.target} href=”{$cat.url}”{$cat.color}>{$cat.name}</a></dd>
{/phpcom:if}
{/phpcom:fullcategory}
</dl>

<!–# 调用一级分类标签:chanid=频道ID, limit=限制子分类数#–>
<phpcom:basecategory value=”$cat” chanid=”@chanid” limit=”12″>
{phpcom:if test=”$cat.catid == $this->rootid”}
<li>| <a href=”{$cat.url}”{$cat.target}><strong>{$cat.name}</strong></a></li>
{phpcom:else}
<li>| <a href=”{$cat.url}”{$cat.target}{$cat.color}>{$cat.name}</a></li>
{/phpcom:if}

{phpcom:category value=”$cat” rootid=”@rootid” limit=”0″}
{phpcom:if test=”$cat.catid == $this->catid”}
<li><a href=”{$cat.url}”{$cat.color}><strong>{$cat.name}</strong></a></li>
{phpcom:else}
<li><a href=”{$cat.url}”{$cat.color}>{$cat.name}</a></li>
{/phpcom:if}
{/phpcom:category}

<!–# 附件图片标签:
# 属性:chanid=频道ID,tid=主题ID
# 字段:url=连接地址,pageurl=分页链接,thumburl=缩略图地址,previewurl=预览图地址
src=原图地址,i=索引,index=索引有前导0,limit=限制数
#–>
{phpcom:if test=”$attached == 2″}
<ul>
{phpcom:attachimg value=”$im” chanid=”@chanid” tid=”$tid” limit=”0″}
<li style=”float:left;margin-right:10px;”><a href=”{$im.pageurl}”><img src=”{$im.thumburl}” style=”width:135px;height:165px;” /></a></li>
{/phpcom:attachimg}
</ul>
{/phpcom:if}

<!–# 公告标签:limit=限制数,length=标题长度,format=Y-m-d,ellipsis=省略符#–>
{phpcom:announce value=”$row” limit=”10″ length=”50″}
<li><a href=”{$row.url}”{$row.highlight}>{$row.title}</a></li>
{/phpcom:announce}

<!–# 数值转换输出
# select=变量名(必选),length=字符长度,ellipsis=省略符,format=Y-m-d
# 功能属性
# disable-output-escaping=”yes|no” 是否对输出内容进行 HTML 编码,默认 no
# output-strip-tags=”yes|no” 去除 HTML 标记,默认 no
# output-int-value=”yes|no” 输出整数,默认 no
# output-date-value=”yes|no” 输出日期类型,默认 no
# output-variable=”true|false” 输出为变量,默认 false
#–>
{phpcom:value-of select=”$variable” length=”112″ ellipsis=”…” disable-output-escaping=”yes”}

<!–# 专题标签:limit=限制数,length=标题长度,format=Y-m-d,ellipsis=省略符#–>
<phpcom:topical value=”$topic” limit=”10″ length=”38″>
<li><a target=”_blank” href=”{$topic.url}”{$topic.color}>{$topic.title}</a></li>
</phpcom:topical>

<!–# 专题分类标签:sid=专题分类ID,limit=限制数 #–>
<phpcom:special value=”$spec” sid=”0″ limit=”12″>
<li><a target=”_blank” href=”{$spec.url}”{$spec.color}>{$spec.title}</a></li>
</phpcom:special>

<!–# 格式化输出主题标签:chanid=频道ID,limit=限制数,length=标题长度,rows=输出行数,topicid=专题ID,first=是否区分首行,start=标题开始字符,end=标题结束字符 #–>
{phpcom:formatthread value=”$row” chanid=”1″ key=”$index” top=”new” limit=”38″ length=”55″ rows=”3″ topicid=”$topicid” target=”1″ first=”1″ start=”” end=” “}
<!–{phpcom:if test=”$index==0″}–>
<dt>{$row.title}</dt>
<!–{phpcom:else}–>
<dd><a href=”{$row.curl}” target=”_blank”>{$row.name}</a>:{$row.title}</dd>
<!–{/phpcom:if}–>
{/phpcom:formatthread}

<!–# 投票调查标签:
# 属性:tid=文章ID,limit=限制数(默认 1),length=标题长度,ellipsis=省略符,strlen=字符长度
# 字段:index=索引,title=标题,pollurl=投票URL
# 投票选项 option 数组
# $option.input 选择框,$option.index=增量,$option.total=总数,$.option.votes=票数,$option.width=宽度,$option.percent=百分比
#–>
{phpcom:pollvote value=”$poll” tid=”0″ limit=”1″ length=”” ellipsis=”” strlen=”0″}
<form method=”post” action=”{$poll.pollurl}”>
<dl>
<dd><a href=”{$poll.pollurl}” target=”_blank”>{$poll.title}({$poll.voters})</a></dd>
{phpcom:for-each select=”$poll.option” value=”$opt”}
<dd>{$opt.input} {$opt.title} {$opt.percent}%<dd>
{/phpcom:for-each}
<dd>
<button class=”btnsubmit” type=”submit” name=”submitbutton” value=”true”><span>提交</span></button>
<button class=”button” type=”button” name=”viewbutton” onclick=”location.href='{$poll.pollurl}’;”><span>结果</span></button>
</dd>
</dl>
</form>
{/phpcom:pollvote}

<!–# 幻灯片广告调用标签:
# 属性:value=变量名,name=广告位标识,image=0|1 图片类型广告
# 字段:index=索引,title=标题,word=广告文字,url=连接地址,src=图片地址,thumb=缩略图地址
#–>
{phpcom:adverts value=”$advert” name=”NavBanner” image=”0″}
<dt><a href=”{$advert.url}”>{$advert.title}</a></dt>
<dd>{$advert.src}</dd>
{/phpcom:adverts}

<!–# 搜索关键字标签: #–>
{phpcom:hotsearchword value=”$search”}
<a href=”{$search.url}”{$search.highlight}{$search.target}>{$search.word}</a>
{/phpcom:hotsearchword}

<!–# 系统统计标签:
# 属性:value=变量名,name=键名(thread|member|topical)
# 字段:thread.count=主题统计,member.count=会员统计,topical.count=专题统计 | .days=今日统计
#–>
{phpcom:syscount value=”$cnt”}
<li><b>共有主题</b>:{$cnt.thread.count}</li>
<li><b>今日更新</b>:{$cnt.thread.days}</li>
<li><b>共有文章</b>:{$cnt.thread.count_1}</li>
<li><b>共有软件</b>:{$cnt.thread.count_2}</li>
<li><b>共有专题</b>:{$cnt.topical.count}</li>
<li><b>共有会员</b>:{$cnt.member.count}</li>
{/phpcom:syscount}

{phpcom:if test=”$index % 2 == 0″}
<li class=”2″></li>
{phpcom:else}
<li class=”1″></li>
{/phpcom:if}

$totalrec = 总记录数
$pagesize = 页大小,每页数
$pagecount = 页统计,总页数
$pagenow = 当前页
$pageurl = 分页URL

常用模板标签:
phpcom:hotandnewmenu = 热门和更新菜单
phpcom:hotsearchword = 搜索关键字
phpcom:channel = 频道菜单
phpcom:category = 分类菜单
phpcom:basecategory = 一级分类
phpcom:fullcategory = 完整分类
phpcom:categorynav = 分类导航
phpcom:member = 会员列表
phpcom:fetchthread = 主题列表
phpcom:threadlist = 主题列表
phpcom:fetchvideo = 视频列表
phpcom:formatthread = 格式化主题列表
phpcom:friendlink = 友情连接
phpcom:prevthread = 上一主题
phpcom:nextthread = 下一主题
phpcom:download = 下载地址
phpcom:relatedtags = 相关标签
phpcom:topical = 专题列表
phpcom:special = 专题分类
phpcom:pollvote = 投票调查
phpcom:announce = 站内公告
phpcom:adverts = 广告列表
phpcom:advert = 调用广告
phpcom:syscount = 系统统计

常用标签属性:
value = 一般用于变量声明
chanid = 频道ID
catid = 分类ID
limit = 限制数
length = 字符长度
key = 键名,索引

常用标签字段:
title = 标题
url = 连接地址

for 循环标签:for-each
{phpcom:for-each select=”$array” key=”$key” value=”$result”}
……
{/phpcom:for-each}

{phpcom:for select=”$i=0;$i<10;$i++”}
……
{phpcom:for}

if 条件判断
{phpcom:if test=”$key == 0″}
……
{phpcom:elseif test=”$key == 1″}
……
{phpcom:else}
……
{/phpcom:if}