Manyou诚邀开发者加盟 | 常见问题
《站长》俱乐部官方群公布 城市联络员机会多多
立即免费下载 Discuz!7.0.0 正式版
安装升级指南 | 用户手册 | 新手建站学堂
基于.net架构的Discuz!NT2.6正式版发布
Comsenz公司2009年招贤纳士,期待您的加盟
Discuz!收费服务内容及价格
7月重庆、成都、西安三地社区运营实战特训速报名
Discuz!/UCHome 专用官方虚拟主机
牧场新服一起联运:豆浆机免费带回家
基于Discuz!的免费论坛空间5D6D
康盛创想《站长》俱乐部18城市互动之旅报名ing
返回列表 回复 发帖

FOR Discuz!5.5.0社区发贴之星 安装的朋友顶一下

插件名称:社区发贴之星(今日+昨日+本周+本月+本年发贴排行)
插件作者:33201
插件修改作者:型仔
安装难度:中
插件演示地址:http://www.xz1069.com/index.php这里说明下,按下面要求做出来的位置是在联盟论坛上方的,我这里是自己调四格上方去的
版权归插件原作者33201所有
  1. 插件功能:
  2. 新增加的功能:
  3.           1.首页显示今日+本周+本月+本年四类发帖状元、榜眼、探花,不分男女!可切换显示,有效增加会员
  4.               的发贴 热情和参与度
  5.           2.首页显示今日+本周+本月+本年发贴TOP10
  6.           3.增加了一个单独的社区明星页面显示今日+昨日+本周+本月+本年五类发帖状元、榜眼、探花以及发贴TOP10
  7.           4.修正了原来的状元、榜眼或探花不存在时的空白问题,在不存在时显示为虚位以待
  8.           5.全部内容生成缓存cache,不增加任何查询,有效减轻服务器负担
  9. 原来的功能:
  10.           1.首页显示当日发帖状元、榜眼、探花,不分男女!
  11.           2.显示当日发帖最多的十位会员!
  12.           3.加入收缩展开功能(默认发帖状元、榜眼、探花三栏隐藏的,当然你也可以修改为展开的)!
复制代码
插件安装步骤:
1.上传附件!

2.编辑文件include/cache.func.php
2.1查找:
  1.                 'medals'        => array('medals'),
复制代码
在其上面加
  1. 'poststar'        => array('daystar', 'yestodaystar','weekstar', 'monthstar', 'yearstar'),
复制代码
2.2查找:
  1. case 'medals':
  2.                         $table = 'medals';
  3.                         $cols = 'medalid, name, image';
  4.                         $conditions = "WHERE available='1'";
  5.                         break;
复制代码
在其上面加
  1. //===============社区明星BY 33201 开始
  2.                 case 'daystar':
  3.                         $month=date(n);
  4.                         $date=date(j);
  5.                         $year=date(Y);
  6.                         $time=mktime(0,0,0,$month,$date,$year);
  7.                         $table = 'posts p';
  8.                         $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';
  9.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline>$time  group by p.authorid order by num desc limit 0,10";
  10.                         break;
  11.                 case 'yestodaystar':
  12.                         $month=date(n);
  13.                         $date=date(j);
  14.                         $year=date(Y);
  15.                         $time=mktime(0,0,0,$month,$date,$year);
  16.                         $ytime=mktime(0,0,0,$month,$date-1,$year);
  17.                         $table = 'posts p';
  18.                         $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';
  19.                         $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 and p.dateline>$ytime  group by p.authorid order by num desc limit 0,10";
  20.                         break;
  21.                 case 'weekstar':
  22.                         $month=date(n);
  23.                         $date=date(j);
  24.                         $year=date(Y);
  25.                         $week=date(w);
  26.                         $time=mktime(0,0,0,$month,$date,$year);
  27.                         $weektime=mktime(0,0,0,$month,$date-$week,$year);
  28.                         $table = 'posts p';
  29.                         $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';
  30.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline>=$weektime  group by p.authorid order by num desc limit 0,10";
  31.                         break;
  32.                 case 'monthstar':
  33.                         $month=date(n);
  34.                         $year=date(Y);
  35.                         $monthtime=mktime(0,0,0,$month,1,$year);
  36.                         $table = 'posts p';
  37.                         $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';
  38.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline>=$monthtime  group by p.authorid order by num desc limit 0,10";
  39.                         break;
  40.                
  41.                 case 'yearstar':
  42.                         $year=date(Y);
  43.                         $yeartime=mktime(0,0,0,1,1,$year);
  44.                         $table = 'posts p';
  45.                         $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';
  46.                         $conditions = "left join {$tablepre}members m on p.authorid=m.uid  left join {$tablepre}memberfields me on p.authorid=me.uid where p.dateline>=$yeartime  group by p.authorid order by num desc limit 0,10";
  47.                         break;

  48. //===================社区明星BY 33201 结束
