我只想显示管理组会员的发帖数级别要如何修改?
普通会员不变。
zhangjinlu 发表于 2009-5-16 19:57
其中viewthread.php修改的那步,请添加:- $post['dbdateline'] = $post['dateline'];
- $post['dateline'] = dgmdate("$dateformat $timeformat", $post['dateline'] + $timeoffset * 3600);
- $post['groupid'] = $_DCACHE['usergroups'][$post['groupid']] ? $post['groupid'] : 7;
- foreach($_DCACHE['ranks'] as $ids => $value){
- if($value['postshigher'] > $post['posts'])
- {
- $post['posthigher'] = $_DCACHE['ranks'][$ids+1]['postshigher'];
- $post['postlower'] = $_DCACHE['ranks'][$ids]['postshigher'];
- $post['posttitle'] = $_DCACHE['ranks'][$ids+1]['ranktitle'];
- $post['showstar'] = $_DCACHE['ranks'][$ids+1]['stars'];
- }
- }
- $post['lev'] = dislev($post['adminid'],$post['credits'],$post['posts'],$post['posttitle'],$post['posthigher'],$post['postlower'],$post['showstar'],
- $_DCACHE['usergroups'][$post['groupid']]['stars'],
- $_DCACHE['usergroups'][$post['groupid']]['creditshigher'],
- $_DCACHE['usergroups'][$post['groupid']]['creditslower']
- );
复制代码 修改forum.func.php的那步,请添加:- function dislev($adminid, $exp,$postsnum,$posttitle,$posthigher,$postlower,$showstars,$stars,$higher,$lower){
- global $starthreshold;
- $lvstars = '';
- $num = $showstars;
- $alt = 'alt="Rank: '.$num.'"';
- if(empty($starthreshold)) {
- for($i = 0; $i < $num; $i++) {
- $lvstars .= '<img src="'.IMGDIR.'/star_level1.gif" '.$alt.' />';
- }
- } else {
- for($i = 3; $i > 0; $i--) {
- $numlevel = intval($num / pow($starthreshold, ($i - 1)));
- $num = ($num % pow($starthreshold, ($i - 1)));
- for($j = 0; $j < $numlevel; $j++) {
- $lvstars .= '<img src="'.IMGDIR.'/star_level'.$i.'.gif" '.$alt.' />';
- }
- }
- }
- $maxlv = 50;
- if($stars > $maxlv) $stars = $maxlv;
- $exp1 = $lower-$higher;
- $exp2 = $exp-$higher;
- $exp3 = $postsnum-$posthigher;
- $exp4 = $postlower - $posthigher;
- $lvb = round($stars/$maxlv,2)*100;//等级的百分比
- $expb = round($exp2/$exp1,2)*100;//距下一等级的积分的百分比
- $expb1 = round($exp3/$exp4,2)*100;//发帖数百分比
-
- $levstr = '';
- if($adminid == 0) $levstr = "<p> 当前等级: $stars </p>
- <div class="showlv" ><img src="/images/default/fill1.gif" width="$lvb%" height="13" /></div>";
- if($exp1 != 0) $levstr .="<p>下一用户等级: $exp2 / $exp1</p>
- <div class="showlv"><img src="/images/default/fill2.gif" width="$expb%" height="13" /></div>";
- if($exp4 != 0) $levstr .="<p>$posttitle $lvstars</p><p>发帖级别: $exp3 / $exp4</p>
- <div class="showlv"><img src="/images/default/fill3.gif" width="$expb1%" height="13" /></div>";
- return $levstr;
- }
复制代码 其它的文件修改方法不变 |