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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 社区发贴之星(今日+昨日+本周+本月+本年)后台控制全Cache版 FOR DZ4.1正式版

[复制链接]
heikill 发表于 2006-4-22 16:00:06 | 显示全部楼层
33201
King



UID 185954
精华 1
积分 1841
帖子 1336
威望 63
阅读权限 50
注册 2005-4-1
状态 离线





[广告]: 购买官方虚拟主机,支持Discuz!发展 Discuz!官方主机,完美支持Discuz!论坛!
社区发贴之星(今日+本周+本月+本年发贴排行)后台控制全Cache版 FOR DZ4.1正式版
插件名称:社区发贴之星(今日+本周+本月+本年发贴排行)后台控制全Cache版 FOR DZ4.1正式版
插件作者:33201
数据库升级:有
安装难度:中
插件演示地址:http://bbs.yeetu.com/index.php
QUOTE:
由于修改部分较多,强烈建议你在安装前备份文件!!插件功能:
新增加的功能:

          1.首页显示今日+本周+本月+本年四类发帖状元、榜眼、探花,不分男女!可切换显示,有效增加会员
              的发贴 热情和参与度
          2.首页显示今日+本周+本月+本年发贴TOP10
          3.修正了原来的状元、榜眼或探花不存在时的空白问题,在不存在时显示为虚位以待
          4.全部内容生成缓存cache,不增加任何查询,有效减轻服务器负担
原来的功能:
          1.首页显示当日发帖状元、榜眼、探花,不分男女!
          2.显示当日发帖最多的十位会员!
          3.后台控制是否显示,这样帖子较少的时候可以不显示!
          4.加入收缩展开功能(默认发帖状元、榜眼、探花三栏隐藏的,当然你也可以修改为展开的)!
原来的升级到现在版本的方法见2楼
插件安装步骤
如果不想要后台控制的话,可以跳过1-3步
1.后台升级数据库(在cdb_settings添加一个show_poststar一个值)
CODE:
[Copy to clipboard]
INSERT INTO `cdb_settings` VALUES ('show_poststar', '1');2.编辑文件admin/setting.inc.php(后台显示功能设置内添加开关)
查找:
CODE:
[Copy to clipboard]
showsetting('settings_nocacheheaders', 'settingsnew[nocacheheaders]', $settings['nocacheheaders'], 'radio');下面添加:
CODE:
[Copy to clipboard]
showsetting('settings_show_poststar', 'settingsnew[show_poststar]', $settings['show_poststar'], 'radio');3,编辑语言包admincp.lang.php(后台管理页面显示的文字)
查找:
CODE:
[Copy to clipboard]
'settings_forumjump_comment' => '选择“是”将在列表页面下部显示快捷跳转菜单。注意: 当分论坛很多时,本功能会严重加重服务器负担',下面添加:
CODE:
[Copy to clipboard]
'settings_show_poststar' => '显示发帖冠军',
'settings_show_poststar_comment' => '选则“是”将在首页显示发帖冠军',4.上传附件!
5.编辑文件include/cache.func.php
5.1查找:
CODE:
[Copy to clipboard]
'medals'        => array('medals')在其上面加
CODE:
[Copy to clipboard]
'poststar'        => array('daystar', 'weekstar', 'monthstar', 'yearstar'),5.2查找:
CODE:
[Copy to clipboard]
case 'medals':
                        $table = 'medals';
                        $cols = 'medalid, name, image';
                        $conditions = "WHERE available='1'";
                        break;在其上面加
