check_patch(); $discuz_patch = new discuz_patch(); $patchnum = 0; $patchnotice = $discuz_patch->fetch_patch_notice(); if($patchnotice['data']) { foreach($patchnotice['data'] as $patch) { if($patch['status'] <= 0) { $patchnum++; } } } if($patchnum) { $return = array('status' => 1, 'type' =>'header', 'lang' => lang('optimizer', 'optimizer_patch_have', array('patchnum' => $patchnum))); } else { $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_patch_check_safe')); } return $return; } public function optimizer() { $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; dheader('Location: '.$_G['siteurl'].$adminfile.'?action=patch'); } } ?>