} else { if ($step == 7) { cache_clear_ad(); tohtml('index'); msg('全部缓存更新成功'); } else { cache_clear('group'); cache_group(); cache_clear('type'); cache_type(); cache_clear('keylink'); cache_keylink(); cache_pay(); cache_banip(); cache_banword(); cache_bancomment(); msg('正在开始更新缓存', '?action=' . $action . '&step=' . ($step + 1)); } } } } } } } break; case 'cacheclear': if ($CFG['cache'] == 'file') { dheader('?action=update'); } $dc->clear(); msg('缓存更新成功');
function ban_update($post) { $this->_add($post[0]); unset($post[0]); foreach ($post as $k => $v) { if (isset($v['delete'])) { $this->_delete($k); unset($post[$k]); } } $this->_edit($post); cache_bancomment(); return true; }
function cache_bancomment($moduleid = 0) { global $db, $MODULE; if ($moduleid) { $data = array(); $result = $db->query("SELECT itemid FROM {$db->pre}comment_ban WHERE moduleid='{$moduleid}' ORDER BY bid DESC "); while ($r = $db->fetch_array($result)) { $data[] = $r['itemid']; } cache_write('bancomment-' . $moduleid . '.php', $data); return $data; } else { foreach ($MODULE as $k => $v) { if ($k < 4 || $v['islink']) { continue; } cache_bancomment($k); } } }