首页 > CMS > 帝国Empire > 正文

帝国cms灵动标签循环调用栏目文章

2024-08-28 12:21:19
字体:
来源:转载
供稿:网友



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    <div class="newsbox">
[e:loop={"select * from [!db.pre!]enewsclass where classid in (1,2,3,4)  order by myorder asc ",0,24,0}]
<?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
?>
 
      <section>
        <div class="news">
          <h2 class="newstitle"><span><a href="<?=$classurl?>"  target="_blank">更多</a></span><b><?=$bqr[classname]?></b></h2>
          <ul>
<?php
//取得该分类下的最新数据
  
    $newbook=$empire->query("select * from  {$dbtbpre}ecms_news  where classid =".$bqr[classid]." order by newstime desc limit 8");
     
    while($r=$empire->fetch($newbook)) {
    ?>
<li><a href="<?=sys_ReturnBqTitleLink($r)?>" target="_blank"><span><?=date('Y-m-d',$r[newstime])?></span><?=DoTitleFont($r[titlefont],$r[title])?></a> </li>
    <?php
     }
    ?>
          </ul>
        </div>
      </section>
 
       [/e:loop]  
</div>

1
2
3
4
5
6
7
8
9
10
11
12
13
/*newsbox*/
.newsbox {overflowhidden;margin-bottom10px;}
.newsbox section {width49.5%;floatleft;margin-bottom10px;}
.newsbox section:nth-child(odd){ float:right}
.newsbox .news {background#fff;border1px solid #E1E1E1;}
.newstitle { line-height40pxfont-size15pxborder-bottom1px solid #E1E1E1background#F8F8F8 url(../images/newslist.png) no-repeat left 14px centerpadding0 20px 0 46pxfont-weightnormal }
.newstitle span { floatrightfont-size14px }
.newstitle span a { color#666 }
.newstitle b { displayblockborder-left1px solid #E1E1E1padding-left10px }
.newsbox .news ul { padding10px }
.newsbox .news ul li { display: inline-blockoverflowhidden; text-overflow: ellipsis; white-spacenowrapheight28pxwidth96%line-height28pxfont-size14pxbackgroundurl(../images/li.png) no-repeat left centerpadding-left15px; }
.newsbox .news ul li span { floatrightcolor#999font-size12pxmargin-left20px }
.newsbox .news ul li a:hover { color#09B1B9; }



发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表