/** * 实例化getinfo:由于getinfo类采用了单件模式,所以实例化比较特殊 * * @param bool $reality * @param num $num * @return object */ function singLeton($reality, $num) { require_once R_P . 'lib/getinfo.class.php'; $info =& GetInfo::getInstance($reality); $info->cachenum = $num; return $info; }
/** * 实例化getinfo:由于getinfo类采用了单件模式,所以实例化比较特殊 * * @param bool $reality * @param num $num * @return object */ function singLeton($reality, $num) { L::loadClass('getinfo', '', false); $info =& GetInfo::getInstance($reality); $info->cachenum = $num; return $info; }
} updatecache_c(); adminmsg('operate_success', $basename . '&action=blacklist'); } else { include PrintEot('pwcache'); exit; } } elseif ($action == 'update') { $type = S::getGP('type', 'G'); if (!$type) { include PrintEot('pwcache'); exit; } else { !$db_sortnum && ($db_sortnum = 20); L::loadClass('getinfo', '', false); $getinfo =& GetInfo::getInstance(); if (in_array($type, array('replysort', 'replysortday', 'replysortweek'))) { $step = intval(S::getGP('step')); //* require_once pwCache::getPath(D_P.'data/bbscache/forum_cache.php'); pwCache::getData(D_P . 'data/bbscache/forum_cache.php'); $arr_forumkeys = array_keys($forum); $fourmlimit = array(); for ($j = 0; $j < 5; $j++) { $replysort_judge = ''; //* @include_once pwCache::getPath(S::escapePath(D_P.'data/bbscache/replysort_judge_'.$j.'.php')); pwCache::getData(S::escapePath(D_P . 'data/bbscache/replysort_judge_' . $j . '.php')); $replysort_judge && ($fourmlimit[$j] = $replysort_judge); } if (!$step) { $step = 0; for ($j = 0; $j < 5; $j++) {
function updateFansSort() { global $db; L::loadClass('getinfo', '', false); $getinfo =& GetInfo::getInstance(); $userId = $userIds = array(); $db->update("DELETE FROM pw_elements WHERE type='totalfans' "); $userIds = $getinfo->getTotalFansSort(100); if (!S::isArray($userIds)) { return false; } foreach ($userIds as $key => $value) { $userId[$key]['id'] = $value['uid']; $userId[$key]['value'] = $value['fans']; $userId[$key]['type'] = "totalfans"; $userId[$key]['mark'] = "fans"; } if ($userId) { $sql = "REPLACE INTO pw_elements(id,value,type,mark) VALUES " . S::sqlMulti($userId, true); $db->update($sql); } return true; }