CODE:
[Copy to clipboard]
//===============社区明星BY 33201 开始
                case 'daystar':
                        $month=date(n);
                        $date=date(j);
                        $year=date(Y);
                        $time=mktime(0,0,0,$month,$date,$year);
                        $table = 'posts p';
                        $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts ,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
                        $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join cdb_memberfields me on p.authorid=me.uid where p.dateline>$time  group by p.authorid order by num desc limit 0,10";
                        break;
                case 'weekstar':
                        $month=date(n);
                        $date=date(j);
                        $year=date(Y);
                        $week=date(w);
                        $time=mktime(0,0,0,$month,$date,$year);
                        $weektime=mktime(0,0,0,$month,$date+1-$week,$year);
                        $table = 'posts p';
                        $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts ,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
                        $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join cdb_memberfields me on p.authorid=me.uid where p.dateline>=$weektime  group by p.authorid order by num desc limit 0,10";
                        break;
                case 'monthstar':
                        $month=date(n);
                        $year=date(Y);
                        $monthtime=mktime(0,0,0,$month,1,$year);
                        $table = 'posts p';
                        $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts ,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
                        $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join cdb_memberfields me on p.authorid=me.uid where p.dateline>=$monthtime  group by p.authorid order by num desc limit 0,10";
                        break;
               
                case 'yearstar':
                        $year=date(Y);
                        $yeartime=mktime(0,0,0,1,1,$year);
                        $table = 'posts p';
                        $cols = 'count(p.pid) as num,p.author,p.authorid,m.uid,m.credits,m.posts,m.digestposts ,me.avatar,m.oltime,me.avatarwidth,me.avatarheight';
                        $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join cdb_memberfields me on p.authorid=me.uid where p.dateline>=$yeartime  group by p.authorid order by num desc limit 0,10";
                        break;
//===================社区明星BY 33201 结束5.3 查找:
CODE:
[Copy to clipboard]
case 'settings':
                        $data['qihoo_links'] = array();
                        while($setting = $db->fetch_array($query))在其上面加
CODE:
[Copy to clipboard]
//===================社区明星BY 33201 开始
                case 'daystar':
                        while($toppost = $db->fetch_array($query)) {
                                $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
                                $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
                                $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
                                $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
                                $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
                                $data[] = $toppost;
                        }
                        break;
                case 'weekstar':
                        while($toppost = $db->fetch_array($query)) {
                                $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
                                $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
                                $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
                                $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
                                $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
                                $data[] = $toppost;
                        }
                        break;
                case 'monthstar':
                        while($toppost = $db->fetch_array($query)) {
                                $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
                                $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
                                $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
                                $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
                                $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
                                $data[] = $toppost;
                        }
                        break;
                case 'yearstar':
                        while($toppost = $db->fetch_array($query)) {
                                $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
                                $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
                                $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
                                $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
                                $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
                                $data[] = $toppost;
                        }
                        break;
//=====================社区明星BY 33201 结束6.编辑文件include/newthread.inc.php
查找
CODE:
[Copy to clipboard]
updatepostcredits('+', $discuz_uid, $postcredits);在其下面加
CODE:
[Copy to clipboard]
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('daystar');7.编辑文件include/newreply.inc.php
查找
CODE:
[Copy to clipboard]
updatepostcredits('+', $discuz_uid, $replycredits);在其下面加
CODE:
[Copy to clipboard]
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('daystar');8.编辑文件topicadmin.php
查找
CODE:
[Copy to clipboard]
showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), 在其面加
CODE:
[Copy to clipboard]
require_once DISCUZ_ROOT.'./include/cache.func.php';
                updatecache('daystar');9.编辑文件index.php
