帝国cms灵动标签循环调用循环子栏目+信息
循环子栏目+信息(精品)
代码一、SQL语句灵动标签结合万能标签循环子栏目及信息;
1、有样式!!!
循环子栏目+信息
//取得栏目id信息,id=3
[e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=$bclassid order by myorder,classid asc",0,24,0}]
<li >[/e:loop]
[e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=$bclassid order by myorder,classid asc",0,24,0}]
[ecmsinfo] $bqr[classid],3,0,1,1,20,1,0,0[/ecmsinfo]
[/e:loop]
帝国cms万能标签语法规则:
[ecmsinfo]栏目ID,显示条数,标题截取数,是否显示栏目名,操作类型,模板ID,只显示有标题图片,附加SQL条件,显示排序[/ecmsinfo]
//展示
[ecmsinfo] $bqr[classid],3,0,1,1,20,1,0,0[/ecmsinfo]
在标签模板中增加一个模板标签ID=20
页面模板内容
[!--empirenews.listtemp--][!--empirenews.listtemp--]
列表内容模板:
注意:注意勾选“使用程序代码”
$listtemp='
[!--title--]
'.$class_r[$r[classid]]['classname'].'
¥价格: [!--price--]起
精选
';
2、无样式!!!
[e:loop={"select classid,classname from {$dbtbpre}enewsclass where bclassid=$bclassid order by myorder,classid asc",0,24,0}]
[ecmsinfo]$bqr[classid],50,30,0,0,25,0,'','id ASC'[/ecmsinfo]
[/e:loop]
[!--empirenews.listtemp--][!--empirenews.listtemp--]
[!--no.num--]、[!--title--]
[e:loop={'selfinfo',100,0,0,"id'$navinfor[id]'",'id asc'}]
- <a href="#" title="">
、
//注释!!
//$bqno 就是序列号。默认从1开始
//要从2开始就 $bqno+1
//要从3开始就 $bqno+2
[/e:loop]
代码3:栏目循环当前栏目下所有子栏目及文章信息;
//测试 正常 注意: class 中的"" 务必改为'' 否则 生成失败!
//" . $proMenu_sub[ classname ] . "
//".$proMenu_arti[title]."
//" . $no . "、" . $proMenu_arti[ title ] . "
query( "select bclassid,classname,classid,sonclass,classpath from {$dbtbpre}enewsclass where bclassid in (2) order by myorder,classid" );
while ( $proMenu = $empire->fetch( $mesql ) ) {
$classurl = sys_ReturnBqClassname( $proMenu, 9 ); //栏目链接
echo "" . $proMenu[ classname ] . "";
if ( $proMenu[ sonclass ] ) { //有子栏目是非终极栏目 列出子栏目
$mesql_sub = $empire->query( "select classname,classid,sonclass,classpath from {$dbtbpre}enewsclass where bclassid=" . $proMenu[ classid ] );
echo "";
while ( $proMenu_sub = $empire->fetch( $mesql_sub ) ) {
$classurl = sys_ReturnBqClassname( $proMenu_sub, 9 ); //栏目链接
echo "- " . $proMenu_sub[ classname ] . "
";
$mesql_arti = $empire->query( "select * from {$dbtbpre}ecms_news where classid=" . $proMenu_sub[ classid ] );
echo "";
$no = 0;
while ( $proMenu_arti = $empire->fetch( $mesql_arti ) ) {
$titleurl = sys_ReturnBqTitleLink( $proMenu_arti ); //标题链接
$no++;
echo "- " . $no . "、" . $proMenu_arti[ title ] . "
";
}
echo "
";
echo "
";
}
echo "";
} else { //终极栏目文章列表
echo "";
$mesql_arti = $empire->query( "select * from {$dbtbpre}ecms_news where classid=" . $proMenu[ classid ] );
$no = 0;
while ( $proMenu_arti = $empire->fetch( $mesql_arti ) ) {
$titleurl = sys_ReturnBqTitleLink( $proMenu_arti ); //标题链接
$no++;
echo "- " . $proMenu_arti[ title ] . "
";
}
echo "
";
}
echo "";
}
?>
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。