本帖最后由 中天一线 于 2010-9-26 21:41 编辑
原帖子地址
https://discuz.dismall.com/forum.php?mod=viewthread&tid=658365&page=3#pid5369697
viewthread.php
- $post['groupid'] = getgroupid($post['authorid'], $_DCACHE['usergroups'][$post['groupid']], $post);
复制代码
to
- $post['groupid'] = getgroupid($post['authorid'], $_DCACHE['usergroups'][$post['groupid']], $post, 1);
复制代码
include/global.func.php
- function getgroupid($uid, $group, &$member) {
- global $creditsformula, $db, $tablepre;
- if(!empty($creditsformula)) {
- $updatearray = array();
- eval("\$credits = round($creditsformula);");
- if($credits != $member['credits']) {
- $updatearray[] = "credits='$credits'";
- }
- if($group['type'] == 'member' && !($member['credits'] >= $group['creditshigher'] && $member['credits'] < $group['creditslower'])) {
- $query = $db->query("SELECT groupid FROM {$tablepre}usergroups WHERE type='member' AND $member[credits]>=creditshigher AND $member[credits]<creditslower LIMIT 1");
- if($db->num_rows($query)) {
- $member['groupid'] = $db->result($query, 0);
- $updatearray[] = "groupid='$member[groupid]'";
- }
- }
- if($updatearray) {
- $db->query("UPDATE {$tablepre}members SET ".implode(', ', $updatearray)." WHERE uid='$uid'");
- }
- }
- return $member['groupid'];
- }
复制代码
to
- function getgroupid($uid, $group, &$member, $unadmin=0) {
- global $creditsformula, $db, $tablepre;
- if(!empty($creditsformula)) {
- $updatearray = array();
- eval("\$credits = round($creditsformula);");
- if($credits != $member['credits']) {
- $updatearray[] = "credits='$credits'";
- }
- $allow= $unadmin && $member['adminid'] >= 0 ? true : $group['type'] == 'member';
- if($allow && !($member['credits'] >= $group['creditshigher'] && $member['credits'] < $group['creditslower'])) {
- $query = $db->query("SELECT groupid FROM {$tablepre}usergroups WHERE type='member' AND $member[credits]>=creditshigher AND $member[credits]<creditslower LIMIT 1");
- if($db->num_rows($query)) {
- $member['groupid'] = $db->result($query, 0);
- $updatearray[] = "groupid='$member[groupid]'";
- }
- }
- if($updatearray && !($unadmin && $group['type'] != 'member')) {
- $db->query("UPDATE {$tablepre}members SET ".implode(', ', $updatearray)." WHERE uid='$uid'");
- }
- }
- return $member['groupid'];
- }
复制代码
修改前一定要备份 我目前测试没问题 但不保证绝对不出意外
X1.5找不到对应的文件了。
|