EOT; showtagheader('div', 'searchposts', !$searchsubmit && empty($newlist)); showformheader("blog".(!empty($_GET['search']) ? '&search=true' : ''), '', 'blogforum'); showhiddenfields(array('page' => $page, 'pp' => $_GET['pp'] ? $_GET['pp'] : $_GET['perpage'])); showtableheader(); showsetting('blog_search_detail', 'detail', $detail, 'radio'); showsetting('blog_search_perpage', '', $_GET['perpage'], ""); showsetting('resultsort', '', $orderby, " "); showsetting('', '', $ordersc, "", '', 0, '', '', '', true); showsetting('blog_search_uid', 'uid', $uid, 'text'); showsetting('blog_search_blogid', 'blogid', $blogid, 'text'); showsetting('blog_search_user', 'users', $users, 'text'); showsetting('blog_search_keyword', 'keywords', $keywords, 'text'); showsetting('blog_search_friend', '', $friend, ""); showsetting('blog_search_ip', 'ip', $ip, 'text'); showsetting('blog_search_lengthlimit', 'lengthlimit', $lengthlimit, 'text'); showsetting('blog_search_view', array('viewnum1', 'viewnum2'), array('', ''), 'range'); showsetting('blog_search_reply', array('replynum1', 'replynum2'), array('', ''), 'range'); showsetting('blog_search_hot', array('hot1', 'hot2'), array('', ''), 'range'); showsetting('blog_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); echo ''; showsubmit('searchsubmit'); showtablefooter(); showformfooter(); showtagfooter('div'); } else { if($_GET['blogids']) { $blogids = authcode($_GET['blogids'], 'DECODE'); $blogidsadd = $blogids ? explode(',', $blogids) : $_GET['delete']; include_once libfile('function/delete'); $deletecount = count(deleteblogs($blogidsadd)); $cpmsg = cplang('blog_succeed', array('deletecount' => $deletecount)); } else { $blogs = $catids = array(); $selectblogids = !empty($_GET['ids']) && is_array($_GET['ids']) ? $_GET['ids'] : array(); if($selectblogids) { $query = C::t('home_blog')->fetch_all($selectblogids); foreach($query as $value) { $blogs[$value['blogid']] = $value; $catids[] = intval($value['catid']); } } if($blogs) { $selectblogids = array_keys($blogs); if($_POST['optype'] == 'delete') { include_once libfile('function/delete'); $deletecount = count(deleteblogs($selectblogids)); $cpmsg = cplang('blog_succeed', array('deletecount' => $deletecount)); } elseif($_POST['optype'] == 'move') { $tocatid = intval($_POST['tocatid']); $catids[] = $tocatid; $catids = array_merge($catids); C::t('home_blog')->update($selectblogids, array('catid'=>$tocatid)); foreach($catids as $catid) { $catid = intval($catid); $cnt = C::t('home_blog')->count_by_catid($catid); C::t('home_blog_category')->update($catid, array('num'=>$cnt)); } $cpmsg = cplang('blog_move_succeed'); } else { $cpmsg = cplang('blog_choose_at_least_one_operation'); } } else { $cpmsg = cplang('blog_choose_at_least_one_blog'); } } ?> fetch_all_uid_by_username(array_map('trim', explode(',', $users))); if(!$uids) { $uids = array(-1); } } $uid = trim($uid, ', '); if($uid != '') { $uid = explode(',', $uid); if($uids && $uids[0] != -1) { $uids = array_intersect($uids, $uid); } else { $uids = $uid; } if(!$uids) { $uids = array(-1); } } if($starttime != '') { $starttime = strtotime($starttime); } if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-n-j')) { if($endtime != '') { $endtime = strtotime($endtime); } } else { $endtime = TIMESTAMP; } if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8)) { $error = 'blog_mod_range_illegal'; } if(!$error) { if($detail) { $pagetmp = $page; $_GET['perpage'] = intval($_GET['perpage']) < 1 ? 20 : intval($_GET['perpage']); $perpage = $_GET['pp'] ? $_GET['pp'] : $_GET['perpage']; do{ $query = C::t('home_blog')->fetch_all_by_search(1, $blogid, $uids, $starttime, $endtime, $hot1, $hot2, $viewnum1, $viewnum2, $replynum1, $replynum2, $friend, $ip, $keywords, $lengthlimit, $orderby, $ordersc, (($pagetmp - 1) * $perpage), $perpage, null, null, null, null, false, array(0, 1)); $pagetmp--; } while(!count($query) && $pagetmp); $blogs = ''; foreach($query as $blog) { $blog['dateline'] = dgmdate($blog['dateline']); $blog['subject'] = cutstr($blog['subject'], 30); switch ($blog['friend']) { case '0': $privacy_name = $lang[setting_home_privacy_alluser]; break; case '1': $privacy_name = $lang[setting_home_privacy_friend]; break; case '2': $privacy_name = $lang[setting_home_privacy_specified_friend]; break; case '3': $privacy_name = $lang[setting_home_privacy_self]; break; case '4': $privacy_name = $lang[setting_home_privacy_password]; break; default: $privacy_name = $lang[setting_home_privacy_alluser]; } $blog['friend'] = $blog['friend'] ? " $privacy_name" : $privacy_name; $blogs .= showtablerow('', '', array( "", $blog['blogid'], "$blog[username]", "$blog[subject]", $blog['viewnum'], $blog['replynum'], $blog['hot'], $blog['dateline'], $blog['friend'] ), TRUE); } $blogcount = C::t('home_blog')->count_all_by_search($blogid, $uids, $starttime, $endtime, $hot1, $hot2, $viewnum1, $viewnum2, $replynum1, $replynum2, $friend, $ip, $keywords, $lengthlimit, null, null, null, false, array(0, 1)); $multi = multi($blogcount, $perpage, $page, ADMINSCRIPT."?action=blog".($perpage ? '&perpage='.$perpage : '').$muticondition); } else { $blogcount = 0; $query = C::t('home_blog')->fetch_all_by_search(2, $blogid, $uids, $starttime, $endtime, $hot1, $hot2, $viewnum1, $viewnum2, $replynum1, $replynum2, $friend, $ip, $keywords, $lengthlimit, null, null, 0, 0, null, null, null, null, false, array(0, 1)); foreach($query as $blog) { $blogids .= ','.$blog['blogid']; $blogcount++; } $multi = ''; } if(!$blogcount) { $error = 'blog_post_nonexistence'; } } showtagheader('div', 'postlist', $searchsubmit || $newlist); showformheader('blog&frame=no', 'target="blogframe"'); if(!$muticondition) { showtableheader(cplang('blog_new_result').' '.$blogcount, 'fixpadding'); } else { showtableheader(cplang('blog_result').' '.$blogcount.(empty($newlist) ? ' '.cplang('research').'' : ''), 'fixpadding'); } if($error) { echo "$lang[$error]"; } else { if($detail) { showsubtitle(array('', 'blogid', 'author', 'subject', 'view', 'reply', 'hot', 'time', 'privacy')); echo $blogs; $optypehtml = '' .'  ' ; $optypehtml .= ' ' .category_showselect('blog', 'tocatid', false) .'  '; showsubmit('', '', '', '  '.$optypehtml.'', $multi); } else { showhiddenfields(array('blogids' => authcode($blogids, 'ENCODE'))); showsubmit('blogsubmit', 'delete', $detail ? 'del' : '', '', $multi); } } showtablefooter(); showformfooter(); echo ''; showtagfooter('div'); } ?>