网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > DedeCMS
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 61.160.30.41
Old 2014-05-01, 10:55 PM
Uintah Uintah is offline
初级会员
 
Join Date: 2012-03-09
Posts: 1
Uintah 现在声名狼藉
Default 当日更新文档日期红色显示

温馨提醒:本教程适用于DedeCMS 通用,V5.3,V5.5,V5.6
Code:

    [field:pubdate runphp='yes']   
    if(date("Y-m-d",@me)==date("Y-m-d")){   
        @me='<font color="#FF0000">'.GetDateTimeMK(@me).'</font>';    
    }else{   
        @me=GetDateTimeMK(@me);   
    }    
    [/field:pubdate]  
如果需要显示其他的格式,比如显示年月日,那么就修改一下 @me=GetDateTimeMK(@me) 和 @me='<font color="#FF0000">'.GetDateTimeMK(@me).'</font>'; 的显示函数,比如@me = MyDate('Y-m-d',@me);

其它的情况大家去摸索一下吧。

P.s:至于24小时内,那就更简单了,直接用 pubdate - time() 做减法后判断情况输出结果。

比如:
Code:

    [field:pubdate runphp='yes']   
    $nowTime = time();   
    if($nowTime - (3600 * 24) < @me){   
        @me='<font color="#FF0000">'.GetDateTimeMK(@me).'</font>';    
    }else{   
        @me=GetDateTimeMK(@me);   
    }    
    [/field:pubdate]  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 04:17 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.