最近一直在研究帝国cms,发现帝国cms后台的相关文章调用出来没有自己想要的,并且调用出来的相关还需要自己在网站后台去设置一下,在网上搜索了好久,发现有一个简单的命令能够实现这个功能,直接调用当前文章的关键词作为相关文章,备注:相关代码需要根据自己实际情况去修改,代码如下:
[e:loop={0,4,3,1,"'%$navinfor[keyboard]%' or keyboard like '%$navinfor[keyboard]%'"}]
<div class="hlist"><span class="pic"><a href="<?=$bqsr['titleurl']?>" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" title="<?=$bqr['title']?>">
<img src="<?=$bqr['titlepic']?>" alt="<?=$bqr['title']?>" />
</a></span>
<strong class="tit">
<a href="<?=$bqsr['titleurl']?>" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" title="<?=$bqr['title']?>">
<?=$bqr['title']?></a>
</strong><p>
<a href="<?=$bqsr['titleurl']?>" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank">
<?=sub($navinfor[smalltext],0,40,false)?>....</a></p></div>
[/e:loop]