fetch_all_by_status(0, 0); if(empty($forumlist)) { $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_forumstatus_no_need')); } else { $fids = array(); foreach($forumlist as $forum) { $fids[] = $forum['fid']; } $forumfieldlist = C::t('forum_forumfield')->fetch_all_by_fid($fids); $forumdesc = ''; $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; $k = 1; foreach($forumlist as $forum) { if(!$forumfieldlist[$forum['fid']]['password'] || !$forumfieldlist[$forum['fid']]['formulaperm']) { $forumdesc .= '

2 ? 'style="display:none;"' : '').'>'.$forum['name'].'

'; } if($k == 3) { $forumdesc .= '

'.lang('admincp', 'more').'

'; } $k++; } $extraurl = ''; if(count($forumlist) == 1) { $extraurl = '&optimizefid='.$forum['fid']; $forumdesc = ''; } if(!$forumdesc) { $return = array('status' => 0, 'type' =>'none', 'lang' => lang('optimizer', 'optimizer_forumstatus_no_need')); } else { $return = array('status' => 1, 'type' =>'view', 'lang' => lang('optimizer', 'optimizer_forumstatus_need', array('forumdesc' => $forumdesc)), 'extraurl' => $extraurl); } } return $return; } public function optimizer() { $adminfile = defined(ADMINSCRIPT) ? ADMINSCRIPT : 'admin.php'; if($_GET['optimizefid']) { $url = '?action=forums&operation=edit&fid='.dintval($_GET['optimizefid']); } else { $url = '?action=forums'; } dheader('Location: '.$_G['siteurl'].$adminfile.$url); } } ?>