原帖由 heartrian 于 2008-6-11 23:21 发表
楼主不是那个问题,我已经那样设置了,应该是怎么写个函数什么的,把那些新发的帖子而没有回复的帖子屏蔽掉,才是正道啊,
在此,也赞下楼主很强!
谢谢关注,这确实是DZ本身的一大bug!
修补方法如下:
查找:- if(in_array($orderby, array('hourviews','todayviews','weekviews','monthviews'))) {
- $historytime = 0;
- switch($orderby) {
- case 'hourviews':
- $historytime = $timestamp - 3600 * $hours;
- break;
- case 'todayviews':
- $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp), date('Y', $timestamp));
- break;
- case 'weekviews':
- $week = gmdate('w', $timestamp) - 1;
- $week = $week != -1 ? $week : 6;
- $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp) - $week, date('Y', $timestamp));
- break;
- case 'monthviews':
- $historytime = mktime(0, 0, 0, date('m', $timestamp), 1, date('Y', $timestamp));
- break;
- }
- $sql .= ' AND t.dateline>='.$historytime;
- $orderby = 'views';
复制代码 替换为:- //sdaupp changed
- //if(in_array($orderby, array('hourviews','todayviews','weekviews','monthviews'))) {
- if(in_array($orderby, array('hourviews','todayviews','weekviews','monthviews','lastpost'))) {
- // end
- $historytime = 0;
- switch($orderby) {
- case 'hourviews':
- $historytime = $timestamp - 3600 * $hours;
- break;
- case 'todayviews':
- $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp), date('Y', $timestamp));
- break;
- case 'weekviews':
- $week = gmdate('w', $timestamp) - 1;
- $week = $week != -1 ? $week : 6;
- $historytime = mktime(0, 0, 0, date('m', $timestamp), date('d', $timestamp) - $week, date('Y', $timestamp));
- break;
- case 'monthviews':
- $historytime = mktime(0, 0, 0, date('m', $timestamp), 1, date('Y', $timestamp));
- break;
- // sdaupp add
- case 'lastpost':
- $noreply = true;
- break;
- // end
- }
- $sql .= ' AND t.dateline>='.$historytime;
- $orderby = 'views';
- // sdaupp add
- if($noreply) {
- $sql .= ' AND t.replies<>0';
- $orderby = 'lastpost';
- }
- //end
复制代码 别紧张,其实修改很少,只不过为了叙述简单,我把一大段全复制替换了……
附上我改过的文件供对照参考。
强烈建议:既然已经做不到“不修改任何文件”了,为了真正实现“高亮特性”、“无回复帖子不出现在最新回复中”,请去33楼下载完全版重新上传导入。
[ 本帖最后由 sdaupp 于 2008-6-12 02:08 编辑 ] |