首页 > CMS > 帝国Empire > 正文

帝国关键词字段调取

2024-08-28 12:17:49
字体:
来源:转载
供稿:网友

解析:like '%$keyb[0]%'  代表调取关键词第一个like '%$keyb[1]%' 调取第二个


html    mysql


<?php$keyb=explode(',',$navinfor[keyboard]);$tushu =count($keyb);if($navinfor[keyboard]=='' || $navinfor[keyboard]==null){}else{?>    <div id="mc-news" class="mc-box gax-box clearfix">      <div class="head clearifx">        <div class="title">相关文章</div>        <div class="more"> <a target="_blank" href="/yz/3_37.html" >更多>></a> </div>      </div>      <ul class="list clearfix">[e:loop={"select * from www_96kaifa_com_ecms_ecms_news where classid=11 and title like '%$keyb[0]%' order by rand() desc limit 12",6,24,0}]        <li><i class="dot"></i><a target="_blank" href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></li>[/e:loop]<?phpif($tushu==1){$num=$empire->gettotal("select count(*) as total from www_96kaifa_com_ecms_ecms_news where classid=11 and title like '%$keyb[0]%' order by rand() desc");$num2=12-$num;if($num2>0 || $num2==0){}else{$num2=0;}?>[e:loop={"select * from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) order by rand() desc limit $num2",6,24,0}]        <li><i class="dot"></i><a target="_blank" href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></li>[/e:loop]<?}?><?phpif($tushu==2){$num=$empire->gettotal("select count(*) as total from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and title like '%$keyb[0]%' order by rand() desc");$num201=12-$num;if($num201>0 || $num201==0){}else{$num201=0;}?>[e:loop={"select * from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and title like '%$keyb[1]%' order by rand() desc limit $num201",6,24,0}]        <li><i class="dot"></i><a target="_blank" href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></li>[/e:loop]<?}?><?phpif($tushu==2){$num30=$empire->gettotal("select count(*) as total from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and (title like '%$keyb[0]%' or title like '%$keyb[1]%') order by rand() desc");$num20=12-$num30;if($num20>0 || $num20==0){}else{$num20=0;}?>[e:loop={"select * from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) order by rand() desc limit $num20",6,24,0}]        <li><i class="dot"></i><a target="_blank" href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></li>[/e:loop]<?}?><?phpif($tushu==3){$num3=$empire->gettotal("select count(*) as total from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and title like '%$keyb[0]%' order by rand() desc");$num4=12-$num3;if($num4>0 || $num4==0){}else{$num4=0;}?>[e:loop={"select * from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and (title like '%$keyb[1]%' or title like '%$keyb[2]%') order by rand() desc limit $num4",6,24,0}]        <li><i class="dot"></i><a target="_blank" href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></li>[/e:loop]<?}?><?phpif($tushu==3){$num300=$empire->gettotal("select count(*) as total from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and (title like '%$keyb[0]%' or title like '%$keyb[1]%' or title like '%$keyb[2]%') order by rand() desc");$num200=12-$num300;if($num200>0 || $num200==0){}else{$num200=0;}?>[e:loop={"select * from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) order by rand() desc limit $num200",6,24,0}]        <li><i class="dot"></i><a target="_blank" href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></li>[/e:loop]<?}?><?phpif($tushu==4){$num5=$empire->gettotal("select count(*) as total from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and title like '%$keyb[0]%' order by rand() desc");$num6=12-$num-$num5;if($num6>0 || $num6==0){}else{$num6=0;}?>[e:loop={"select * from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and (title like '%$keyb[1]%' or title like '%$keyb[2]%' or title like '%$keyb[3]%') order by rand() desc limit $num6",6,24,0}]        <li><i class="dot"></i><a target="_blank" href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></li>[/e:loop]<?}?><?phpif($tushu==4){$num3000=$empire->gettotal("select count(*) as total from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) and (title like '%$keyb[0]%' or title like '%$keyb[1]%' or title like '%$keyb[2]%') order by rand() desc");$num2000=12-$num3000;if($num2000>0 || $num2000==0){}else{$num2000=0;}?>[e:loop={"select * from www_96kaifa_com_ecms_ecms_news where classid in (9,10,11,12,13,14) order by rand() desc limit $num2000",6,24,0}]        <li><i class="dot"></i><a target="_blank" href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></li>[/e:loop]<?}?>      </ul>    </div><?}?>


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表