PhpWind教程:總積分(綜合積分)顯示在文章頁面(read)的方法(For 6.3.2 7.0)_PhpWind教程
有人要總積分的顯示方法,這個(gè)數(shù)據(jù)庫里沒現(xiàn)成的字段,是根據(jù)現(xiàn)有的威望金錢等算出來的
打開read.php
搜索
$read['groupid']==6 && $read['honor'] = '';
下面加上
//總積分計(jì)算開始
$usercredit=array(
'postnum' => $read['postnum'],
'digests' => $read['digests'],
'rvrc' => $read['rvrc'],
'money' => $read['money'],
'credit' => $read['credit'],
'onlinetime'=> $read['onlinetime'],
);
include(D_P.'data/bbscache/config.php');
$upgradeset = unserialize($db_upgrade);
foreach($upgradeset as $key=>$val){
if(is_numeric($key)){
foreach(GetCredit($read['uid']) as $key=>$value){
$usercredit[$key] = $value[1];
}
break;
}
}
$read['total'] = CalculateCredit($usercredit,$upgradeset);
//總積分計(jì)算結(jié)束
然后在這個(gè)文件最后
?>
之前,加上
//總積分計(jì)算開始
function GetCredit($uid){
global $db,$_CREDITDB;
$credit = array();
if (is_array($_CREDITDB)) {
foreach ($_CREDITDB as $key => $value) {
$credit[$key] = array($value[0],0);
}
}
$query = $db->query("SELECT cid,value FROM pw_membercredit WHERE uid='$uid'");
while ($rt = $db->fetch_array($query)) {
$credit[$rt['cid']] = array($_CREDITDB[$rt['cid']][0],$rt['value']);
}
return $credit;
}
function CalculateCredit($creditdb,$upgradeset){
$credit=0;
foreach($upgradeset as $key=>$val){
if($creditdb[$key] && $val){
if($key == 'rvrc'){
$creditdb[$key] /= 10;
} elseif($key == 'onlinetime'){
$creditdb[$key] /= 3600;
}
$credit += $creditdb[$key]*$val;
}
}
return (int)$credit;
}
//總積分計(jì)算結(jié)束
然后打開template/wind/read.htm
找到
發(fā)帖: $read[postnum]
前面加上
總積分: $read[total]
當(dāng)然這個(gè)位置隨您喜好而定
- PhpWind教程:PHPWind forum V7.5 SP1 使用與修復(fù)說明
- PhpWind教程:PHPWind Forum V7.5 升級(jí)教程
- PHPWind7.3 升級(jí)7.3.2 圖文教程
- PhpWind教程:sitemap生成問題
- PhpWind教程:熱榜排行 for 75
- PHPwind 6.3.2升級(jí)至PHPwind 7.3.2 圖文教程
- PHPWind 7.0 升級(jí)至PHPwind 7.3.2 圖文教程
- PHPWind 7.0 升級(jí)到PHPwind v7.3 圖文教程
- PHPWind 6.3.2升級(jí)到 PHPwind v7.3 圖文教程
- PHPWind6.3.2升級(jí)PHPWind7.0說明教程
- PhpWind教程:PHPWind6.3(6.3rc、6.3) to PHPWind6.3.2升級(jí)教程
- PhpWind教程:PHPWind6.x(6.0rc、6.0) to PHPWind6.3.2升級(jí)教程
PhpWind教程教程Rss訂閱Cms教程搜索
PhpWind教程推薦
- PhpWind教程:10分鐘建站教程
- PhpWind教程:已經(jīng)安裝了PHPWind,打開論壇首頁還是安裝界面
- PhpWind教程:Discuz! 7.0 轉(zhuǎn)換到PHPWind 7.3.2
- PhpWind教程:自定義幫助文檔 使用教程
- PhpWind教程:安裝或升級(jí)時(shí)藍(lán)屏
- PhpWind教程:PHPWind之自定義風(fēng)格
- DZ轉(zhuǎn)到PW后,SS添加rewrite偽靜態(tài)規(guī)則
- PhpWind教程:同一郵箱可以注冊(cè)多個(gè)帳號(hào)修改方法_for 7.X
- Phpwind7.3.2廣告位設(shè)置
- PhpWind教程:安裝時(shí),Attachment/thumb/data/groupdb/等文件或文件夾777屬性
- 相關(guān)鏈接:
復(fù)制本頁鏈接| 搜索PhpWind教程:總積分(綜合積分)顯示在文章頁面(read)的方法(For 6.3.2 7.0)
- 教程說明:
PhpWind教程-PhpWind教程:總積分(綜合積分)顯示在文章頁面(read)的方法(For 6.3.2 7.0)
。