帝国cms最新文章显示红色日期的教程

使用程序代码

$newimg='[!--newstime--]';
if(time()-$r[newstime]<=1*24*3600)
{
        $newimg='<FONT color=red>[!--newstime--]</FONT>';
}  

$listtemp='<LI><SPAN class="date">'.$newimg.'</SPAN> <a href="[!--titleurl--]" target=_blank>[!--title--]</A> </LI>';

或者使用灵动标签

<ul>
[e:loop={'news',15,18,0}]
<?
$newstime=format_datetime($bqr[newstime],'m-d');
if(date('Y-m-d')==date('Y-m-d',$bqr[newstime]))
{
$newstime="<font color=red>$newstime</font>";
}
?>
<li>[<a href="<?=$bqsr[classurl]?>"><?=$bqsr[classname]?></a>]&nbsp;<a href="<?=$bqsr[titleurl]?>"><?=esub($bqr[title],40)?></a><span><?=$newstime?></span></li>
[/e:loop]
</ul>

posted on 2020-02-25 12:15  剩余价值  阅读(493)  评论(0编辑  收藏  举报

导航