Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

帖子(主题)列表里显示的最后回复时间不对

[复制链接]
小树叶子 发表于 2014-7-21 20:06:42 | 显示全部楼层 |阅读模式
社区首页:显示某个板块的最后回复时间是正确的
板块首页:显示某个帖子的最后回复时间是错误
回复详情:显示此条回复的时间是正确的

服务器,论坛后台管理,注册用户个人资料详情里面的时区设置,都检查过,即上海
tangxinfa 发表于 2014-7-24 16:23:08 | 显示全部楼层
topicadmin_moderate.php

                        } elseif($operation == 'down') {
                                if(!$_G['group']['allowbumpthread']) {
                                        showmessage('no_privilege_downthread');
                                }
                                $modaction = 'DWN';
                                $downtime = TIMESTAMP - 86400 * 730;
                                C::t('forum_thread')->update($tidsarr, array('lastpost'=>$downtime, 'moderated'=>1), true);

                                $_G['forum']['threadcaches'] && deletethreadcaches($thread['tid']);
                        }

看了代码,这是把最后回复时间当儿戏,开发人员光顾着实现功能交差了。
回复

使用道具 举报

tangxinfa 发表于 2014-7-24 17:06:34 | 显示全部楼层
修复方法:

将forum_forumdisplay.php中的以下语句:
   
  1. $thread['lastpost'] = dgmdate($thread['lastpost'], 'u');
复制代码

替换为:
   
  1. if ($thread['moderated']) {
  2.             $lastposts = C::t('forum_post')->fetch_all_by_tid_position($thread['posttableid'], $thread['tid'], $thread['maxposition']);
  3.             if ($lastposts && isset($lastposts[0])) {
  4.                 $thread['lastpost'] = dgmdate($lastposts[0]['dateline']);
  5.             } else {
  6.                 $thread['lastpost'] = '';
  7.             }
  8.         } else {
  9.             $thread['lastpost'] = dgmdate($thread['lastpost'], 'u');
  10.         }
复制代码
回复

使用道具 举报

 楼主| 小树叶子 发表于 2014-7-24 22:54:18 | 显示全部楼层
tangxinfa 发表于 2014-7-24 17:06
修复方法:

将forum_forumdisplay.php中的以下语句:

非常感谢
回复

使用道具 举报

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

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-2-26 13:46 , Processed in 0.035770 second(s), 7 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表