请选择 进入手机版 | 继续访问电脑版
设为首页收藏本站

Discuz! 官方站

 找回密码
 立即注册

QQ登录

只需一步,快速开始

Discuz! X 最新研发动态 通过这个窗口,关注跟踪我们的研发进展 Discuz! 开发技术文库 - 给官方提建议

Discuz! X2 正式版下载 帮助网站实现一站式服务  商业支持服务咨询 下载 - 安装 - 常见问题 - 转换 - 讨论 - 购买

2012站长年会开启报名 限量船票免费发放 Discuz!十大荣誉用户评选 - Discuz!NT3.6发布 漫游引入QQ空间游戏 -一骑新区横扫三国-5d6d免费论坛

查看: 48411|回复: 107

[发布] TOPLIST_首页四格_全Cache版FOR DZ5,DZ5.5完全正式修正版本 [复制链接]

Rank: 4

UID
122769
积分
852
帖子
656
威望
0
在线时间
0 小时
注册时间
2004-9-20
发表于 2006-9-3 05:05:33 |显示全部楼层
插件原作者:oytktk (靖飒),scropion~,mousecat等
数据库升级:无
安装难度:中
修改完善:黄金俱乐部:http://egoldclub.cn/forum

插件演示地址: http://www.egoldclub.cn/forum

这里相关帖子整理、完善了一下,并作了点修正:如果需要,请大家参考原帖!
原帖:
http://www.discuz.net/viewthread.php?tid=247056
http://www.discuz.net/viewthread.php?tid=388767

修改之前强烈建议大家备份需要修改的文件!
不建议用修改的DZ5版本文件(如果以前有的话)去覆盖DZ5.5原版本!
(修改文件相同,只是在DZ5.5的原脚本略有不同)
如果没有特别说明,则适用于5.0及5.5版本。



1. 上传附件到论坛的模板目录中的缺省模板目录

2. include/cache.func.php

查找
'medals'        => array('medals')


上面加
'toplist'        => array('newthread', 'newreply', 'topdigest', 'topviews'),//TOPLIST_首页四格_全Cache版_黄金俱乐部完善


继续查找
case 'medals':
                        $table = 'medals';
                        $cols = 'medalid, name, image';
                        $conditions = "WHERE available='1'";
                        break;


上面加
  //首页四格TOPLIST_CACHE版_黄金俱乐部完善,代码首
                case 'newthread':
                        $table = 'threads t';
                        $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
                        $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.displayorder!='-1' ORDER BY t.dateline DESC LIMIT 0, 10";
                        break;

                case 'newreply':
                        $table = 'threads t';
                        $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
                        $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.replies>0 and t.displayorder!='-1'  ORDER BY t.lastpost DESC LIMIT 0, 10";
                        break;
                case 'topdigest':
                        $table = 'threads t';
                        $cols = 't.tid, t.fid, t.author, t.subject, t.digest, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
                        $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE digest>0 ORDER BY rand() LIMIT 0, 10";
                        break;
               
                case 'topviews':
                        $table = 'threads t';
                        $view = rand(1,3)==1 ? 'views' : 'replies';
                        $cols = 't.tid, t.fid, t.author, t.subject, t.dateline, t.lastpost, t.lastposter, t.views, t.replies, t.highlight, f.name';
                        $conditions = "LEFT JOIN {$tablepre}forums f ON f.fid=t.fid WHERE t.displayorder!='-1' ORDER BY t.$view DESC LIMIT 0, 10";
                        break;

                //首页四格TOPLIST_CACHE版, 黄金俱乐部完善 代码尾


再找:
case 'settings':
                        $data['qihoo_links'] = array();
                        while($setting = $db->fetch_array($query))


