将24内发布的文章日期显示为红色(教程)
dedecms吧
全部回复
仅看楼主
level 1
轻爰跳00 楼主
24内发布的文章日期显示红色
3种方法:
[field:pubdate runphp="yes"]
if((time()-@me)<(60*60*24)){@me=' <font color="#ff6600">'.strftime("%m-%d",@me).'</FONT>';}
else {@me=strftime("%m-%d",@me);}
[/field:pubdate]       
[field:pubdate runphp="yes"]
if((time()-@me)<(60*60*24)){@me=' <font color="#ff6600">'.strftime("%H:%M",@me).'</FONT>';}
else {@me=strftime("%m-%d",@me);}
[/field:pubdate]
[field:pubdate runphp='yes']
$a="<font color='#ff0000'>";
$b="</font>";
$c=strftime(" %Y年%m月%d日 %H:%M:%S","@me");
$ntime = time();
$oneday = 3600 * 24;
if(($ntime - @me)<$oneday) @me = $a.$c.$b;
else @me =$c;
[/field:pubdate]
@丐行天下 t.sina.com.cn/oversky

2010年08月18日 12点08分 1
level 1
这样子写 看不懂。
2014年10月26日 03点10分 2
1