$updatelist[] = array('hitsortday', $fid, $thread['tid'], $thread['hits'], $thread['postdate'], 0); $updatetype['hitsortday'] = 1; } } if ($db_ifpwcache & 64 && $thread['postdate'] > $timestamp - 7 * 24 * 3600) { if ($thread['hits'] > $hitsort_judge['hitsortweek'][$fid] && $thread['fid'] == $fid) { $updatelist[] = array('hitsortweek', $fid, $thread['tid'], $thread['hits'], $thread['postdate'], 0); $updatetype['hitsortweek'] = 1; } } } if ($updatelist) { L::loadClass('elementupdate', '', false); $elementupdate = new ElementUpdate($fid); $elementupdate->setJudge('hitsort', $hitsort_judge); $elementupdate->setUpdateList($updatelist); $elementupdate->setUpdateType($updatetype); $elementupdate->updateSQL(); unset($elementupdate); } unset($updatelist, $updatetype, $hitsort_judge); } //End Here $pwAnonyHide = $isGM || $pwSystem['anonyhide']; $rewids = $cyids = array(); $arrStatus = array(1 => 'vote', 2 => 'active', 3 => 'reward', 4 => 'trade', 5 => 'debate'); foreach ($tpcdb as $key => $thread) { $foruminfo['allowhtm'] == 1 && ($htmurl = $db_readdir . '/' . $fid . '/' . date('ym', $thread['postdate']) . '/' . $thread['tid'] . '.html'); $thread['tpcurl'] = "read.php?tid={$thread['tid']}" . ($page > 1 ? "&fpage={$page}" : ''); if ($managemode == 1) { $thread['tpcurl'] .= '&toread=1';
function analyseDataToCache($tpcdb) { global $db_ifpwcache, $timestamp; if (!($db_ifpwcache & 112) || pwFilemtime(D_P . 'data/bbscache/hitsort_judge.php') > $timestamp - 600) { return; } extract(pwCache::getData(D_P . 'data/bbscache/hitsort_judge.php', false)); $updatelist = $updatetype = array(); foreach ($tpcdb as $thread) { if ($db_ifpwcache & 16) { if ($thread['hits'] > $hitsort_judge['hitsort'][$this->fid] && $thread['fid'] == $this->fid) { $updatelist[] = array('hitsort', $this->fid, $thread['tid'], $thread['hits'], '', 0); $updatetype['hitsort'] = 1; } } if ($db_ifpwcache & 32 && $thread['postdate'] > $timestamp - 24 * 3600) { if ($thread['hits'] > $hitsort_judge['hitsortday'][$this->fid] && $thread['fid'] == $this->fid) { $updatelist[] = array('hitsortday', $this->fid, $thread['tid'], $thread['hits'], $thread['postdate'], 0); $updatetype['hitsortday'] = 1; } } if ($db_ifpwcache & 64 && $thread['postdate'] > $timestamp - 7 * 24 * 3600) { if ($thread['hits'] > $hitsort_judge['hitsortweek'][$this->fid] && $thread['fid'] == $this->fid) { $updatelist[] = array('hitsortweek', $this->fid, $thread['tid'], $thread['hits'], $thread['postdate'], 0); $updatetype['hitsortweek'] = 1; } } } if ($updatelist) { L::loadClass('elementupdate', '', false); $elementupdate = new ElementUpdate($this->fid); $elementupdate->setJudge('hitsort', $hitsort_judge); $elementupdate->setUpdateList($updatelist); $elementupdate->setUpdateType($updatetype); $elementupdate->updateSQL(); unset($elementupdate); } }