帝国CMS循环二级栏目以及下面的文章
文章描述:
帝国CMS点击一级栏目后,调用当前点击栏目的二级栏目以及二级栏目对应的文章
<?php
$lm_id=$class_r[$GLOBALS[navclassid]][bclassid];
if($lm_id==0)
{
$fl_id=$GLOBALS[navclassid];
}
else
{
$fl_id=$class_r[$GLOBALS[navclassid]][bclassid];
}
//echo $fl_id;
?>
[e:loop={"select classid,classname,classpath from [!db.pre!]enewsclass where bclassid='".$fl_id."' order by classid asc",0,24,0}]
<?php
// 伪静态地址
$classurl=sys_ReturnBqClassname($bqr,9);
//echo $classurl;
?>
栏目:<?=$bqr[classname]?><a href="<?=$classurl?>">MORE+</a></p>
<!-- for 5 -->
文章:
<?php
$r=$empire->query('select id,title,titleurl,titlepic,smalltext,newstime,plnum,onclick,classid from '.$dbtbpre.'ecms_news where classid='.$bqr[classid].' order by id desc limit 5');
while($row=$empire->fetch($r)){
//echo "<pre>";
//print_r($row);
$classid = $row['classid'];
$class=$empire->fetch1("select classname,classpath from {$dbtbpre}enewsclass where classid=".$classid." ");
//print_r($class);
?>
<li><a href="<?=$row[titleurl]?>" title="<?=$row[title]?>" target="_blank"><?=esub($row[title],80)?></a><span>[ <?=date('Y-m-d',$row[newstime])?> ]</span></li>
<? } ?>
[/e:loop]
发布时间:2022/11/04
发表评论