帝国cmsPHP循环一级栏目子栏目以及子栏目下的栏目信息支持PHP7.x

时间:2024年04月11日

/

来源:网络

/

编辑:佚名

[e:loop={"select classid,classname,islast from {$dbtbpre}enewsclass where bclassid='0' and showclass=0 order by myorder,classid ASC limit 5",0,24,0}]
<?php   
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址   
?>
<li><a href="<?=$classurl?>" class="<?=$class?>"><h1><?=$bqr[classname]?></h1></a>
<?php
if(!$bqr[islast]) //判断是否终极栏目
{
?>
    <ul>
    <?php
    //取得栏目下的子栏目       
    $newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid asc limit 4"); $i=0;
    while($classr=$empire->fetch($newsclass))
    {
        $classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址
        $i++;
        ?>
        <a href="<?=$classrurl?>"><?=$classr[classname]?></a>
    <?php
    }
    ?>
    </ul>
    <div>
    <h2>最新数据</h2>
        <?php
        $ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],5,0,0,'','');
        $bqno2=0;
        while($bqr2=$empire->fetch($ecms_bq_sql2))
        {
                $bqsr2=sys_ReturnEcmsLoopStext($bqr2);
                $bqno2++;
                ?>
                <li><a href="<?=$bqr2[titleurl]?>"><?=$bqr2[title]?></a></li>
                <?php
        }
        ?>
    </div>
    <div>
    <h2>最热数据</h2>
        <?php
        $ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],5,0,0,'','onclick desc');
        $bqno3=0;
        while($bqr3=$empire->fetch($ecms_bq_sql3))
        {
                $bqsr3=sys_ReturnEcmsLoopStext($bqr3);
                $bqno3++;
                ?>
                <li><a href="<?=$bqr3[titleurl]?>"><?=$bqr3[title]?></a></li>
                <?php
        }
        ?> 
    </div>
    <div>
    <h2>最新数据2</h2>
        <?php
        $ecms_bq_sql4=sys_ReturnEcmsLoopBq($bqr[classid],'5,5',0,0,'','');
        $bqno4=0;
        while($bqr4=$empire->fetch($ecms_bq_sql4))
        {
                $bqsr4=sys_ReturnEcmsLoopStext($bqr4);
                $bqno4++;
                ?>
                <li><a href="<?=$bqr4[titleurl]?>"><?=$bqr4[title]?></a></li>
                <?php
        }
        ?> 
    </div>
    <div>
    <h2>最新数据3</h2>
        <?php
        $ecms_bq_sql5=sys_ReturnEcmsLoopBq($bqr[classid],'10,5',0,0,'','');
        $bqno5=0;
        while($bqr5=$empire->fetch($ecms_bq_sql5))
        {
                $bqsr5=sys_ReturnEcmsLoopStext($bqr5);
                $bqno5++;
                ?>
                <li><a href="<?=$bqr5[titleurl]?>"><?=$bqr5[title]?></a></li>
                <?php
        }
        ?> 
    </div>
<?php
}
?>
</li>
[/e:loop]
案例图:

[e:loop={"select classid,classname,islast from {$dbtbpre}enewsclass where classid in(1,2,3,4,5,6,7,8,9,100) and showclass=0 order by myorder,classid ASC",0,24,0}]
<div class="con_lm bj_mt30 louceng">
<div class="head_2 main">
<div class="fl lm_head_l">
<h3>
<i></i>
<?php   
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址   
?>
<a href="<?=$classurl?>" target="_blank" title="<?=$bqr[classname]?>" class="f24 ca"><?=$bqr[classname]?></a>
</h3>
</div>
<?php
if(!$bqr[islast]) //判断是否终极栏目
{
?>
<div class="fr lm_head_r">
    <?php
    //取得栏目下的子栏目       
    $newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]." order by myorder,classid asc limit 4"); $i=0;
    while($classr=$empire->fetch($newsclass))
    {
        $classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址
        $i++;
        ?>
        <a href="<?=$classrurl?>" target="_blank" class="head_ra chao fl"><?=$classr[classname]?></a>
    <?php
    }
    ?>
    <a href="<?=$classurl?>" title="<?=$bqr[classname]?>" target="_blank" class="more"><?=$bqr[classname]?> &gt;&gt;</a>
