EOT; showtagheader('div', 'searchposts', !$searchsubmit && empty($newlist)); showformheader("album".(!empty($_GET['search']) ? '&search=true' : ''), '', 'albumforum'); showhiddenfields(array('page' => $page, 'pp' => $_GET['pp'] ? $_GET['pp'] : $_GET['perpage'])); showtableheader(); showsetting('album_search_detail', 'detail', $detail, 'radio'); showsetting('album_search_perpage', '', $_GET['perpage'], ""); showsetting('resultsort', '', $orderby, " "); showsetting('', '', $ordersc, "", '', 0, '', '', '', true); showsetting('album_search_albumname', 'albumname', $albumname, 'text'); showsetting('album_search_albumid', 'albumid', $albumid, 'text'); showsetting('album_search_uid', 'uid', $uid, 'text'); showsetting('album_search_user', 'users', $users, 'text'); showsetting('blog_search_friend', '', $friend, ""); showsetting('album_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); echo ''; showsubmit('searchsubmit'); showtablefooter(); showformfooter(); showtagfooter('div'); } else { if($_GET['albumids']) { $albumids = authcode($_GET['albumids'], 'DECODE'); $albumidsadd = $albumids ? explode(',', $albumids) : $_GET['delete']; include_once libfile('function/delete'); $deletecount = count(deletealbums($albumidsadd)); $cpmsg = cplang('album_succeed', array('deletecount' => $deletecount)); } else { $albums = $catids = array(); $selectalbumids = !empty($_GET['ids']) && is_array($_GET['ids']) ? $_GET['ids'] : array(); if($selectalbumids) { $query = C::t('home_album')->fetch_all($selectalbumids); foreach($query as $value) { $albums[$value['albumid']] = $value; $catids[] = intval($value['catid']); } } if($albums) { $selectalbumids = array_keys($albums); if($_POST['optype'] == 'delete') { include_once libfile('function/delete'); $deletecount = count(deletealbums($selectalbumids)); $cpmsg = cplang('album_succeed', array('deletecount' => $deletecount)); } elseif($_POST['optype'] == 'move') { $tocatid = intval($_POST['tocatid']); $catids[] = $tocatid; $catids = array_merge($catids); C::t('home_album')->update($selectalbumids, array('catid'=>$tocatid)); foreach($catids as $catid) { $catid = intval($catid); $cnt = C::t('home_album')->count_by_catid($catid); C::t('home_album_category')->update($catid, array('num'=>intval($cnt))); } $cpmsg = cplang('album_move_succeed'); } else { $cpmsg = cplang('album_choose_at_least_one_operation'); } } else { $cpmsg = cplang('album_choose_at_least_one_album'); } } ?> fetch_uid_by_username(explode(',', $users)); $uids = array_keys($query) + $uids; } if($starttime != '') { $starttime = strtotime($starttime); } if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-n-j')) { if($endtime != '') { $endtime = strtotime($endtime); } } else { $endtime = TIMESTAMP; } if($albumid != '') { $albumids = explode(',', $albumid); } if($uid != '') { $query = C::t('home_album')->fetch_uid_by_uid($uid); if(!$uids) { $uids = array_keys($query); } else { $uids = array_intersect(array_keys($query), $uids); } if(!$uids) { $uids = array(-1); } } $orderby = $orderby ? $orderby : 'updatetime'; $ordersc = $ordersc ? $ordersc : 'DESC'; if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8)) { $error = 'album_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_album')->fetch_all_by_search(1, $uids, $albumname, false, '', $starttime, $endtime, $albumids, $friend, $orderby, $ordersc, (($page - 1) * $perpage), $perpage); $albums = ''; include_once libfile('function/home'); foreach($query as $album) { if($album['friend'] != 4 && ckfriend($album['uid'], $album['friend'], $album['target_ids'])) { $album['pic'] = pic_cover_get($album['pic'], $album['picflag']); } else { $album['pic'] = STATICURL.'image/common/nopublish.gif'; } $album['updatetime'] = dgmdate($album['updatetime']); switch ($album['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]; } $album['friend'] = $album['friend'] ? " $privacy_name" : $privacy_name; $albums .= showtablerow('', '', array( "", "", "$album[albumname]", "".$album['username']."", $album['updatetime'],"".$album['picnum']."", $album['friend'] ), TRUE); } $albumcount = C::t('home_album')->fetch_all_by_search(3, $uids, $albumname, false, '', $starttime, $endtime, $albumids, $friend); $multi = multi($albumcount, $perpage, $page, ADMINSCRIPT."?action=album$muticondition"); } else { $albumcount = 0; $query = C::t('home_album')->fetch_all_by_search(2, $uids, $albumname, false, '', $starttime, $endtime, $albumids, $friend); foreach($query as $album) { $albumids .= ','.$album['albumid']; $albumcount++; } $multi = ''; } if(!$albumcount) { $error = 'album_post_nonexistence'; } } showtagheader('div', 'postlist', $searchsubmit || $newlist); showformheader('album&frame=no', 'target="albumframe"'); if(!$muticondition) { showtableheader(cplang('album_new_result').' '.$albumcount, 'fixpadding'); } else { showtableheader(cplang('album_result').' '.$albumcount.(empty($newlist) ? ' '.cplang('research').'' : ''), 'fixpadding'); } if($error) { echo "$lang[$error]"; } else { if($detail) { showsubtitle(array('', 'albumpic', 'albumname', 'author', 'updatetime', 'pic_num', 'privacy')); echo $albums; $optypehtml = '' .'  ' ; $optypehtml .= ' ' .category_showselect('album', 'tocatid', false) .'  '; showsubmit('', '', '', '  '.$optypehtml.'', $multi); } else { showhiddenfields(array('albumids' => authcode($albumids, 'ENCODE'))); showsubmit('albumsubmit', 'delete', $detail ? 'del' : '', '', $multi); } } showtablefooter(); showformfooter(); echo ''; showtagfooter('div'); } ?>