今天在做一个帝国cms的功能的时候,涉及到了专题功能需要把专题所有标题标题图片,以及专题下有多少信息等数据,帝国cms单页循环调用所有专题/更新时间及对应专题下的文章标题和链接
[e:loop={"select * from phome_enewszt where ztimg<>'' order by onclick desc limit 5",10,24,0}] <li> <a href="/<?=$bqr['ztpath']?>/" title="<?=$bqr['ztname']?>"> <img src="<?=$bqr['ztimg']?>" alt="<?=$bqr['ztname']?>"> <p><?=$bqr['ztname']?></p> </a> </a></li> [/e:loop]
<?php $ecms_bq_sql=sys_ReturnEcmsLoopBq("select ztid,ztpath,ztname,ztimg from [!db.pre!]enewszt limit 4",0,24,0); $bqno=0; while($bqr=$empire->fetch($ecms_bq_sql)) { $ztid=($bqr[ztid]); $bqno++; ?> <li> <div class="album-list uk-flex uk-flex-middle"> <div class="icon uk-cover-container"> <a href="<?=$public_r[newsurl]?><?=$bqr['ztpath']?>/" target="_blank"> <img src="<?=$bqr['ztimg']?>" alt="<?=$bqr['ztname']?>" uk-cover> </a> </div> <div class="info flex1"> <a class="title oneTxtLine" href="<?=$public_r[newsurl]?><?=$bqr['ztpath']?>/" target="_blank"><?=$bqr['ztname']?></a> <span class="num">共 款</span> </div> <a class="btn" href="<?=$public_r[newsurl]?><?=$bqr['ztpath']?>/" target="_blank">进入专辑</a> </div> <div class="album-game uk-flex uk-flex-wrap"> <?php $ecms_bq_sql2=sys_ReturnEcmsLoopBq("select id,ztid,classid from [!db.pre!]enewsztinfo where ztid='$ztid' limit 6",0,24,0); $bqno2=0; while($bqr2=$empire->fetch($ecms_bq_sql2)) { $id=($bqr2[id]); $bqno2++; ?> <?php $ecms_bq_sql3=sys_ReturnEcmsLoopBq("select titleurl,title,classid,titlepic from {$dbtbpre}ecms_{$class_r[$bqr2[classid]][tbname]} where id={$bqr2[id]}",0,24,0); $bqno3=0; while($bqr3=$empire->fetch($ecms_bq_sql3)) { $bqsr3=sys_ReturnEcmsLoopStext($bqr3); $bqno3++; ?> <a class="title oneTxtLine before-middle" href="<?=$bqsr3[titleurl]?>" target="_blank"><?=$bqr3[title]?></a> <?php } ?> <?php } ?> </div> </li> <?php } ?>
$rr=$empire->fetch1("SELECT GROUP_CONCAT(id) from phome_enewsztinfo where ztid='$r[id]'"); $ff=$rr[0]; $ga=explode(",",$ff); for($i=0;$i<4;$i++){ if($ga[$i]) { $cc=$empire->fetch1("select * from phome_ecms_news where id='$ga[$i]'"); $nr.='<a href="'.$cc[titleurl].'" target="_blank" class="hover_a"><img src="'.$cc[titlepic].'" alt="'.$cc[title].'" /><span class="b_bj"></span></a>'; } } $num=$empire->gettotal("select count(*) as total from phome_enewsztinfo where ztid='$r[id]'"); $listtemp='<li > <div class="hj_top"> <a href="/[!--titleurl--]/" target="_blank"><img src="[!--titlepic--]" alt="[!--title--]" /></a> <div class="hj_hover"> <div class="hj_bj"></div> <div class="hj_a"> '.$nr.' <a href="/[!--titleurl--]/" target="_blank" class="na">更多</a> </div> </div> </div> <div class="hj_bt"> <p class="title"><a href="/[!--titleurl--]/" target="_blank">[!--title--]</a></p> <p class="intro"><span>[!--newstime--]</span><span><em>'.$num.'</em>个手游</span><a href="/[!--titleurl--]/">查看</a></p> </div> </li>';