</div>
</div>
<div class="lm_nr main bj_mt20">
<div class="lm_nr_nr">
<div class="lm_nr_l fl bg2 yj_10 hidden">
<div class="head_3">
<h4 class="f18 nobold fl"><span></span>热门图文</h4>
<a class="more fr">HOT</a>
</div>
<div class="hot_tw main bj_mt20">
<div class="bd">
<ul class="infoList">
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],3,0,1,'','onclick DESC');
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>
<li>
<a href="<?=$bqr2[titleurl]?>" title="<?=$bqr2[title]?>" target="_blank" class="a_img photo hidden yj_10 chao"><img src="<?=$bqr2[titlepic]?>" alt="<?=$bqr2[title]?>"></a>
<a href="<?=$bqr2[titleurl]?>" title="<?=$bqr2[title]?>" target="_blank" class="bt_a chao bj_mt20 f18"><?=esub($bqr2[title],22,'…')?></a>
<p class="chao3 c9 f13 bj_mt10"><?=esub($bqr2[smalltext],98,'…')?></p>
<div class="li_b bj_mt10">
<time><?=date('m-d',$bqr2[newstime])?></time>
<a href="<?=$bqsr[classurl]?>" title="<?=$bqsr2[classname]?>" target="_blank" class="cb f13"><?=$bqsr2[classname]?></a>
</div>
</li>
<?php
}
//显示2条
?> 
</ul>
</div>
<div class="hd">
<ul class="num">
<li class="fl on">1</li>
<li class="fl">2</li>
<li class="fl">3</li>
</ul>
</div>
<div class="hd">
<?php
$ecms_bq_sql2=sys_ReturnEcmsLoopBq($bqr[classid],1,1,0,0,'','onclick DESC');
$bqno2=0;
while($bqr2=$empire->fetch($ecms_bq_sql2))
{
$bqsr2=sys_ReturnEcmsLoopStext($bqr2);
$bqno2++;
?>
<a href="<?=$bqr2[titleurl]?>" target="<?=$bqr2[title]?>"><?=$bqr2[title]?></a><time class="fr"><?=date('m-d',$bqr2[newstime])?></time>
<?php
}
//显示1条
?>
</div>
</div>
</div>
</div>
<div class="lm_nr_c fl">
<div class="head_3">
<h5 class="f18 nobold fl"><span>
</span>最新文章</h4>
<a class="more fr">Article</a>
</div>
<div class="lm_lb bj_mt20">
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],2,0,0,'','onclick DESC');
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<div class="lb_2">
<a href="<?=$bqsr3[classurl]?>" title="<?=$bqsr3[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$bqsr3[classname]?></a>
<div class="fl lb_l">
<a href="<?=$bqr3[titleurl]?>" title="<?=$bqr3[title]?>" target="_blank" class="bt_a chao bold"><?=$bqr3[title]?><time><?=date('m-d',$bqr3[newstime])?></time></a>
<p class="chao c9 f13"><?=$bqr3[smalltext]?></p>
</div>
</div>
<?php
}
//显示2条
?>
<?php
$ecms_bq_sql3=sys_ReturnEcmsLoopBq($bqr[classid],6,0,0,'','newstime desc');
$bqno3=0;
while($bqr3=$empire->fetch($ecms_bq_sql3))
{
$bqsr3=sys_ReturnEcmsLoopStext($bqr3);
$bqno3++;
?>
<div class="lb_1">
<a href="<?=$bqsr3[classurl]?>" title="<?=$bqsr3[classname]?>" target="_blank" class="lm_a chao fl"><?=$bqsr3[classname]?></a>
<a href="<?=$bqr3[titleurl]?>" title="<?=$bqr3[title]?>" target="_blank" class="bt_a chao fl"><?=$bqr3[title]?></a>
<time class="fr"><?=date('m-d',$bqr3[newstime])?></time>
</div>
<?php
}
//显示6条
?>
</div>
</div>
<div class="lm_nr_r fr">
<div class="head_3">
<h6 class="f18 nobold fl"><span></span>热门排行</h4>
<a class="more fr">Rank</a>
</div>
<div class="lm_lb bj_mt20">
<div class="lb_3">
<?php
$ecms_bq_sql4=sys_ReturnEcmsLoopBq($bqr[classid],'2,1',0,0,'','onclick DESC');
$bqno4=0;
while($bqr4=$empire->fetch($ecms_bq_sql4))
{
$bqsr4=sys_ReturnEcmsLoopStext($bqr4);
$bqno4++;
?>
<div class="fl lb_on">
<span class="cf f24">0<?=$bqno?></span>
<time class="cf"><?=date('m-d',$bqr4[newstime])?></time>
</div>
<div class="fl lb_l">
<a href="<?=$bqr4[titleurl]?>" title="<?=$bqr4[title]?>" target="_blank" class="bt_a chao bold"><?=$bqr4[title]?></a>
<div class="lb_l_b">
<a href="<?=$bqsr4[classurl]?>" title="<?=$bqsr4[classname]?>" target="_blank" class="lm2_a cb fl chao2"><?=$bqsr4[classname]?></a>
<p class="chao c9 f13"><?=$bqr4[smalltext]?></p>
</div>
</div>
<?php
}
//显示1条
?> 
</div>
<?php
$bqno=0;
  $ResultG = sys_ReturnEcmsLoopBq($bqr[classid],'3,8',0,0,'','onclick DESC');
  while($bqr4=$empire->fetch($ResultG)){
$bqsr=sys_ReturnEcmsLoopStext($bqr4);
$bqno++;
?>
<div class="lb_1">
<span>0<?=$bqno+1?></span>
<a href="<?=$bqsr4[classurl]?>" title="<?=$bqsr4[classname]?>" target="_blank" class="lm_a chao fl"><?=$bqsr4[classname]?></a>
<a href="<?=$bqr4[titleurl]?>" title="<?=$bqr4[title]?>" target="_blank" class="bt_a chao fl"><?=$bqr4[title]?></a>
<time class="fr"><?=date('m-d',$bqr4[newstime])?></time>
</div>
<?php
     }
     //显示8条
    ?> 
</div>
</div>
<?php
}
?>
<div class="clear"></div>
</div>
</div>
[/e:loop]
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。