插件名称:在线时间工资&版主管理工资系统V1.0 for dz4.1/5.0 正式版
适用版本:Discuz! 4.1/5.0
相关修改:数据升级-有,文件修改-有
安装难度:易
插件作者:hfl(主要) cm(少量)
相关说明:
版主管理工资仅限管理人员
在线时间工资对所有会员开放
最后更新:9.15 17:45
演示:
http://faze.byethost24.com/bbs/forumdisplay.php?fid=27 (测试区)
http://faze.byethost24.com/bbs/plugin.php?identifier=paymoney&module=paymoney
用户名:test 密码:test
安装说明 by hfl:
1.在后台升级数据库(数据库升级.txt)(必须先升级数据库)
2.修改文件
在DISCUZ目录下的topicadmin.php
查找
上面加入:
- //HACK
- $queryz = $db->query("SELECT * FROM {$tablepre}paymoney WHERE uid='$discuz_uid' AND username='$discuz_user'");
- if (!$db->result($queryz, 0))
- {$db->query("INSERT INTO {$tablepre}paymoney (uid, username)
- VALUES ('$discuz_uid', '$discuz_user')", 'UNBUFFERED');}
- //hack end
复制代码
查找
- $resultarray['message'] = 'admin_succeed_next';
复制代码
上面加入:
- //HACK
-
- if($operation == 'highlight') {
- $db->query("update {$tablepre}paymoney set salaryhighlight = salaryhighlight + 1 where username = '$discuz_user'");
-
- } elseif($operation == 'move') {
- $db->query("update {$tablepre}paymoney set salarymove = salarymove + 1 where username = '$discuz_user'");
- } elseif($operation == 'close') {
- $db->query("update {$tablepre}paymoney set salaryclose = salaryclose + 1 where username = '$discuz_user'");
-
- } elseif($operation == 'digest') {
- $db->query("update {$tablepre}paymoney set salarydigest = salarydigest + 1 where username = '$discuz_user'");
-
- }elseif($operation == 'stick') {
- $db->query("update {$tablepre}paymoney set salarystick = salarystick + 1 where username = '$discuz_user'");
-
- }elseif($operation == 'delete') {
- $db->query("update {$tablepre}paymoney set salarydelete = salarydelete + 1 where username = '$discuz_user'");
-
- }elseif($operation == 'type') {
- $db->query("update {$tablepre}paymoney set salarytype = salarytype + 1 where username = '$discuz_user'"); }
-
- //hack end
复制代码
查找
在下面加入:
- //hack
- $db->query("update {$tablepre}paymoney set salarypostdel = salarypostdel + 1 where username = '$discuz_user'");
- //hack end
复制代码
查找
- showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed')
复制代码
在上面加入:
- //HACK
-
- if($operation == 'highlight') {
- $db->query("update {$tablepre}paymoney set salaryhighlight = salaryhighlight + 1 where username = '$discuz_user'");
-
- } elseif($operation == 'move') {
- $db->query("update {$tablepre}paymoney set salarymove = salarymove + 1 where username = '$discuz_user'");
- } elseif($operation == 'close') {
- $db->query("update {$tablepre}paymoney set salaryclose = salaryclose + 1 where username = '$discuz_user'");
-
- } elseif($operation == 'digest') {
- $db->query("update {$tablepre}paymoney set salarydigest = salarydigest + 1 where username = '$discuz_user'");
-
- }elseif($operation == 'stick') {
- $db->query("update {$tablepre}paymoney set salarystick = salarystick + 1 where username = '$discuz_user'");
-
- }elseif($operation == 'delete') {
- $db->query("update {$tablepre}paymoney set salarydelete = salarydelete + 1 where username = '$discuz_user'");
-
- }elseif($operation == 'type') {
- $db->query("update {$tablepre}paymoney set salarytype = salarytype + 1 where username = '$discuz_user'"); }
-
- //hack end
复制代码
\include 目录下的editpost.inc.php
[discuz4.1]
查找
- (!empty($delete) && $isfirstpost) ? showmessage('post_edit_delete_succeed', "forumdisplay.php?fid=$fid") :
复制代码
在上面加入:
- //hack
- $query = $db->query("SELECT adminid FROM {$tablepre}members where username='$discuz_user'");
- $user=$db->fetch_array($query);
- $adminid=$user['adminid'];
- if ($adminid>0)
- {
- $queryz = $db->query("SELECT * FROM {$tablepre}paymoney WHERE uid='$discuz_uid' AND username='$discuz_user'");
- if (!$db->result($queryz, 0))
- {$db->query("INSERT INTO {$tablepre}paymoney (uid, username)
- VALUES ('$discuz_uid', '$discuz_user')", 'UNBUFFERED');}
- $db->query("update {$tablepre}paymoney set salaryedit = salaryedit + 1 where username = '$discuz_user'");
- }
- //hack end
复制代码
[discuz5.0]
查找
在上面加入:
- //hack
- $query = $db->query("SELECT adminid FROM {$tablepre}members where username='$discuz_user'");
- $user=$db->fetch_array($query);
- $adminid=$user['adminid'];
- if ($adminid>0)
- {
- $queryz = $db->query("SELECT * FROM {$tablepre}paymoney WHERE uid='$discuz_uid' AND username='$discuz_user'");
- if (!$db->result($queryz, 0))
- {$db->query("INSERT INTO {$tablepre}paymoney (uid, username)
- VALUES ('$discuz_uid', '$discuz_user')", 'UNBUFFERED');}
- $db->query("update {$tablepre}paymoney set salaryedit = salaryedit + 1 where username = '$discuz_user'");
- }
- //hack end
复制代码
3.导入插件数据
4.更新缓存
反安装: (顺序不能颠倒)
1.后台删除插件
2.把topicadmin和editpost改回去(查找//hack到//hack end,删)
3.删除服务器上的插件相关文件
4.后台升级数据库
DROP TABLE cdb_paymoney;
PS:因为是新手,所以避免不了有一些错误,希望大家能够帮忙完善,并提出建议,如需修改,请注名原作者,谢谢。
另外,用了包含运行,请注意不要乱修改文件。。
学插件的新手如有不懂可以加我QQ:347035523 (注明:DZ)另外我也有许多关于优化等问题想向高手请教,如有时间请PM我或加我QQ,谢谢。
请之前下载的重新下载并覆盖plugins文件夹里的文件,谢谢
9.13更新,修复了读取不到在线时间LASTOLUPDATE的BUG(导致资金泛滥),使包含运行程序简化。
9.15更新,发现一个调试语句未打“//”,导致未达到工资底限领取工资之后,基本工资清0,请之前下载的下载覆盖paymoney.inc.php.
9.27更新,游客可以领取工资的BUG已修复。
之前的错误给大家带来的困扰实在是对不起。。
谁有比较好的在线时间公式(以前动网的偶忘了),可以PM我。
估计一段时间内无法更新了,先改叫正式版吧如果发现BUG请PM我。
有人说能不能在线自动薪水的,可以更详细地说一下吗?
如升级出现错误,这样升级数据库
DROP TABLE IF EXISTS cdb_paymoney;
CREATE TABLE `cdb_paymoney` (
`uid` mediumint(8) unsigned NOT NULL auto_increment,
`username` char(15) NOT NULL default '',
`basic` int(10) unsigned NOT NULL default '0',
`online` int(10) unsigned NOT NULL default '0',
`notonlinetime` int(10) unsigned NOT NULL default '0',
`salarydelete` int(10) unsigned NOT NULL default '0',
`salarymove` int(10) unsigned NOT NULL default '0',
`salaryhighlight` int(10) unsigned NOT NULL default '0',
`salaryclose` int(10) unsigned NOT NULL default '0',
`salarystick` int(10) unsigned NOT NULL default '0',
`salarydigest` int(10) unsigned NOT NULL default '0',
`salarytype` int(10) unsigned NOT NULL default '0',
`salaryedit` int(10) unsigned NOT NULL default '0',
`salarypostdel` int(10) unsigned NOT NULL default '0',
`dateline` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`uid`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM;
[ 本帖最后由 hfl 于 2006-11-21 21:54 编辑 ] |