' .''.cplang('show_search').'' .''.cplang('hide_search').'' .''; showsubmenu('topic', array( array('list', 'topic', 1), array('topic_add', 'portal.php?mod=portalcp&ac=topic', 0, 1, 1) ), $searchctrl); if(submitcheck('opsubmit')) { if(empty($_POST['ids'])) { cpmsg('topic_choose_at_least_one_topic', 'action=topic', 'error'); } if($_POST['optype'] == 'delete') { require_once libfile('function/delete'); deleteportaltopic($_POST['ids']); cpmsg('topic_delete_succeed', 'action=topic', 'succeed'); } elseif($_POST['optype'] == 'close') { C::t('portal_topic')->update($_POST['ids'], array('closed' => 1)); cpmsg('topic_close_succeed', 'action=topic', 'succeed'); } elseif($_POST['optype'] == 'open') { C::t('portal_topic')->update($_POST['ids'], array('closed' => 0)); cpmsg('topic_open_succeed', 'action=topic', 'succeed'); } else { cpmsg('topic_choose_at_least_one_optype', 'action=topic', 'error'); } } else { $intkeys = array('topicid', 'uid', 'closed'); $strkeys = array(); $randkeys = array(); $likekeys = array('title', 'username'); $results = getwheres($intkeys, $strkeys, $randkeys, $likekeys); foreach($likekeys as $k) { $_GET[$k] = dhtmlspecialchars($_GET[$k]); } $wherearr = $results['wherearr']; $mpurl = ADMINSCRIPT.'?action=topic'; $mpurl .= '&'.implode('&', $results['urls']); if(strlen($_GET['closed'])) { $statusarr[$_GET['closed']] = ' selected'; } $orders = getorders(array('dateline'), 'topicid'); $ordersql = $orders['sql']; if($orders['urls']) $mpurl .= '&'.implode('&', $orders['urls']); $orderby = array($_GET['orderby']=>' selected'); $ordersc = array($_GET['ordersc']=>' selected'); $perpage = empty($_GET['perpage'])?0:intval($_GET['perpage']); if(!in_array($perpage, array(10,20,50,100))) $perpage = 10; $searchlang = array(); $keys = array('search', 'likesupport', 'resultsort', 'defaultsort', 'orderdesc', 'orderasc', 'perpage_10', 'perpage_20', 'perpage_50', 'perpage_100', 'topic_dateline', 'topic_id', 'topic_title', 'topic_uid', 'topic_username', 'topic_closed', 'nolimit', 'no', 'yes'); foreach ($keys as $key) { $searchlang[$key] = cplang($key); } $adminscript = ADMINSCRIPT; echo << $searchlang[topic_id] $searchlang[topic_title]**$searchlang[likesupport] $searchlang[topic_uid] $searchlang[topic_username]* $searchlang[topic_closed] $searchlang[nolimit] $searchlang[no] $searchlang[yes] $searchlang[resultsort] $searchlang[defaultsort] $searchlang[topic_dateline] $searchlang[orderdesc] $searchlang[orderasc] $searchlang[perpage_10] $searchlang[perpage_20] $searchlang[perpage_50] $searchlang[perpage_100] SEARCH; $start = ($page-1)*$perpage; $mpurl .= '&perpage='.$perpage; $perpages = array($perpage => ' selected'); $maketopichtml = !empty($_G['setting']['makehtml']['flag']) && !empty($_G['setting']['makehtml']['topichtmldir']); $subtitle = array('', 'topic_title', 'topic_domain', 'topic_name', 'topic_creator', 'topic_dateline'); if($maketopichtml) { $subtitle[] = 'HTML'; } $subtitle[] = 'operation'; showformheader('topic'); showtableheader('topic_list'); showsubtitle($subtitle); $multipage = ''; $count = C::t('portal_topic')->count_by_search_where($wherearr); if($count) { require_once libfile('function/portal'); $repairs = array(); foreach(C::t('portal_topic')->fetch_all_by_search_where($wherearr, $ordersql, $start, $perpage) as $topicid => $value) { if($maketopichtml && $value['htmlmade'] && ($htmlname = fetch_topic_url($value)) && !file_exists(DISCUZ_ROOT.'./'.$htmlname)) { $value['htmlmade'] = 0; $repairs[$topicid] = $topicid; } $tablerow = array( "", ($value['htmlmade'] ? "[HTML]" : '') ."".$value[title]."" .($value['closed'] ? ' ['.cplang('topic_closed_yes').']' : ''), $value['domain'] && !empty($_G['setting']['domain']['root']['topic']) ? 'http://'.$value['domain'].'.'.$_G['setting']['domain']['root']['topic'] : '', $value['name'], "$value[username]", dgmdate($value[dateline]), ); if($maketopichtml) { $tablerow[] = "".cplang('setting_functions_makehtml_made') : "red;'>".cplang('setting_functions_makehtml_dismake')).""; } $tablerow[] = ($maketopichtml ? ($maketopichtml && !$value['closed'] ? "".cplang('setting_functions_makehtml_make')."" : cplang('setting_functions_makehtml_make_has_closed')) : '') ." ".cplang('topic_edit')." ". "DIY". ' '.cplang('topic_perm').''; showtablerow('', array('class="td25"', 'class=""', 'class="td28"'), $tablerow); } $multipage = multi($count, $perpage, $page, $mpurl); if($repairs) { C::t('portal_topic')->repair_htmlmade($repairs); } } $ops = cplang('operation').': ' ."".cplang('topic_closed_no')." " ."".cplang('topic_closed_yes')." " ."".cplang('delete')." "; showsubmit('', '', '', ''.cplang('select_all').' '.$ops.'', $multipage); showtablefooter(); showformfooter(); } ?>