织梦dedecms当天文章标题加红色最新标记
在文章标题的后面增加“(new)”最新发布的标志:
另一种php形式代码:
{dede:arclist row='5'titlelen='60' typeid='1'} <li><a href="[field:arcurl/]">[field:title/]</a> <span> [field:senddate runphp='yes'] $ntime = time(); $oneday = 3600 * 24; if(($ntime – @me)<$oneday) @me = "<font color='#c00'>(new)</font>"; else @me = ""; [/field:senddate] </span> </li> {/dede:arclist} |
{dede:arclist titlelen='60'row='5'} <li><a href="[field:arcurl/]">[field:title/]</a> <span> [field:pubdate runphp='yes'] $a="<font color='#ccc'>"; $d="<font color='#c00'>"; $b="</font>"; $c=strftime("%m-%d","@me"); $ntime = time(); $oneday = 3600 * 24; if(($ntime – @me)<$oneday) @me = $a.$c.$b; else @me = $d.$c.$b; [/field:pubdate] </span> </li> {/dede:arclist} |