循环调用标题分类
列表页循环调用标题分类
须终极栏目下;将栏目进行标题分类
常用代码
<?php
$ttids_sql=sys_ReturnEcmsLoopBq("select ttids from [!db.pre!]enewsclassadd where classid=$GLOBALS[navclassid]",0,24,0);
while($bqr=$empire->fetch($ttids_sql)){
$ttids=explode(',',trim($bqr[ttids],","));
foreach($ttids as $id){
$ttname_sql=sys_ReturnEcmsLoopBq("select tname from [!db.pre!]enewsinfotype where typeid=$id",0,24,0);
while($bqr2=$empire->fetch($ttname_sql)){
?>
<h2><?=$bqr2[tname]?></h2>
<ul>
[e:loop={'selfinfo',50,0,0,"ttid='$id'"}]
<li><a href="<?=$bqsr[titleurl]?>"><?=$bqr[title]?></a></li>
[/e:loop]
</ul>
<?php
}
}
}
?>
增加序列号
<?php
$ttids_sql=sys_ReturnEcmsLoopBq("select ttids from [!db.pre!]enewsclassadd where classid=$GLOBALS[navclassid]",0,24,0);
while($bqr=$empire->fetch($ttids_sql)){
$j=0;
$ttids=explode(',',trim($bqr[ttids],","));
foreach($ttids as $id){
$ttname_sql=sys_ReturnEcmsLoopBq("select tname from [!db.pre!]enewsinfotype where typeid=$id",0,24,0);
while($bqr2=$empire->fetch($ttname_sql)){
$j++;
?>
<h2><i><?php echo $j?></i><?=$bqr2[tname]?></h2>
[e:loop={'selfinfo',50,0,0,"ttid='$id'",'id asc'}]
<li><a href="<?=$bqsr[titleurl]?>" target="_blank"><?=$bqr[title]?></a></li>
[/e:loop]
<?php
}
}
}
?>
在需要调用的页面模板里加入以下代码:
标题分类:
[e:loop={1,10,0,0}]
<a href="<?=sys_ReturnBqInfoTypeUrl($bqr[ttid])?>"><?=$class_tr[$bqr[ttid]][tname]?></a> <a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]
帝国cms 列表页循环调用标题分类
帝国cms列表页循环调用标题分类
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。