帝国cms 内容页根据关键词来调⽤相关内容,否则相关内容则随机

关键词相关内容无则随机

内容页根据关键词来调⽤相关内容,如果没有相关内容则随机获得⽂章代码
代码未经测试!请自行测试!


<?php
if
 ($navinfor['keyboard'])
{
$c_key=explode(',',$navinfor['keyboard']);
$count=count($c_key);
for($i=0;$ifetch1("select * from {$dbtbpre}ecms_news where id".$navinfor['id']." and ".$repadd." order by newstime desc limit 1");
if
($r[title])
{
$mesql=$empire->query("select titleurl,title,newstime from {$dbtbpre}ecms_news where id".$navinfor['id']." and ".$repadd." order by newstime desc limit 10");
while($or=$empire->fetch($mesql))
{
$newstime=date('Y-m-d',$or[newstime]);
?>
  • <a href="">
  • query("select * from {$dbtbpre}ecms_news where id".$navinfor['id']." order by rand() desc limit 10"); while($r2=$empire->fetch($mesql2)) { $newstime=date('Y-m-d',$o2[newstime]); ?>
  • <a href="">
  • query("select titleurl,title,newstime from {$dbtbpre}ecms_news order by rand() desc limit 10"); while($r2=$empire->fetch($mesql2)) { $newstime=date('Y-m-d',$r2[newstime]); >
  • <a href="">
  • 如修改⽂章条数的话,把limit后⾯的数字改⼀下。

    发表回复

    您的电子邮箱地址不会被公开。 必填项已用*标注