', 'action=tools&operation=updatecache&step=2', 'form', '', FALSE);
} elseif($step == 2) {
$type = implode('_', (array)$_GET['type']);
cpmsg(cplang('tools_updatecache_waiting'), "action=tools&operation=updatecache&step=3&type=$type", 'loading', '', FALSE);
} elseif($step == 3) {
$type = explode('_', $_GET['type']);
if(in_array('data', $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());
}
}
if(in_array('tpl', $type) && $_G['config']['output']['tplrefresh']) {
cleartemplatecache();
}
if(in_array('blockclass', $type)) {
include_once libfile('function/block');
blockclass_cache();
}
cpmsg('update_cache_succeed', '', 'succeed', '', FALSE);
}
} elseif($operation == 'fileperms') {
$step = max(1, intval($_GET['step']));
shownav('tools', 'nav_fileperms');
showsubmenusteps('nav_fileperms', array(
array('nav_fileperms_confirm', $step == 1),
array('nav_fileperms_verify', $step == 2),
array('nav_fileperms_completed', $step == 3)
));
if($step == 1) {
cpmsg(cplang('fileperms_check_note'), 'action=tools&operation=fileperms&step=2', 'button', '', FALSE);
} elseif($step == 2) {
cpmsg(cplang('fileperms_check_waiting'), 'action=tools&operation=fileperms&step=3', 'loading', '', FALSE);
} elseif($step == 3) {
showtips('fileperms_tips');
$entryarray = array(
'data',
'data/attachment',
'data/attachment/album',
'data/attachment/category',
'data/attachment/common',
'data/attachment/forum',
'data/attachment/group',
'data/attachment/portal',
'data/attachment/profile',
'data/attachment/swfupload',
'data/attachment/temp',
'data/cache',
'data/log',
'data/template',
'data/threadcache',
'data/diy'
);
$result = '';
foreach($entryarray as $entry) {
$fullentry = DISCUZ_ROOT.'./'.$entry;
if(!is_dir($fullentry) && !file_exists($fullentry)) {
continue;
} else {
if(!dir_writeable($fullentry)) {
$result .= ''.(is_dir($fullentry) ? $lang['dir'] : $lang['file'])." ./$entry $lang[fileperms_unwritable]";
}
}
}
$result = $result ? $result : ''.$lang['fileperms_check_ok'].'';
echo '';
}
}
function jsinsertunit() {
?>