复制代码
2.3 查找:
  1. case 'settings':
  2.                         $data['qihoo_links'] = array();
  3.                         while($setting = $db->fetch_array($query))
复制代码
在其上面加
  1. //===================社区明星BY 33201 开始
  2.                 case 'daystar':
  3.                         while($toppost = $db->fetch_array($query)) {
  4.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  5.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  6.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  7.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  8.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  9.                                 $data[] = $toppost;
  10.                         }
  11.                         break;
  12.                 case 'yestodaystar':
  13.                         while($toppost = $db->fetch_array($query)) {
  14.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  15.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  16.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  17.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  18.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  19.                                 $data[] = $toppost;
  20.                         }
  21.                         break;
  22.                 case 'weekstar':
  23.                         while($toppost = $db->fetch_array($query)) {
  24.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  25.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  26.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  27.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  28.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  29.                                 $data[] = $toppost;
  30.                         }
  31.                         break;
  32.                 case 'monthstar':
  33.                         while($toppost = $db->fetch_array($query)) {
  34.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  35.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  36.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  37.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  38.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  39.                                 $data[] = $toppost;
  40.                         }
  41.                         break;
  42.                 case 'yearstar':
  43.                         while($toppost = $db->fetch_array($query)) {
  44.                                 $toppost['author'] = $toppost['author'] ? $toppost['author'] : '游客';
  45.                                 $toppost['authorid'] = $toppost['authorid'] ? $toppost['authorid'] : '游客';
  46.                                 $toppost['avatar'] = $toppost['avatar'] ? $toppost['avatar'] : 'images/nopic.gif';
  47.                                 $toppost['avatarwidth'] = $toppost['avatarwidth'] ? $toppost['avatarwidth'] : '80';
  48.                                 $toppost['avatarheight'] = $toppost['avatarheight'] ? $toppost['avatarheight'] : '80';
  49.                                 $data[] = $toppost;
  50.                         }
  51.                         break;

  52. //=====================社区明星BY 33201 结束
复制代码
3.编辑文件include/newthread.inc.php
查找
  1. updatepostcredits('+', $discuz_uid, $postcredits);
复制代码
在其下面加
  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.                 updatecache('daystar');
复制代码
4.编辑文件include/newreply.inc.php
查找
  1. updatepostcredits('+', $discuz_uid, $replycredits);
复制代码
在其下面加
  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.                 updatecache('daystar');
复制代码
5.编辑文件topicadmin.php
查找
  1. showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), $resultarray['redirect']);
复制代码
在其上面加
  1. require_once DISCUZ_ROOT.'./include/cache.func.php';
  2.                 updatecache('daystar');
复制代码
6.编辑文件index.php
6.1查找:
  1. require_once DISCUZ_ROOT.'./include/forum.func.php';
复制代码
下面添加:
  1. require_once DISCUZ_ROOT.'./forumdata/cache/cache_poststar.php';
  2. $month=date(n);
  3. $year=date(Y);
复制代码
6.2查找:
  1. unset($_DCACHE['announcements']);
