phpcms怎么調(diào)用相關(guān)文章?
今天我們來說說關(guān)于PHPcms v9系統(tǒng)如何在文章的最后調(diào)用隨機文章和相關(guān)文章,這樣做的目的是為了使網(wǎng)站更利于seo優(yōu)化和增加用戶體驗效果,其他的小編在這里就不多說了先看看主要內(nèi)容吧。
1.PHPcms系統(tǒng)調(diào)用隨機文章:
{pc:content action=”lists” catid=”$catid” num=”8″ order=”rand()” return=”info”} <ul> {loop $info $v} <li><a href=”{$v['url']}” target=”_blank” title=”{$v['title']}”{title_style($v[style])}>{$v['title']}</a></li> {/loop} </ul> {/pc}
2.PHPcms系統(tǒng)調(diào)用相關(guān)文章:
{get sql=”select keywords from phpcms_content where contentid=$contentid and status=’99′” return=”gt”}{/get} {php $tempkey = get_sql_in($gt[keywords]);} {get sql=”SELECT DISTINCT c.contentid,c.thumb,c.title,c.style,c.url FROM `phpcms_content` c,`phpcms_content_tag` t WHERE c.contentid=t.contentid and c.status=99 and c.contentid!=$contentid and c.catid=$catid AND t.tag IN($tempkey) ORDER BY c.contentid DESC” rows=”6″ return=”k”} <tr> <td ><span><a href=”{$k[url]}” title=”{$k[title]}”>{str_cut($k[title], 26,”)}</a></span></td> </tr> {/get}
PHP中文網(wǎng),大量的免費PHPCMS教程,歡迎在線學(xué)習(xí)!