EOT; showtagheader('div', 'searchposts', !$searchsubmit && empty($newlist)); showformheader("share".(!empty($_GET['search']) ? '&search=true' : ''), '', 'shareforum'); showhiddenfields(array('page' => $page, 'pp' => $_GET['pp'] ? $_GET['pp'] : $_GET['perpage'])); showtableheader(); showsetting('share_search_detail', 'detail', $detail, 'radio'); showsetting('share_search_perpage', '', $_GET['perpage'], ""); $selected[$type] = $type ? 'selected="selected"' : ''; showsetting('share_search_icon', '', $type, ""); showsetting('share_search_uid', 'uid', $uid, 'text'); showsetting('share_search_user', 'users', $users, 'text'); showsetting('share_search_sid', 'sid', $sid, 'text'); showsetting('share_search_hot', array('hot1', 'hot2'), array('', ''), 'range'); showsetting('share_search_time', array('starttime', 'endtime'), array($starttime, $endtime), 'daterange'); echo ''; showsubmit('searchsubmit'); showtablefooter(); showformfooter(); showtagfooter('div'); } else { $sids = authcode($sids, 'DECODE'); $sidsadd = $sids ? explode(',', $sids) : $_GET['delete']; include_once libfile('function/delete'); $deletecount = count(deleteshares($sidsadd)); $cpmsg = cplang('share_succeed', array('deletecount' => $deletecount)); ?> fetch_all_by_username(explode(',', str_replace(' ', '', $users))) as $arr) { $uids[$arr['uid']] = $arr['uid']; } if(!$uids) { $uids = array(-1); } $sql .= " AND s.uid IN ($uids)"; } if($type != '') { $arr = C::t('home_share')->fetch_by_type($type); $type = $arr['type']; } if($starttime != '') { $starttime = strtotime($starttime); $sql .= " AND s.dateline>'$starttime'"; } if($_G['adminid'] == 1 && $endtime != dgmdate(TIMESTAMP, 'Y-n-j')) { if($endtime != '') { $endtime = strtotime($endtime); $sql .= " AND s.dateline<'$endtime'"; } } else { $endtime = TIMESTAMP; } if($sid != '') { $sids = array(); foreach(C::t('home_share')->fetch_all(explode(',', str_replace(' ', '', $sid))) as $fidarr) { $sids[] = $fidarr['sid']; } if(!$sids) { $sids = array(-1); } $sql .= " AND s.sid IN ($sids)"; } if($uid != '') { $uidtmp = array(); foreach(C::t('home_share')->fetch_all_by_uid(explode(',', str_replace(' ', '', $uid))) as $uidarr) { $uidtmp[$uidarr['uid']] = $uidarr['uid']; } if($uids && $uids[0] != -1) { $uids = array_intersect($uids, $uidtmp); } else { $uids = $uidtmp; } if(!$uids) { $uids = array(-1); } } $sql .= $hot1 ? " AND s.hot >= '$hot1'" : ''; $sql .= $hot2 ? " AND s.hot <= '$hot2'" : ''; if(($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16) || ($_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8)) { $error = 'share_mod_range_illegal'; } if(!$error) { if($detail) { $_GET['perpage'] = intval($_GET['perpage']) < 1 ? 20 : intval($_GET['perpage']); $perpage = $_GET['pp'] ? $_GET['pp'] : $_GET['perpage']; $sharecount = C::t('home_share')->count_by_search($sids, $uids, $type, $starttime, $endtime, $hot1, $hot2); if($sharecount) { $shares = ''; require_once libfile('function/share'); $start = ($page - 1) * $perpage; foreach(C::t('home_share')->fetch_all_search($sids, $uids, $type, $starttime, $endtime, $hot1, $hot2, $start, $perpage) as $share) { $share['dateline'] = dgmdate($share['dateline']); $share = mkshare($share); $shares .= showtablerow('', array('', 'style="width:80px;"', 'style="width:150px;"', 'style="width:500px;"'), array( "", "".$share['username']."", $share['title_template'], $share['body_template'], $share['dateline'] ), TRUE); } $multi = multi($sharecount, $perpage, $page, ADMINSCRIPT."?action=share"); $multi = preg_replace("/href=\"".ADMINSCRIPT."\?action=share&page=(\d+)\"/", "href=\"javascript:page(\\1)\"", $multi); $multi = str_replace("window.location='".ADMINSCRIPT."?action=share&page='+this.value", "page(this.value)", $multi); } } else { $sharecount = 0; foreach(C::t('home_share')->fetch_all_search($sids, $uids, $type, $starttime, $endtime, $hot1, $hot2) as $share) { $sids .= ','.$share['sid']; $sharecount++; } $multi = ''; } if(!$sharecount) { $error = 'share_post_nonexistence'; } } showtagheader('div', 'postlist', $searchsubmit || $newlist); showformheader('share&frame=no', 'target="shareframe"'); showhiddenfields(array('sids' => authcode($sids, 'ENCODE'))); showtableheader(cplang('share_result').' '.$sharecount.(empty($newlist) ? ' '.cplang('research').'' : ''), 'fixpadding'); if($error) { echo "$lang[$error]"; } else { if($detail) { showsubtitle(array('', 'author', 'share_title', 'share_body', 'time')); echo $shares; } } showsubmit('sharesubmit', 'delete', $detail ? 'del' : '', '', $multi); showtablefooter(); showformfooter(); echo ''; showtagfooter('div'); } ?>