经测试,后台pw缓存库对应的php文件是lib/elementupdate.class.php。楼上提到的很可能是会员排行榜的相关函数是userSortUpdate()(楼上红色标定。下面的代码略有修改,但没能成功实现):
function userSortUpdate($winddb) {
global $timestamp, $tdtime, $montime, $_CREDITDB;
if ($this->_inUidBlackList($winddb['uid'])) {
return false;
}
$usersort_judge = array();
//* include pwCache::getPath(D_P . 'data/bbscache/usersort_judge.php');
extract(pwCache::getData(D_P . 'data/bbscache/usersort_judge.php', false));
$winddb['lastpost'] < $tdtime && $winddb['todaypost'] = 0;
$winddb['lastpost'] < $montime && $winddb['monthpost'] = 0;
$sorttype = array(
'money',
'rvrc',
'credit',
'currency',
'todaypost',
'monthpost',
'postnum',
'monoltime',
'onlinetime',
'digests',
'f_num'
);
if ($_CREDITDB) {
$query = $this->db->query("SELECT cid,value FROM pw_membercredit WHERE uid=" . S::sqlEscape($winddb['uid']));
while ($rt = $this->db->fetch_array($query)) {
if (!$rt['value']) continue;
$winddb[$rt['cid']] = $rt['value'];
}
foreach ($_CREDITDB as $key => $val) {
is_numeric($key) && $sorttype[] = $key;
}
}
$change = $marks = array();
foreach ($sorttype as $value) {
if (in_array($value,$sorttype) && $winddb[$value]>PW_OVERFLOW_NUM) {
$this->_excuteOverflow($winddb['uid'],$value);
$winddb[$value] = 0;
}
if ($winddb[$value] > $usersort_judge[$value]) {
$marks[] = $value;
if ($value == 'rvrc') {
$winddb[$value] = floor($winddb[$value] / 10);
} elseif ($value == 'onlinetime') {
$winddb[$value] = floor($winddb[$value] / 3600);
} elseif ($value == 'monoltime') {
$winddb[$value] = round($winddb[$value] / 3600,2);
}
$change[] = array(
'usersort',
$value,
$winddb['uid'],
$winddb[$value],
$winddb['username'],
$timestamp
);
}
}
$rand_array = array(
'todaypost',
'monthpost',
'monoltime'
);
$rand_key = array_rand($rand_array);
$rand_mark = $rand_array[$rand_key];
if (!in_array($rand_mark, $marks)) {
$marks[] = $rand_mark;
}
if ($marks && $change) {
$this->db->update("REPLACE INTO pw_elements(type,mark,id,value,addition,time) VALUES " . S::sqlMulti($change, false));
$sortlist = array();
$dellist = array();
$query = $this->db->query("SELECT * FROM pw_elements WHERE type='usersort' AND mark IN (" . S::sqlImplode($marks) . ") ORDER BY mark,value DESC");
while ($rt = $this->db->fetch_array($query)) {
if (($rt['mark'] == 'todaypost' && $rt['time'] < $tdtime) || (in_array($rt['mark'], array(
'monthpost',
'monoltime'
)) && $rt['time'] < $montime)) {
$dellist[] = $rt['eid'];
continue;
}
$sortlist[$rt['mark']][] = $rt;
}
$judge = $usersort_judge;
foreach ($sortlist as $key => $value) {
if (count($value) > $this->cachenum) {
$tem = array_pop($value);
$dellist[] = $tem['eid'];
}
if (count($value) == $this->cachenum) {
$tem = end($value);
$judge[$key] = $tem['value'];
} else {
$judge[$key] = '0';
}
}
if ($dellist) {
$this->db->update("DELETE FROM pw_elements WHERE eid IN (" . S::sqlImplode($dellist) . ")");
}
if ($judge != $usersort_judge) {
pwCache::setData(D_P . 'data/bbscache/usersort_judge.php', "<?php\r\n\$usersort_judge=" . pw_var_export($judge) . ";\r\n?>");
}
}
}