上面加
//首页四格TOPLIST_CACHE版, 黄金俱乐部完善 代码首

                case 'newthread':
                        $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
                        while($topthread = $db->fetch_array($query)) {
                                $threadcolor = sprintf('%02d', $topthread['highlight']);
                                $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
                                $topthread['subjectc'] = cutstr($topthread['subject'], 28);
                                $topthread['threadcolor'] = $threadcolor[1] ? " style=\"color: ".$colorarray[$threadcolor[1]]."\"" : NULL;
                                $topthread['dateline'] = gmdate("Y-m-d H:i", $topthread['dateline'] + $timeoffset * 3600);
                                $topthread['lastpost'] = gmdate("Y-m-d H:i", $topthread['lastpost'] + $timeoffset * 3600);
                                $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
                                $data[] = $topthread;
                        }
                        break;

                case 'newreply':
                        $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
                        while($topthread = $db->fetch_array($query)) {
                                $threadcolor = sprintf('%02d', $topthread['highlight']);
                                $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
                                $topthread['subjectc'] = cutstr($topthread['subject'], 26);
                                $topthread['threadcolor'] = $threadcolor[1] ? " style=\"color: ".$colorarray[$threadcolor[1]]."\"" : NULL;
                                $topthread['dateline'] = gmdate("Y-m-d H:i", $topthread['dateline'] + $timeoffset * 3600);
                                $topthread['lastpost'] = gmdate("Y-m-d H:i", $topthread['lastpost'] + $timeoffset * 3600);
                                $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
                                $data[] = $topthread;
                        }
                        break;

                case 'topdigest':
                        $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
                        while($topthread = $db->fetch_array($query)) {
                                $threadcolor = sprintf('%02d', $topthread['highlight']);
                                $digest = array('1'=>'[Ⅰ]','2'=>'[Ⅱ]','3'=>'[Ⅲ]');
                                $topthread['subjectc'] = $digest[$topthread['digest']]."-".cutstr($topthread['subject'], 23);
                                $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
                                $topthread['threadcolor'] = $threadcolor[1] ? " style=\"color: ".$colorarray[$threadcolor[1]]."\"" : NULL;
                                $topthread['dateline'] = gmdate("Y-m-d H:i", $topthread['dateline'] + $timeoffset * 3600);
                                $topthread['lastpost'] = gmdate("Y-m-d H:i", $topthread['lastpost'] + $timeoffset * 3600);
                                $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
                                $data[] = $topthread;
                        }
                        break;

                case 'topviews':
                        $colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
                        while($topthread = $db->fetch_array($query)) {
                                $threadcolor = sprintf('%02d', $topthread['highlight']);
                                $topthread['subjectc'] = cutstr($topthread['subject'], 32);
                                $topthread['threadcolor'] = $threadcolor[1] ? " style=\"color: ".$colorarray[$threadcolor[1]]."\"" : NULL;
                                $topthread['author'] = $topthread['author'] ? $topthread['author'] : '游客';
                                $topthread['dateline'] = gmdate("Y-m-d H:i", $topthread['dateline'] + $timeoffset * 3600);
                                $topthread['lastpost'] = gmdate("Y-m-d H:i", $topthread['lastpost'] + $timeoffset * 3600);
                                $topthread['name'] =  AddSlashes(strip_tags(trim($topthread['name'])));
                                $data[] = $topthread;
                        }
                        break;


                //首页四格TOPLIST_CACHE版, 黄金俱乐部完善  代码尾


3. include/newthread.inc.php

查找
updatepostcredits('+', $discuz_uid, $postcredits);


下面加
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('newthread');


4. include/newreply.inc.php

查找
updatepostcredits('+', $discuz_uid, $replycredits);


下面加
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('newthread');


5. include/editpost.inc.php

查找
updatepostcredits('-', $orig['authorid'], ($isfirstpost ? $postcredits : $replycredits));


下面加
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('newthread');


第6步:论坛根目录 index.php
查找
DZ 5.0
$threads = $posts = $todayposts = $fids = 0;


DZ 5.5
$threads = $posts = $todayposts = $fids = $announcepm = 0;


下面加
//首页四格TOPLIST_CACHE版, 黄金俱乐部完善  代码首
        if(!isset($_COOKIE['discuz_collapse']) || strpos($_COOKIE['discuz_collapse'], 'category_hk2 ') === FALSE) {
                $categorys_hk2 = 'collapsed_no.gif';
                $collapse['category_hk2'] = '';
        } else {
                $categorys_hk2 = 'collapsed_yes.gif';
                $collapse['category_hk2'] = 'display: none';
        }
        
        if($categorys_hk2 == 'collapsed_no.gif'){
        require_once DISCUZ_ROOT.'./forumdata/cache/cache_toplist.php';
        $toplistloop = $_DCACHE['newthread'];
        }
        //首页四格TOPLIST_CACHE版, 黄金俱乐部完善  代码尾