9.1查找:
CODE:
[Copy to clipboard]
require_once DISCUZ_ROOT.'./include/forum.func.php';下面添加:
CODE:
[Copy to clipboard]
require_once DISCUZ_ROOT.'./forumdata/cache/cache_poststar.php';
$month=date(n);
$year=date(Y);9.2查找:
CODE:
[Copy to clipboard]
unset($_DCACHE['announcements']);下面添加:
CODE:
[Copy to clipboard]
//========== 社区明星BY 33201 开始
$nopoststar ='姓名: 虚位以待!
UID  :空
积分:空
精华:空
今日发帖:空
总发帖量:空
在线时间:空
';
    if($_DCACHE['daystar']) {
                foreach($_DCACHE['daystar'] as $key => $dstar) {
            if ($key姓名:".$dstar[author]."
UID  :".$dstar[authorid]."
积分:".$dstar[credits]."
精华:".$dstar[digestposts]." 篇
今日发帖:".$dstar[num]." 篇
总发帖量:".$dstar[posts]." 篇
在线时间:".$dstar[oltime]." 小时
";$n=$key;
}
                }
if($n==0){$nostar .=$nopoststar.$nopoststar;}elseif($n==1){$nostar .=$nopoststar;}
        }
    if($_DCACHE['weekstar']) {
                foreach($_DCACHE['weekstar'] as $key => $wstar) {
            if ($key姓名:".$wstar[author]."
UID  :".$wstar[authorid]."
积分:".$wstar[credits]."
精华:".$wstar[digestposts]." 篇
本周发帖:".$wstar[num]." 篇
总发帖量:".$wstar[posts]." 篇
在线时间:".$wstar[oltime]." 小时
";$n=$key;
            }
                }
if($n==0){$noweekstar .=$nopoststar.$nopoststar;}elseif($n==1){$nostar .=$nopoststar;}
        }
    if($_DCACHE['monthstar']) {
                foreach($_DCACHE['monthstar'] as $key => $mstar) {
            if ($key姓名:".$mstar[author]."
UID  :".$mstar[authorid]."
积分:".$mstar[credits]."
精华:".$mstar[digestposts]." 篇
".$month."月发帖:".$mstar[num]." 篇
总发帖量:".$mstar[posts]." 篇
在线时间:".$mstar[oltime]." 小时
";
            }
                }
        }
    if($_DCACHE['yearstar']) {
                foreach($_DCACHE['yearstar'] as $key => $ystar) {
            if ($key姓名:".$ystar[author]."
UID  :".$ystar[authorid]."
积分:".$ystar[credits]."
精华:".$ystar[digestposts]." 篇
".$year."年发帖:".$ystar[num]." 篇
总发帖量:".$ystar[posts]." 篇
在线时间:".$ystar[oltime]." 小时
";
            }
                }
        }
//==========社区明星BY 33201 结束10.编辑模板index.htm
查找:
CODE:
[Copy to clipboard]
下面加:
CODE:
[Copy to clipboard]
{template show_poststar}
如果不想安装后台控制,请添加以下代码
CODE:
[Copy to clipboard]
{template show_poststar}11.后台更新缓存,一定要更新,否则可能首页无法显示
完毕!
注意:默认发帖状元、榜眼、探花三栏是展开的,如果你想默认改为隐藏的就将show_poststar.htm
中的
CODE:
[Copy to clipboard]
yes 修改为 none 即可!
QUOTE:
由于时间仓促和本人水平有限,难免存在一些BUG,大家有什么意见和建议还望大家及时提出,谢谢!

图片附件: [今日社区之星] 0.jpg (2006-4-20 21:12, 50.06 K)


图片附件: [本周社区之星] 1.jpg (2006-4-20 21:12, 50.82 K)


图片附件: [本月社区之星] 2.jpg (2006-4-20 21:12, 54.68 K)


图片附件: [本年社区之星] 3.jpg (2006-4-20 21:12, 50.73 K)


图片附件: [收缩效果] 4.jpg (2006-4-20 21:12, 20.78 K)


图片附件: [虚位以待效果] 5.jpg (2006-4-20 21:13, 41.02 K)


图片附件: [后台控制效果] 6.jpg (2006-4-20 21:12, 30.02 K)


附件: [4.22更新] 社区发贴之星(今日+本周+本月+本年发贴排行)后台控制全Cache版 FOR DZ4[1].1正式版.rar (2006-4-22 11:18, 11.13 K)
该附件被下载次数 6
感谢big888 对本插件繁体化,繁体版下载地址 社區發貼之星(今日+本周+本月+本年發貼排行)後台控制全Cache版 FOR DZ4.1正式版.rar
[ 本帖最后由 33201 于 2006-4-22 11:19 编辑 ]
相关关键字:
CACHE 正式版 后台



