0712-2888027 189-8648-0214
微信公众号

孝感风信网络科技有限公司微信公众号

当前位置:主页 > 技术支持 > PHPCMS > phpcms模板中常用的GET标签[热点/评论/digg/相关新闻]

phpcms模板中常用的GET标签[热点/评论/digg/相关新闻]

时间:2022-09-17来源:风信官网 点击: 291次

@7天内的点击排行榜
<ol>
{get sql="SELECT * FROM `phpcms_content` c,`phpcms_content_count` n WHERE updatetime>'.TIME.'-7*86400 and c.contentid=n.contentid AND c.`status`=99 and catid='$catid' '.get_sql_catid($catid).' ORDER BY n.hits DESC" rows="8"}
<li><a href="http://lanfeng898.blog.163.com/blog/{$r[url]}">{str_cut($r[title], rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" 88)}</a></li>
{/get}
</ol>

@7天内的评论排行榜
<ol>
{get sql="SELECT * FROM `phpcms_content` c,`phpcms_content_count` n WHERE updatetime>'.TIME.'-7*86400 and c.contentid=n.contentid AND c.`status`=99 and catid='$catid' '.get_sql_catid($catid).' ORDER BY n.comments DESC" rows="8"}
<li><a href="http://lanfeng898.blog.163.com/blog/{$r[url]}">{str_cut($r[title], rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" 88)}</a></li>
{/get}
</ol>

@图片推荐GET标签(调用推荐ID为10的带有缩略图的信息)
{get sql="SELECT * FROM `phpcms_content` a, `phpcms_c_news` b WHERE a.contentid=b.contentid AND  `status`=99  AND  `thumb`!=''  AND  a.`contentid` IN(SELECT `contentid` FROM `phpcms_content_position` WHERE `posid`='10') ".get_sql_catid($catid)." ORDER BY a.contentid DESC" rows="3"}
<div class="col">
<div class="img" width="134"><a href="http://lanfeng898.blog.163.com/blog/{$r[url]}"><img rel="nofollow" src="http://lanfeng898.blog.163.com/blog/{thumb($r[thumb], 130, 90)}" alt="{$r[title]}" border="0" /></a></div>
<h6><a href="http://lanfeng898.blog.163.com/blog/{$r[url]}">{if rel="nofollow" $r[style]}<span class="{$r[style]}">{str_cut($r[title], 800,'')}</span>{else}{str_cut($r[title], 800,'')}{/if}</a></h6>
</div>
{/get}

@DIGG排行榜的GET标签
<ol>
{get sql="SELECT * FROM phpcms_content c,phpcms_digg d WHERE c.contentid=d.contentid AND c.status=99 ORDER BY d.supports DESC" rows="8"}
<li><span>{$r[supports]}</span><a href="http://lanfeng898.blog.163.com/blog/{$r[url]}">{str_cut($r[title], rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" 88)}</a></li>
{/get}
</ol>

@只调用新闻模型且推荐ID为7的新闻
<ul>
{get sql="SELECT * FROM phpcms_content c,phpcms_c_news n,phpcms_content_position p WHERE c.contentid=n.contentid and c.contentid=p.contentid and posid=7 and `status`=99 ORDER BY inputtime DESC" rows="6"}
<li><a href="http://lanfeng898.blog.163.com/blog/{$r[url]}">{str_cut($r[title], rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" 88)}</a></li>
{/if}
</ul>

@调用相关新闻
{get sql="SELECT * FROM phpcms_content c,phpcms_content_tag t WHERE c.contentid!='$contentid' and c.contentid=t.contentid and c.status=99 AND t.tag IN('.get_sql_in($r[keywords]).')  ORDER BY c.contentid DESC" rows="6"}
<li><a href="http://lanfeng898.blog.163.com/blog/{$r[url]}">{str_cut($r[title], rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" 88)}</a></li>
{/get}

栏目列表
推荐内容
热点内容
展开