织梦DEDECMS中的时间格式代码汇总
所属分类:
CMS教程 / dedecms
阅读数:
515
收藏 0赞 0分享
1.时间格式
{dede:field name='pubdate' function='strftime("%Y年%m月%d日 %H:%M:%S","@me")' /}2007年1月1日 18:30:02
{dede:field name='pubdate' function='strftime("%Y-%m-%d %H:%M:%S","@me")' /}2007-1-1 18:30:02
{dede:field name='pubdate' function='strftime("%Y年%m月%d日 %H时%M分%S秒","@me")' /}2007年1月1日 18时30分02秒
{dede:field name='pubdate' function='strftime("%m-%d %H:%M:%S","@me")' /}1-1 18:30:02
{dede:field name='pubdate' function='strftime("%m-%d","@me")' /}1-1
%Y-年
%m-月
%d-日
%H-小时
%M-分
%S-秒
2.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]
3.最后更新时间
最后更新时间:{dede:tagname runphp='yes'}@me = date("Y-m-d H:i:s", time());{/dede:tagname}
4.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制作英文站需要修改的地方
我一直都不喜欢用DEDE做英文站,不是不好,而是需要改动的地方太多了,并不像一些网上说的改改字体,改改编码那么轻松的事情。
收藏 0赞 0分享
dedecms英文模板 英文网站程序的选择
dedecms英文模板目前很多,但一眼看上去都是一些老版本了,而且卖模板的人说是SEO过,其实网站程序的优化都没有做好,还不如自己动手改改 dedecms官方默认的模板。
收藏 0赞 0分享
DEDECMS 支付宝操作手册
织梦CMS携手支付宝推出DedeCMS V5.6全新支付接口,DedeCMS系统为国内做早开源的PHP内容管理系统,系统除了拥有强大,灵活的内容管理功能之外,还增加了分类、书库、黄页、圈子、问答等模块,同时该版本中整合了最新支付宝在线支付接口。
收藏 0赞 0分享
查看更多