复制代码
下面添加:
  1. //========== 社区明星BY 33201 开始
  2. $nopoststar ='<td width=17%>姓名:<font color=red><b> 虚位以待!</b></font> <br>UID  :<b>空</b> <br>积分:空 <br>精华:空<br>今日发帖:空<br>总发帖量:空<br> 在线时间:空 <br> </td><td width=16% align=center class=altbg1><img src=images/nopic.gif width=80 height=80 align=center></td>';
  3.     if($_DCACHE['daystar']) {
  4.                 foreach($_DCACHE['daystar'] as $key => $dstar) {
  5.             if ($key<3){
  6.                 $daystars .="<td width=17%>姓名:<b>".$dstar[author]."</b> <br>UID  :<b>".$dstar[authorid]."</b> <br>积分:".$dstar[credits]." <br>精华:".$dstar[digestposts]." 篇<br><font color=red><b>今日</b></font>发帖:<font color=red><b>".$dstar[num]."</b></font> 篇<br>总发帖量:".$dstar[posts]." 篇<br> 在线时间:".$dstar[oltime]." 小时<br> </td><td width=16% align=center class=altbg1><img src=".$dstar[avatar]." width=".$dstar[avatarwidth]." height=".$dstar[avatarheight]." align=center></td>";$n=$key;
  7. }
  8.                 }
  9. if($n==0){$nostar .=$nopoststar.$nopoststar;}elseif($n==1){$nostar .=$nopoststar;}
  10.         }
  11.     if($_DCACHE['weekstar']) {
  12.                 foreach($_DCACHE['weekstar'] as $key => $wstar) {
  13.             if ($key<3){
  14.                 $weekstars .="<td width=17%>姓名:<b>".$wstar[author]."</b> <br>UID  :<b>".$wstar[authorid]."</b> <br>积分:".$wstar[credits]." <br>精华:".$wstar[digestposts]." 篇<br><font color=red><b>本周</b></font>发帖:<font color=red><b>".$wstar[num]."</b></font> 篇<br>总发帖量:".$wstar[posts]." 篇<br> 在线时间:".$wstar[oltime]." 小时<br> </td><td width=16% align=center class=altbg1><img src=".$wstar[avatar]." width=".$wstar[avatarwidth]." height=".$wstar[avatarheight]." align=center></td>";$weeknum=$key;
  15.             }
  16.                 }
  17. if($weeknum==0){$noweekstar .=$nopoststar.$nopoststar;}elseif($weeknum==1){$noweekstar .=$nopoststar;}
  18.         }
  19.     if($_DCACHE['monthstar']) {
  20.                 foreach($_DCACHE['monthstar'] as $key => $mstar) {
  21.             if ($key<3){
  22.                 $monthstars .="<td width=17%>姓名:<b>".$mstar[author]."</b> <br>UID  :<b>".$mstar[authorid]."</b> <br>积分:".$mstar[credits]." <br>精华:".$mstar[digestposts]." 篇<br><font color=red><b>".$month."月</b></font>发帖:<font color=red><b>".$mstar[num]."</b></font> 篇<br>总发帖量:".$mstar[posts]." 篇<br> 在线时间:".$mstar[oltime]." 小时<br> </td><td width=16% align=center class=altbg1><img src=".$mstar[avatar]." width=".$mstar[avatarwidth]." height=".$mstar[avatarheight]." align=center></td>";
  23.             }
  24.                 }
  25.         }
  26.     if($_DCACHE['yearstar']) {
  27.                 foreach($_DCACHE['yearstar'] as $key => $ystar) {
  28.             if ($key<3){
  29.                 $yearstars .="<td width=17%>姓名:<b>".$ystar[author]."</b> <br>UID  :<b>".$ystar[authorid]."</b> <br>积分:".$ystar[credits]." <br>精华:".$ystar[digestposts]." 篇<br><font color=red><b>".$year."年</b></font>发帖:<font color=red><b>".$ystar[num]."</b></font> 篇<br>总发帖量:".$ystar[posts]." 篇<br> 在线时间:".$ystar[oltime]." 小时<br> </td><td width=16% align=center class=altbg1><img src=".$ystar[avatar]." width=".$ystar[avatarwidth]." height=".$ystar[avatarheight]." align=center></td>";
  30.             }
  31.                 }
  32.         }
  33. //==========社区明星BY 33201 结束
复制代码
7.编辑模板discuz.htm
查找:
  1. <!--{if empty($gid) && ($_DCACHE['forumlinks'] || $whosonlinestatus || $bdaystatus == 1 || $bdaystatus == 3)}-->
复制代码
在它的上面或下面加:
  1. {template show_poststar}
复制代码
8.后台更新缓存,一定要更新,否则可能首页无法显示
完毕!
注意:首页默认发帖状元、榜眼、探花三栏是展开的,如果你想默认改为隐藏的就将show_poststar.htm
中的
  1. <tbody id="poststar" style="display:yes">
复制代码
的 yes 修改为 none 即可!

由于时间仓促和本人水平有限,难免存在一些BUG,大家有什么意见和建议还望大家及时提出,谢谢

[ 本帖最后由 型仔123 于 2007-5-10 13:04 编辑 ]

演示图

1.jpg

社区发帖之星For Disucz!5.5.0.rar (16.76 KB)

附件下载

社区发帖之星For Disucz!5[1].5.0.rar (16.76 KB)

售价: 金币 2 个  [记录]  [购买]

这是花钱下载,穷,有钱的给点钱吧,没钱下那个不要钱的

3

评分次数

  • 昆山365

  • itotti

  • 單身好浪漫

演示见:http://bbs.qiuso.com/:)
2楼骗子不要乱说啊
不错。顶一下。
谢谢,我也是自己用过,就和大家分享
,没有人需要啊
我觉得这样太多了,用一行来显示昨日、今日、本周发贴明星就足够了
原帖由 sini 于 2007-3-17 14:40 发表
我觉得这样太多了,用一行来显示昨日、今日、本周发贴明星就足够了
你看看图片啊
收藏
请问要入何放在联盟论坛的上面?????

型仔123 帮帮我啊
返回列表