7. 根目录 topicadmin.php

查找
showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'),


上面加
require_once DISCUZ_ROOT.'./include/cache.func.php';
        updatecache('newthread');


第8步: templates\default\discuz.htm

查找
DZ5.0:
<!--{if !empty($newpmexists)}-->
<div style="clear: both; margin-top: 5px">
{template pmprompt}
</div>
<!--{/if}-->


DZ5.5
<!--{if !empty($newpmexists) || $announcepm}-->
        <div style="clear: both; margin-top: 5px" id="pmprompt">
        {template pmprompt}
        </div>
<!--{/if}-->


下面加
<div style="clear: both; margin-top: 5px;">
<div class="spaceborder" style="width: 98%">
        {template toplist}
        </div></div>


上传 附件里的 TOPLIST.htm到模版风格目录

千万记得更新缓存 !!

[ 本帖最后由 Salty 于 2007-3-14 08:36 编辑 ]

toplist.rar

794 Bytes, 下载次数: 2406

Toplist

Rank: 4

UID
122769
积分
852
帖子
656
威望
0
在线时间
0 小时
注册时间
2004-9-20
发表于 2006-9-3 05:08:06 |显示全部楼层
大家可以看看样子:
Graphic_2006-9-3 AM 05_06_33.JPG

使用道具 举报

Rank: 2

UID
24833
积分
197
帖子
64
威望
0
在线时间
0 小时
注册时间
2003-9-3
发表于 2006-9-3 06:27:24 |显示全部楼层
支持下

使用道具 举报

Rank: 4

UID
251402
积分
516
帖子
585
威望
0
在线时间
16 小时
注册时间
2005-9-21
发表于 2006-9-3 07:17:26 |显示全部楼层
支持一下。。。

使用道具 举报

Rank: 6Rank: 6

UID
206675
积分
1248
帖子
1552
威望
0
在线时间
0 小时
注册时间
2005-6-5
发表于 2006-9-3 08:10:00 |显示全部楼层
能不能将回复最多改成“最新图片”??

谢谢。。。。
www.china-tkd.cn我的论坛--爱国--热血--抗日--保钓--跆拳道

使用道具 举报

King

努力学习

Rank: 6Rank: 6

UID
390980
积分
1089
帖子
1066
威望
17
在线时间
0 小时
注册时间
2006-6-24
发表于 2006-9-3 08:21:43 |显示全部楼层
:) 这个值得支持
DISCUZ 7.0.0终于要来了!!!

使用道具 举报

Rank: 2

UID
304971
积分
97
帖子
115
威望
0
在线时间
3 小时
注册时间
2006-1-7
发表于 2006-9-3 08:41:54 |显示全部楼层
首页什么也没显示?

使用道具 举报

Rank: 2

UID
304971
积分
97
帖子
115
威望
0
在线时间
3 小时
注册时间
2006-1-7
发表于 2006-9-3 08:47:51 |显示全部楼层
直接把改的文件发过来行吗 改了 没有效果

使用道具 举报

Rank: 4

UID
122769
积分
852
帖子
656
威望
0
在线时间
0 小时
注册时间
2004-9-20
发表于 2006-9-3 17:40:47 |显示全部楼层
原帖由 cnscorpion 于 2006-9-3 08:47 发表
直接把改的文件发过来行吗 改了 没有效果

自己慢慢再看看,这一关都得过的。

我以前4.1版本也用过,都没有问题。

大家用点心,只要是经过测试的,一般都没有问题。

使用道具 举报

Rank: 6Rank: 6

UID
376092
积分
1692
帖子
1945
威望
5
在线时间
1 小时
注册时间
2006-5-30
发表于 2006-9-3 18:24:01 |显示全部楼层
还是哪个老问题:
怎么隐藏板块的帖子不显示出来!
欢迎大家到我的博客玩玩,我的博客地址是http://bj2008.discuz.net
我会经常在上面发布我的感想的!

使用道具 举报

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

fastpost

手机版|Archiver|北京康盛新创科技有限责任公司 ( 京ICP证110024号|京网文[2011]0019-007号 )  

GMT+8, 2012-2-13 07:14 , Processed in 0.178021 second(s), 16 queries , Memcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部