类百度知道多组头衔角色插件

类百度知道多组头衔角色插件

一,覆盖所有文件!

二,到控制面板后台 导入discuz_plugin_rankgroup.txt!

三,将cdb_rankgroup.sql导入数据库,其中注意更改表的前缀{$tablepre},我的是默认的”cdb_”!

四,到{$tablepre}members 表中,添加一字段,字段名为 rankgroupid
或者直接mysql执行

ALTER TABLE `cdb_members` ADD `rankgroupid` SMALLINT( 6 ) UNSIGNED NOT NULL DEFAULT '0' COMMENT '等级组';

其中注意更改表的前缀{$tablepre}

五,后台–>用户–>发帖级别数–>将”级别头衔”改为从”一级”到”十级”或者更多,”发贴数高于”要从0开始增加,其他随便!

六,打开viewthread.php
358行

mf.customstatus, mf.spacename 

后面,添加

 , m.rankgroupid   

注意空格以及逗号!
480行

$post['authortitle'] = $rank['ranktitle'];  

改为

if($post['rankgroupid'] == 0) {
$post['rankgroupid'] = 1;
}
$post['authortitle'] = $rank['rankgroup'][$post['rankgroupid']]['gname'];

七,打开 space.php

 require_once './include/common.inc.php';

下一行 加入

require_once DISCUZ_ROOT.'./plugins/rankgroup/rankgroup.func.php';

33行左右

 r.stars AS rankstars 

后面加入

   , r.rankid    

注意空格 逗号!!
77行

$postperday = $timestamp - $member['regdate'] > 86400 ? round(86400 * $member['posts'] / ($timestamp - $member['regdate']), 2) : $member['posts'];

后面加入

$member['ranktitle'] = get_rankgroup_name($member['rankgroupid'],$member['rankid']);

八,打开cache.func.php

342行附近

$cols = 'ranktitle, postshigher, stars, color';

中color后添加个,rankid
成为

$cols = 'ranktitle, postshigher, stars, color, rankid';

914行

while($rank = $db->fetch_array($query)) {  

下面加入

/* Start */
$rankgroup = array();
$sqlrg = "select gid , gname from {$tablepre}rankgroup WHERE rankid = ".$rank['rankid'];
$queryrg = $db->query($sqlrg);
while($rs = $db->fetch_array($queryrg))
{
$rankgroup[$rs['gid']] = $rs;
}
$rank['rankgroup'] = $rankgroup;
unset($rankgroup);
/* End */

九,保存! 登录管理员到后台,更新数据,缓存即可!

十,这个只是测试的,请勿使用到正式论坛中!! 切记切记!!!!如果有疑问,欢迎大家回帖告诉在下,在下尽快修改!

BY CFC4N cfc4nphp#gmail.com www.cnxct.com 2008-11-28 10:39

PS: 以后更新bug或者功能之类的,我写最后更新时间,不会说版本号,因为我不知道如何命名版本号,什么beta,alphal,Release之类的,乱七八糟的!还不如以最后更新日期做为版本号!

附件地址:
UTF-8版http://www.cnxct.com/wp-content/uploads/2008/11/RankGroup_UTF8.rar
GBK版http://www.cnxct.com/wp-content/uploads/2008/11/RankGroup_GBK_6.1.rar
GBK6.0版http://www.cnxct.com/wp-content/uploads/2008/11/RankGroup_GBK_6.0.rar

随机日志

发表评论

1 Comments.

  1. 你好,感谢你开发了这个插件,我在测试的时候发现头衔系统的面板似乎格式有点问题,能帮忙看看会是什么原因吗?谢谢。

    地址:
    http://dztest.idc139.ipx.com.cn/bbs/rankgroup.php

Leave a Reply



[ Ctrl + Enter ]

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

CNXCT小组的博客 is Stephen Fry proof thanks to caching by WP Super Cache