Last active
May 16, 2019 05:30
-
-
Save jasonslyvia/9227297 to your computer and use it in GitHub Desktop.
一键清除 Discuz 后台缓存 使用方法:http://undefinedblog.com/2014/02/discuz-disgusts-me/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require './source/class/class_core.php'; | |
require './source/function/function_misc.php'; | |
require './source/function/function_forum.php'; | |
require './source/function/function_admincp.php'; | |
require './source/function/function_cache.php'; | |
$discuz = C::app(); | |
$discuz->init(); | |
$admincp = new discuz_admincp(); | |
$admincp->core = & $discuz; | |
$admincp->init(); | |
$type = explode(',', $_GET['type']); | |
//更新数据缓存 | |
if(in_array(1, $type)) { | |
updatecache(); | |
require_once libfile('function/group'); | |
$groupindex['randgroupdata'] = $randgroupdata = grouplist('lastupdate', array('ff.membernum', 'ff.icon'), 80); | |
$groupindex['topgrouplist'] = $topgrouplist = grouplist('activity', array('f.commoncredits', 'ff.membernum', 'ff.icon'), 10); | |
$groupindex['updateline'] = TIMESTAMP; | |
$groupdata = C::t('forum_forum')->fetch_group_counter(); | |
$groupindex['todayposts'] = $groupdata['todayposts']; | |
$groupindex['groupnum'] = $groupdata['groupnum']; | |
savecache('groupindex', $groupindex); | |
C::t('forum_groupfield')->truncate(); | |
savecache('forum_guide', ''); | |
if($_G['setting']['grid']['showgrid']) { | |
savecache('grids', array()); | |
} | |
echo "数据缓存更新成功<br />"; | |
} | |
//模板缓存 | |
if(in_array(2, $type)) { | |
cleartemplatecache(); | |
echo "模板缓存更新成功<br />"; | |
} | |
//模块缓存 | |
if(in_array(3, $type)) { | |
include_once libfile('function/block'); | |
blockclass_cache(); | |
echo "DIY模块缓存更新成功<br />"; | |
} | |
exit(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment