利用dedecms给近三天(或当天)发布的文章显示红色日期或加上new字或new小图片
1)红色日期
<br>[field:pubdate runphp='yes'] <br>$a="<font color=red>".strftime('%m-%d',@me)."</font>";
<br>$b=strftime('%m-%d',@me); <br>$ntime = time(); <br>$day3 = 3600 * 24 * 3;
<br>if(($ntime - @me) < $day3) @me = $a; <br>else @me =$b; <br>[/field:pubdate] <br>
2)红色的new
<br>[field:pubdate runphp='yes'] <br>$aa=strftime('%m-%d',@me); <br>
$ntime = time(); <br>$tagtime = @me; <br>$day3 = 3600 * 24 * 3; <br>
if($tagtime > $ntime-$day3) @me = "<font color='red'>(new)</font>"; <br>
else @me = $aa; <br>[/field:pubdate] <br>
3)加new.jif小图片
<br>[field:pubdate runphp='yes'] <br>$aa=strftime('%m-%d',@me); <br>
$ntime = time(); <br>$tagtime = @me; <br>$day3 = 3600 * 24 * 3; <br>if($tagtime > $ntime-$day3) @me = "<img src='new.gif' />".$aa; <br>
else @me = $aa; <br>[/field:pubdate] <br>