当我们使用Empire CMS时,需要调用当前文章的其他相关文章。根据关键字相关的方法,代码如下? phpif($navinfor['keyboard']){$c_key=explode(',',$navinfor[ 'keyboard']);$count=count($c_key );for($i=0;$i$count;$i++){if($i==0){$or='';}else{$or='or';}$repadd.=$or .'keyboardlike'%'.$c_key[$i].'%'';}$r=$empire-fetch1('select*from{$dbtbpre}ecms_newswhereid '.$navinfor['id'].'and' .$repadd.'orderbynewstimedesclimit1');if($r[title]){$mesql=$empire-query('selecttitleurl,title,newstimefrom{$dbtbpre}ecms_newswhereid '.$navinfor['id'].'and' .$repadd.'orderbynewstimedesclimit10');while($or=$empire-fetch($mesql)){$newstime=date('Y-m-d',$or [newstime]);liahref='?=$or [titleurl]?'?=$or[title]?/aspan?=$newstime?/span/li?}}else{$mesql2=$empire-query( 'select*from{$dbtbpre}ecms_newswhereid'.$navinfor ['id'].'orderbyrand()desclimit10');while($r2=$empire-fetch($mesql2)){$newstime=date('Y-m-d',$o2[newstime]);liahref='?=$r2[titleurl]?'?=$r2[title]?/aspan?=$newstime?/span/li?}}}else{$mesql2=$empire-query('selecttitleurl,title,newstimefrom{ $dbtbpre}ecms_newsorderbyrand()desclimit10');while($r2=$empire-fetch($mesql2)){$newstime=date('Y-m-d',$ r2[newstime]);liahref='?=$ r2[titleurl]?'?=$r2[title]?/aspan?=$newstime?/span/li?}}?注意:我们在不填写关键词的时候,文章是随机调用的。如果我们添加关键词而没有相关文章,文章也是随机调用的。