帖子列表今日发帖红色显示、24小时蓝色显示( Discuz!7.x )

来自: Discuz 作者: 水煮鱼 时间: 2010-8-1 20:47 查看: 5835 回复: 2

第一步、修改forumdisplay.php
找到:
  1. $thread['dateline'] = gmdate($dateformat, $thread['dateline'] + $timeoffset * 3600);
复制代码
上面添加:
  1. $thread['today'] = $thread[dateline];
复制代码
第二步、修改templates/default/forumdisplay.htm
找到:
  1. <em>$thread[dateline]</em>
复制代码
替换为:
  1. <!--{if (($times**p-$thread['today'])<43200)}-->
  2. <font color=red>$thread[dateline]</font>
  3. <!--{elseif (($times**p-$thread['today'])>43200) && (($times**p-$thread['today'])<86400)}-->
  4. <font color=blue>$thread[dateline]</font>
  5. <!--{else}-->$thread[dateline]<!--{/if}-->
复制代码
最新回复 2 条
wf2695066126 2012-5-24 09:24:11
时间的河流在匆忙的脚步中渐行渐远
shangdong123 2012-6-27 09:52:18
时间的河流在匆忙的脚步中渐行渐远
您需要登录后才可以回帖 登录 | 注册
Smilies Code
高级模式