您现在的位置是:首页 > cms教程 > phpcms教程phpcms教程

phpcms调用相关文章的实现方法代码示例

语兰2025-04-29 16:44:15phpcms教程已有4人查阅

导读今天我们来说说关于PHPcmsv9系统如何在文章的最后调用随机文章和相关文章,这样做的目的是为了使网站更利于seo优化和增加用户体验效果,其他的小编在这里就不多说了先看看主要内容吧。

今天我们来说说关于PHPcmsv9系统如何在文章的最后调用随机文章和相关文章,这样做的目的是为了使网站更利于seo优化和增加用户体验效果,其他的小编在这里就不多说了先看看主要内容吧。
1.PHPcms系统调用随机文章:
{pc:content action=”lists” catid=$catid” num=8″ order=rand()return=”info”}
{loop $info $v} {$v['title']} {/loop} {/pc}
2.PHPcms系统调用相关文章:
{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 DESCrows=”6″ return=”k”}
<tr>
<td><span><a>{str_cut($k[title], 26,”)}</a></span></td>
</tr>
{/get}

本文标签:

很赞哦! (0)

暂无内容
暂无内容
暂无内容
暂无内容
留言与评论 (共有 0 条评论)
昵称:
匿名发表 登录账号
         
验证码: