百度 | 神马 | 搜狗 | 技术文档 | 学习资料分享 - 记录帝国CMS及运维技术的点点滴滴
你的位置:首页 > 帝国cms技术 » 正文

帝国CMS智能标签在同一天具有相同的信息颜色(文章信息在不同时间具有不同的颜色)

发布时间:2020-11-07

作品分类:帝国CMS  标签  同日  信息  颜色  时间  文章

灵动标签代码:

[e:loop={35,10,0,0,'','newstime DESC'}]<?

$day=date('Ymd',$bqr[newstime]);

if(!$n){

$n=0;

}

if($bqno==1){

$d=$day;

$class='class="t'.$n.'"';

}else{

if($d==$day){

$class='class="t'.$n.'"';

}else{

$n++;

$class='class="t'.$n.'"';

$d=$day;

}

}

?>><?=$bqr['title']?>_______[<?=date('Ymd',$bqr[newstime])?>]

[/e:loop]

注意:<?=$class?>为class的css样式

--------------------------------------------------------------------------------------

css样式:

.t0 {

color: #DC143C;

text-decoration: none;

}

.t1 {

color: #FF1493;

text-decoration: none;

}

.t2 {

color: #0000FF;

text-decoration: none;

}

.t3 {

color: #008000;

text-decoration: none;

}

.t4 {

color: #FF4500;

text-decoration: none;

}

.t5 {

color: #00FF7F;

text-decoration: none;

}

注意:可以加和多个,因为上面的6个(t0-t5)css颜色,剩下的将为默认的系统颜色

一般如果灵动标签调用10条信息就设置10个css颜色,既:10条信息对应10个日期时间

Top