0712-2888027 189-8648-0214
微信公眾號(hào)

孝感風(fēng)信網(wǎng)絡(luò)科技有限公司微信公眾號(hào)

當(dāng)前位置:主頁(yè) > 技術(shù)支持 > PHPCMS > phpcms模板中常用的GET標(biāo)簽[熱點(diǎn)/評(píng)論/digg/相關(guān)新聞]

phpcms模板中常用的GET標(biāo)簽[熱點(diǎn)/評(píng)論/digg/相關(guān)新聞]

時(shí)間:2015-11-11來(lái)源:風(fēng)信官網(wǎng) 點(diǎn)擊: 669次

@7天內(nèi)的點(diǎn)擊排行榜
<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], 88)}</a></li>
{/get}
</ol>

@7天內(nèi)的評(píng)論排行榜
<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], 88)}</a></li>
{/get}
</ol>

@圖片推薦GET標(biāo)簽(調(diào)用推薦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 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 $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標(biāo)簽
<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], 88)}</a></li>
{/get}
</ol>

@只調(diào)用新聞模型且推薦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], 88)}</a></li>
{/if}
</ul>

@調(diào)用相關(guān)新聞
{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], 88)}</a></li>
{/get}

欄目列表
推薦內(nèi)容
熱點(diǎn)內(nèi)容
展開(kāi)