EOT; showtagheader('div', 'searchposts', !$searchsubmit && empty($newlist)); showformheader("pic".(!empty($_GET['search']) ? '&search=true' : ''), '', 'picforum'); showhiddenfields(array('page' => $page, 'pp' => $_GET['pp'] ? $_GET['pp'] : $_GET['perpage'])); showtableheader(); showsetting('pic_search_detail', 'detail', $detail, 'radio'); showsetting('pic_search_perpage', '', $_GET['perpage'], ""); showsetting('resultsort', '', $orderby, " "); showsetting('', '', $ordersc, "", '', 0, '', '', '', true); showsetting('pic_search_albumid', 'albumid', $albumid, 'text'); showsetting('pic_search_user', 'users', $users, 'text'); showsetting('pic_search_picid', 'picid', $picid, 'text'); showsetting('pic_search_title', 'title', $title, 'text'); showsetting('pic_search_ip', 'postip', $postip, 'text'); showsetting('pic_search_hot', array('hot1', 'hot2'), array('', ''), 'range'); showsetting('pic_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); echo ''; showsubmit('searchsubmit'); showtablefooter(); showformfooter(); showtagfooter('div'); } else { $picids = authcode($picids, 'DECODE'); $picidsadd = $picids ? explode(',', $picids) : $_GET['delete']; include_once libfile('function/delete'); $deletecount = count(deletepics($picidsadd)); $cpmsg = cplang('pic_succeed', array('deletecount' => $deletecount)); ?> '); } if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-n-j')) { if($endtime != '') { $endtime = strtotime($endtime); $sql .= ' AND p.'.DB::field('dateline', $endtime, '<'); } } else { $endtime = TIMESTAMP; } if($picid !='') { $picids = '-1'; $picidsarr = array('-1'); $query = C::t('home_pic')->fetch_all(explode(',', str_replace(' ', '', $picid))); foreach($query as $arr) { $picids .=",$arr[picid]"; $picidsarr[] = $arr['picid']; } $sql .= ' AND p.'.DB::field('picid', $picidsarr); } if($albumid !='') { $albumids = '-1'; $albumidsarr = array('-1'); $query = C::t('home_album')->fetch_all(explode(',', $albumid)); foreach($query as $arr) { $albumids .=",$arr[albumid]"; $albumidsarr[] = $arr['albumid']; } $sql .= ' AND p.'.DB::field('albumid', $albumidsarr); } if($users != '') { $uids = '-1'; $uidsarr = array('-1'); $query = C::t('home_album')->fetch_uid_by_username(explode(',', $users)); foreach($query as $arr) { $uids .= ",$arr[uid]"; $uidsarr[] = $arr['uid']; } $sql .= ' AND p.'.DB::field('uid', $uidsarr); } if($postip != '') { $sql .= ' AND p.'.DB::field('postip', str_replace('*', '%', $postip), 'like'); } $sql .= $hot1 ? ' AND p.'.DB::field('hot', $hot1, '>=') : ''; $sql .= $hot2 ? ' AND p.'.DB::field('hot', $hot2, '<=') : ''; $sql .= $title ? ' AND p.'.DB::field('title', '%'.$title.'%', 'like') : ''; $orderby = $orderby ? $orderby : 'dateline'; $ordersc = $ordersc ? "$ordersc" : 'DESC'; if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8)) { $error = 'pic_mod_range_illegal'; } if(!$error) { if($detail) { $_GET['perpage'] = intval($_GET['perpage']) < 1 ? 20 : intval($_GET['perpage']); $perpage = $_GET['pp'] ? $_GET['pp'] : $_GET['perpage']; $query = C::t('home_pic')->fetch_all_by_sql('1 '.$sql, 'p.'.DB::order($orderby, $ordersc), (($page - 1) * $perpage), $perpage); $pics = ''; include_once libfile('function/home'); foreach($query as $pic) { $pic['dateline'] = dgmdate($pic['dateline']); $pic['pic'] = pic_get($pic['filepath'], 'album', $pic['thumb'], $pic['remote']); $pic['albumname'] = empty($pic['albumname']) && empty($pic['albumid']) ? $lang['album_default'] : $pic['albumname']; $pic['albumid'] = empty($pic['albumid']) ? -1 : $pic['albumid']; $pics .= showtablerow('', '', array( "", "", $pic['size'], "$pic[albumname]", "".$pic['username']."", $pic['dateline'], "".$lang['pic_comment']."" ), TRUE); } $piccount = C::t('home_pic')->fetch_all_by_sql('1 '.$sql, '', 0, 0, 1); $multi = multi($piccount, $perpage, $page, ADMINSCRIPT."?action=pic$muticondition"); } else { $piccount = 0; $query = C::t('home_pic')->fetch_all_by_sql('1 '.$sql, '', 0, 0, 0, 0); foreach($query as $pic) { $picids .= ','.$pic['picid']; $piccount++; } $multi = ''; } if(!$piccount) { $error = 'pic_post_nonexistence'; } } showtagheader('div', 'postlist', $searchsubmit || $newlist); showformheader('pic&frame=no', 'target="picframe"'); showhiddenfields(array('picids' => authcode($picids, 'ENCODE'))); if(!$muticondition) { showtableheader(cplang('pic_new_result').' '.$piccount, 'fixpadding'); } else { showtableheader(cplang('pic_result').' '.$piccount.(empty($newlist) ? ' '.cplang('research').'' : ''), 'fixpadding'); } if($error) { echo "