修复 排行的语法严谨性

This commit is contained in:
Comsenz 2017-07-28 09:26:55 +08:00
parent f94d1687ff
commit 89bc5727f1
1 changed files with 12 additions and 0 deletions

View File

@ -427,6 +427,9 @@ function getranklist_member_post($num, $orderby) {
}
function getranklistdata($type, $view = '', $orderby = 'all') {
if (!function_exists('getranklist_'.$type)) {
return array();
}
global $_G;
$cache_time = $_G['setting']['ranklist'][$type]['cache_time'];
$cache_num = $_G['setting']['ranklist'][$type]['show_num'];
@ -440,6 +443,15 @@ function getranklistdata($type, $view = '', $orderby = 'all') {
$ranklistvars = array();
loadcache('ranklist_'.$type);
if(!isset($_G['cache']['ranklist_'.$type]) || !is_array($_G['cache']['ranklist_'.$type])) {
$_G['cache']['ranklist_'.$type] = array();
}
if(!isset($_G['cache']['ranklist_'.$type][$view]) || !is_array($_G['cache']['ranklist_'.$type][$view])) {
$_G['cache']['ranklist_'.$type][$view] = array();
}
if(!isset($_G['cache']['ranklist_'.$type][$view][$orderby]) || !is_array($_G['cache']['ranklist_'.$type][$view][$orderby])) {
$_G['cache']['ranklist_'.$type][$view][$orderby] = array();
}
$ranklistvars = & $_G['cache']['ranklist_'.$type][$view][$orderby];
if(empty($ranklistvars['lastupdated']) || (TIMESTAMP - $ranklistvars['lastupdated'] > $cache_time)) {