看了一下discuz太阳星星月亮等级显示的方法是按照会员组对应的星星和设置的阀值来显示太阳星星月亮的,然而discuz中管理员 版主 超级版主等系统用户组和管理组的groupid是不会随着积分的升高而变化的,普通会员却可以变化,所以导致了管理员 版主 超级版主的星星月亮太阳数量不会变化...
修改前请注意备份viewthead.php文件
修改了一下根目录下的viewthead.php文件,让管理员 版主 超级版主等也按照积分来排列星星月亮太阳
查找if(empty($action) && $tid){约第190行
在这行下面加入
[php]
$my_group_from_credits = array();
foreach($_DCACHE['usergroups'] as $my_group){
if($my_group['type'] == 'member'){
$my_group_from_credits[$my_group['creditslower']] = $my_group['stars'];
}
}
ksort($my_group_from_credits);
reset($my_group_from_credits);
[/php]
在函数viewthread_procpost的$threadpay后面面加入一个变量$my_group_from_credits
[php]
global $_DCACHE, $newpostanchor, $numpost, $thisbg, $postcount, $ratelogpids, $onlineauthors, $lastvisit, $thread,
$attachpids, $attachtags, $forum, $dateformat, $timeformat, $timeoffset, $userstatusby, $allowgetattach,
$ratelogrecord, $showimages, $forum, $discuz_uid, $showavatars, $pagebydesc, $ppp, $ppp2, $ppp3,
$firstpid, $videoopen, $threadpay,$my_group_from_credits;
[/php]
将这段注释
[php]
if($_DCACHE['usergroups'][$post['groupid']]['userstatusby'] == 1) {
$post['authortitle'] = $_DCACHE['usergroups'][$post['groupid']]['grouptitle'];
$post['stars'] = $_DCACHE['usergroups'][$post['groupid']]['stars'];
} elseif($_DCACHE['usergroups'][$post['groupid']]['userstatusby'] == 2) {
foreach($_DCACHE['ranks'] as $rank) {
if($post['posts'] > $rank['postshigher']) {
$post['authortitle'] = $rank['ranktitle'];
$post['stars'] = $rank['stars'];
break;
}
}
}
[/php]
下面添加如下代码
[php]
foreach($my_group_from_credits as $rank1=>$rank2){
if($post['credits'] <= $rank1){
$post['authortitle'] = $_DCACHE['usergroups'][$post['groupid']]['grouptitle'];
$post['stars'] = $rank2;
break;
}
}
[/php]
至此管理员 版主 超级版主的星星月亮太阳数量也会按照积分显示了 |