最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

帝國(guó)cms內(nèi)容頁(yè)根據(jù)關(guān)鍵字調(diào)用相關(guān)內(nèi)容的方法

  發(fā)布時(shí)間:2020-01-28 12:06:29   作者:佚名   我要評(píng)論
這篇文章主要介紹了帝國(guó)cms內(nèi)容頁(yè)根據(jù)關(guān)鍵字調(diào)用相關(guān)內(nèi)容的方法,對(duì)于seo與用戶體驗(yàn)來(lái)說(shuō)都是非常好的,這里為大家分享一下代碼,需要的朋友可以參考下

我們使用帝國(guó)cms的時(shí)候,需要調(diào)用當(dāng)前文章的其他相關(guān)的文章,根據(jù)關(guān)鍵字相關(guān)的方式,這樣內(nèi)頁(yè)關(guān)聯(lián)比較好,對(duì)于seo與用戶體驗(yàn)來(lái)說(shuō)都是非常好的

代碼如下

<?php
if ($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."keyboard like '%".$c_key[$i]."%'";
}
$r=$empire->fetch1("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]);
?>
<li><a href="<?=$or[titleurl]?>"><?=$or[title]?></a><span><?=$newstime?></span></li>
<?
}
}
else
{
 
$mesql2=$empire->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]);
?>
<li><a href="<?=$r2[titleurl]?>"><?=$r2[title]?></a><span><?=$newstime?></span></li>
<?
}
}
}
else
{
$mesql2=$empire->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]);
?>
<li><a href="<?=$r2[titleurl]?>"><?=$r2[title]?></a><span><?=$newstime?></span></li>
<?
}
}
?>

注釋:就是我們不填寫關(guān)鍵字的時(shí)候,隨機(jī)調(diào)用文章,如果我們添加了關(guān)鍵字,沒有相關(guān)的文章,也是隨機(jī)調(diào)用文章

相關(guān)文章

最新評(píng)論

滕州市| 陵川县| 龙里县| 班玛县| 保德县| 靖边县| 北宁市| 大冶市| 洛隆县| 三河市| 本溪市| 安泽县| 抚州市| 郧西县| 张北县| 长汀县| 四平市| 额敏县| 双城市| 香格里拉县| 台安县| 泸水县| 蕲春县| 化德县| 定安县| 和平县| 民县| 苗栗市| 措美县| 阳曲县| 奉节县| 原平市| 石阡县| 沁水县| 丘北县| 绿春县| 安图县| 嘉善县| 芦溪县| 安远县| 会泽县|