[织梦教程] 织梦中给近三天发布的文章加上new字或小图片

[复制链接]
查看2160 | 回复7 | 2018-11-19 18:58:30 | 显示全部楼层 |阅读模式

    网站中的文章列表,有时候需要将近几天的文章标注上new或小图片,其实添加的方法很简单,下面就说一下织梦的文章列表怎样给近三天内的文章添加new或小图片。

1、==========红色的日期========

[html]view plaincopyprint?
  1. [field:pubdate runphp='yes']   
  2. $a="<font color=red>".strftime('%m-%d',@me)."</font>";   
  3. $b=strftime('%m-%d',@me);   
  4. $ntime = time();   
  5. $day3 = 3600 * 24 * 3;   
  6. if(($ntime - @me) < $day3) @me = $a;   
  7. else @me =$b;   
  8. [/field:pubdate]  

2、==========红色的(new)========
[html]view plaincopyprint?
  1. [field:pubdate runphp='yes']   
  2. $aa=strftime('%m-%d',@me);   
  3. $ntime = time();   
  4. $tagtime = @me;   
  5. $day3 = 3600 * 24 * 3;   
  6. if($tagtime > $ntime-$day3) @me = "<font color='red'>(new)</font>";   
  7. else @me = $aa;   
  8. [/field:pubdate]  

3、==========加new.gif小图片========
[html]view plaincopyprint?
  1. [field:pubdate runphp='yes']   
  2. $aa=strftime('%m-%d',@me);   
  3. $ntime = time();   
  4. $tagtime = @me;   
  5. $day3 = 3600 * 24 * 3;   
  6. if($tagtime > $ntime-$day3) @me = "<img src='new.gif' />".$aa;   
  7. else @me = $aa;   
  8. [/field:pubdate]  


织梦教程网络上有很多,但没有一个像自由织梦(www.freedede.cn)这样教程比较齐全的,现在好了,学习开发使用织梦dedecms系 统不用东奔西跑了,直接来自由织梦就好了,提供织梦cms详细的使用教程和织梦建站教程,包括dedecsm的安装、模板开发教程、安 全配置等,DedeCMS从入门到精通建站就是如此轻松。
回复

使用道具 举报

123457748 | 2021-8-28 17:02:53 | 显示全部楼层
这个下载站资源真齐全
回复

使用道具 举报

精诚通潭 | 2021-10-11 09:34:57 | 显示全部楼层
这个资源都有真不错
回复

使用道具 举报

forregistuse | 2022-6-1 06:22:19 | 显示全部楼层
6666悟空源码资源多!
回复

使用道具 举报

123457776 | 2022-6-8 09:28:22 | 显示全部楼层
这个下载站资源真齐全
回复

使用道具 举报

井底燕雀傥 | 2023-2-5 21:20:44 | 显示全部楼层
站长真良心,这么大的资源站都是免费下载
回复

使用道具 举报

陆子525630 | 2023-6-2 16:50:10 | 显示全部楼层
找了很多地方都不能下载,终于在悟空源码找到了
回复

使用道具 举报

铁血_斩蛇 | 2023-9-26 10:42:45 | 显示全部楼层
厉害了悟空源码,这么多资源
回复

使用道具 举报

也空中最亮的兴 | 2024-6-28 06:45:55 | 显示全部楼层
祝愿悟空源码越办越好!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则