仿站咨询QQ:2587483189

手机微信同号:15850888840

织梦调用时间标签必备

dedecms时间织梦仿站标签:

1、12-27 样式
([field:pubdate function='strftime("%m-%d",@me)'/])


2、May 15, 2009 样式

([field:pubdate function='strftime("%b %d, %Y",@me)'/])
提示:可修改后代码再运行!

dedecms列表页时间标签:

1、2009-12-27 18:30:02 样式
[field:pubdate function="GetDateTimeMK(@me)"/]


2、2009-12-27  样式

[field:pubdate function="GetDateMK(@me)"/]


dedecms内容页时间标签:

1、2009-12-27  样式
{dede:field name='pubdate' function='GetDateMk(@me)'/}


2、May 15, 2009 样式

{dede:field name='pubdate' function='strftime("%b %d, %Y",@me)'/}
 

24小时内的时间显示红色:
[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]


最后更新时间
{dede:tagname runphp='yes'}@me = date("Y-m-d H:i:s", time());{/dede:tagname}


XX天前
[field:pubdate runphp='yes'] $today = Floor(time()/(3600 * 24)); $senday= Floor(@me/(3600 * 24)); $updays = $today-$senday; if($updays==0) @me = "今日"; else @me = $updays."天前"; [/field:pubdate]

 

  • 上一篇:织梦调用全部栏目的文章
  • 下一篇:dedecms怎么在文章页调用tag为关键词
  • 来源:未知//所属分类: 织梦仿站 /更新时间:2012-03-31
    相关仿站教程