帝国cms调用tags分类下的所有信息 (tags及tags下的文章)
摘要:<?php$ecms_bq_sql=sys_ReturnEcmsLoopBq("select tagid,tagname,cid from [!db.pre!]enewstags limit 100",0,24,0);$bqno=0;while($bqr=$empire->fetch($ecms_bq_sql)){...
<?php $ecms_bq_sql=sys_ReturnEcmsLoopBq("select tagid,tagname,cid from [!db.pre!]enewstags limit 100",0,24,0); $bqno=0; while($bqr=$empire->fetch($ecms_bq_sql)) { $ztid=($bqr[ztid]); $bqno++; ?> 模板代码内容 <a href="<?=$public_r[newsurl]?>e/tags/?tagname=<?=$bqr['tagname']?>"><?=$bqr['tagname']?></a> <?php $ecms_bq_sql2=sys_ReturnEcmsLoopBq("select tagid,id,classid from [!db.pre!]enewstagsdata where tagid={$bqr[tagid]} limit 10",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++; ?> <li><?=$bqno2?>、<a href="<?=$bqsr3[titleurl]?>" target="_blank"><?=$bqr3[title]?></a></li> <?php } ?> <?php } ?> <?php } ?>
效果:(信息重复:因为一条信息多个tag)