标签:
模板防盗:<%if not in_sdcms then response.write("template load fail"):response.end() end if%>
--------------
seo标题:
{sdcms[webname]}{sdcms[seotitle]}
seo关键词:
{seokey}
seo描述:
{seodesc}
--------------
文件路径例如:images路径:{webroot}theme/default/images/
--------------
模板引用:
{sdcms:include("sdcms_head.asp")}
{sdcms:include("sdcms_foot.asp")}
--------------
获取单个栏目:
{sdcms.getcateurl(1)} 获得栏目1的链接
{sdcms.getcatename(1)} 栏目名称
--------------
1.首页调用单页简介的方法为:
{sdcms:rs table="sd_model_page" where="classid=1"}
{sdcms.dehtml($rs[intro])}
{/sdcms:rs}
2.首页调用单页内容的方法为:
{sdcms:rs table="sd_model_page" where="classid=1"}
{$rs[content]}
{/sdcms:rs}
--------------
调用几条内容
{sdcms:rs table="sd_content" top="4" where="classid=1"}
<li><a href="{$rs[link]}"><img src="{$rs[pic]}">{$rs[title]}</a></li>
{/sdcms:rs}
classid=1 栏目id,top="4"调用4条
数据表sd_content其他字段:id、pic、createdate、lastupdate、style、ispic、tags、keyword、description、intro(详情)
调用详情前70个字符(过滤html){sdcms.cutstr(sdcms.nohtml($rs[intro]),70,1)}
时间格式
{sdcms.getdate($rs[createdate],"-",1)}
--------------
调用几个栏目
{sdcms:rs table="sd_category" top="10" where="ismenu=1" order="ordnum"}
<li><a href="{$rs[link]}">{$rs[catename]}</a></li>
{/sdcms:rs}
多级栏目:
{sdcms:rp table="sd_category" top="0" where="followid=[classid] and modeid>0" order="ordnum,cateid" var="sdcms_dim:sonid" auto="j"}
<div class="b{if j>1} mt10{/if} w670">
<div class="subject"><span><a href="{$rp[link]}">更多>></a></span>{$rp[catename]}</div>
<div class="p10">
<ul class="toplist">
{sdcms:rs top="10" field="id,title,style,createdate,isurl,url,classid" table="sd_content" where="islock=1 and classid in([sdcms_dim])" order="ontop desc,id desc"}
<li><span>{sdcms.getdate($rs[createdate],"-",1)}</span><a href="{$rs[link]}" title="{$rs[title]}"{if $rs[isurl]=1} target="_blank"{/if} {$rs[style]}>{sdcms.cutstr($rs[title],70,1)}</a></li>
{/sdcms:rs}
</ul>
</div>
</div>
{/sdcms:rp}
--------------
友情链接
{sdcms:rs top="0" table="sd_expand_link" where="islock=1" order="id desc"}
<a href="{$rs[weburl]}" target="_blank">{$rs[webname]}</a>
{/sdcms:rs}
参数:islogo=0
--------------
if判断格式
{if i mod 5=0}<li class="mid"></li>{/if}
--------------
前栏目名字
您所在的位置:<a href="{webroot}">首页</a>{sdcms.getpostion(parentid," > ")}
--------------
详情页 专用
{title} 标题
作者:{author} 来源:{comefrom} 日期:{createdate}
{content} 内容
<div class="pre">上一篇:{sdcms:rs top="1" field="id,isurl,url,title,style,classid" table="sd_content" where="islock=1 and classid=
[classid] and id<[id] and isurl=0" order="id desc"}
{rs:eof}<span class="c9">没有资料</span>{/rs:eof}
<a href="{$rs[link]}" title="{$rs[title]}">{sdcms.cutstr($rs[title],70,1)}</a>
{/sdcms:rs}</div>
<div class="next">下一篇:{sdcms:rs top="1" field="id,isurl,url,title,style,classid" table="sd_content" where="islock=1 and classid=
[classid] and id>[id] and isurl=0"}
{rs:eof}<span class="c9">没有资料</span>{/rs:eof}
<a href="{$rs[link]}" title="{$rs[title]}">{sdcms.cutstr($rs[title],70,1)}</a>
{/sdcms:rs}</div>
标签:
原文地址:http://www.cnblogs.com/masterccc/p/5249985.html