亿图论坛→诚征友情链接|PR=4 站长交流群:168300
[被屏蔽广告]
2006-4-20 21:12
#1


  

  

  

  


  







33201
King



UID 185954
精华 1
积分 1841
帖子 1336
威望 63
阅读权限 50
注册 2005-4-1
状态 离线
[/url][广告]: [url=https://discuz.dismall.com/thread-223885-1-1.html]Discuz!EXP 2.0.1 发布-已具备搭建小型论坛能力!
QUOTE:
原帖由 月无痕 于 2006-4-20 22:28 发表 走形修正方法:
编辑附件中的show_poststar.htm文件
查找:
CODE:
[Copy to clipboard]
width="{TABLEWIDTH}"在后面加:
CODE:
[Copy to clipboard]
align="center"一共有5
QUOTE:
原帖由 big888 于 2006-4-21 01:27 发表 原来版本升级到现在版本:
一.跳过1-3步骤仅修改4~9步骤即可,和注意11.后台一定要先更新缓存
二.9.1步驟 index.php中
原來的這句要先刪掉
CODE:
[Copy to clipboard]
require DISCUZ_ROOT.'/poststar.php';[ 本帖最后由 33201 于 2006-4-21 07:50 编辑 ]
回复

使用道具 举报

yvoonekit 发表于 2006-4-22 20:00:47 | 显示全部楼层
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /www/users/oscarma.cn/include/db_mysql.class.php on line 55

Discuz! info: MySQL Query Error

User: 拒绝游泳的鱼
Time: 2006-4-22 8:08pm
Script: /admincp.php

SQL: SELECT * FROM cdb_
Error: Table 'oscarma.cdb_' doesn't exist
数据表缺失,请恢复备份数据

Similar error report has beed dispatched to administrator before.
后台更新不了。。出这个。为什么
回复

使用道具 举报

雪雨星风 发表于 2006-4-22 20:35:17 | 显示全部楼层
感谢!
回复

使用道具 举报

 楼主| 33201 发表于 2006-4-22 21:53:01 | 显示全部楼层
原帖由 yvoonekit 于 2006-4-22 20:00 发表
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /www/users/oscarma.cn/include/db_mysql.class.php on line 55

Discuz! info: MySQL Query Error

User: 拒绝游 ...

你的论坛默认数据库前缀是不是cdb,如果不是的话,需要修改的!
如果是的话,你查看下你的安装过程!
我们修改的时候没有涉及到admincp.php,后台只有一个topicadmin.php改这个文件!
回复

使用道具 举报

日特不 发表于 2006-4-22 22:03:43 | 显示全部楼层
原帖由 33201 于 2006-4-22 08:40 发表

如果是这样的话,你查一下默认风格是否能正常显示,如果也不能显示的话,说明是你安装过程出现问题了!

重装了下,还是老样子...郁闷了..实在不行只能改回前一个版本了...
回复

使用道具 举报

86963654 发表于 2006-4-22 22:10:57 | 显示全部楼层
成功安装,帮你顶一下。
回复

使用道具 举报

big888 发表于 2006-4-22 22:30:01 | 显示全部楼层
#101樓是在搞啥??
哪裡有問題是嗎??
回复

使用道具 举报

 楼主| 33201 发表于 2006-4-22 23:10:02 | 显示全部楼层
原帖由 日特不 于 2006-4-21 23:48 发表

试过了,没用哦...怎么办啊?....

要不你把你的文件都传上来,我帮你看一下,(修改用到的文件打个包)
回复

使用道具 举报

日特不 发表于 2006-4-22 23:23:24 | 显示全部楼层
原帖由 33201 于 2006-4-22 23:10 发表

要不你把你的文件都传上来,我帮你看一下,(修改用到的文件打个包)

楼主你是我最后的希望了..先谢谢了...

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

cosmos1983 发表于 2006-4-22 23:23:55 | 显示全部楼层

帮帮我吧

升级错误,MySQL 提示: Duplicate entry 'show_poststar' for key 1
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-16 04:11 , Processed in 0.110102 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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