本文档由橙子博客维护
内容查询
{sdcms:re table="sd_category" top="1" where="modeid in (2,5)" order="ordnum,cateid" var="nid:cateid"}
{sdcms:rs top="10" field="id,isurl,url,ispic,pic,title,style,classid,createdate" table="sd_content" where="classid in([sdcms.get_sonid(1)]) and islock=1" order="ontop desc,createdate desc"}
<li><a href="{$rs[link]}" title="{$rs[title]}">{sdcms.cutstr($rs[title],90,1)}</a></li>
{/sdcms:rs}
{/sdcms:re}
|
栏目查询
{sdcms:re table="sd_category" top="1" where="cateid in (2,5)" order="ordnum,cateid" var="ctid:cateid"}
{sdcms:rs table="sd_category" top="0" where="followid = [ctid]" order="ordnum,cateid" }
<li{if $rs[cateid]=classid} class="hover"{/if}><a href="{$rs[link]}">{$rs[catename]}</a></li>
{/sdcms:rs}
{/sdcms:re}
|
模糊查询
<!--产品开始-->
{sdcms:re top="1" table="sd_category" where="modeid in (5,2)" order="ordnum,cateid" var="v_rp:cateid"}
{dim sjcp:sjcp=sdcms.get_sonid(v_rp)}
<!--下面再查询栏目或内容-->
{sdcms:rs top="3" field="id,isurl,url,ispic,pic,title,style,classid,intro" table="sd_content" where="classid in([sjcp]) and islock=1" order="ontop desc,id desc"}
//内容
{/sdcms:rs}
{/sdcms:re}
<!--产品结束-->排序
【栏目排序】 order="ordnum,cateid" |
asc 按升序排列 (不用写,默认使用这个) desc 按降序排列 |
【随机查询】 其他都一样 order="rnd" |
【内容分页】 pagesize="{var pagenum}" 【自定义参数,参数从1+,最大值为rs结果集个数】 auto="i" |