$searchoption = ''; if (is_array($option['value'])) { foreach ($option['value'] as $v) { $v = rawurlencode((string) $v); $searchoption .= "&searchoption[{$optionid}][value][{$v}]={$v}"; } } else { $option['value'] = rawurlencode((string) $option['value']); $option['value'] && ($searchoption = "&searchoption[{$optionid}][value]={$option['value']}"); } $option['type'] = rawurlencode((string) $option['type']); $identifier = $sortoptionarray[$sortid][$optionid]['identifier']; $forumdisplayadd['page'] .= $searchoption ? "{$searchoption}&searchoption[{$optionid}][type]={$option['type']}" : ''; } } $searchsorttids = sortsearch($_GET['sortid'], $sortoptionarray, $_GET['searchoption'], $selectadd, $_G['fid']); $filterarr['intids'] = $searchsorttids ? $searchsorttids : array(0); } if (isset($_GET['searchoption'])) { $_GET['searchoption'] = dhtmlspecialchars($_GET['searchoption']); } if ($_G['forum']['relatedgroup']) { $relatedgroup = explode(',', $_G['forum']['relatedgroup']); $relatedgroup[] = $_G['fid']; $filterarr['inforum'] = $relatedgroup; } else { $filterarr['inforum'] = $_G['fid']; } if (empty($filter) && empty($_GET['sortid']) && empty($_G['forum']['relatedgroup'])) { if ($forumarchive) { if ($_GET['archiveid']) {
$_G['setting']['whosonlinestatus'] = 0; } } if ($_G['forum']['threadsorts']['types'] && $sortoptionarray && ($_G['gp_searchoption'] || $_G['gp_searchsort'])) { $sortid = intval($_G['gp_sortid']); if ($_G['gp_searchoption']) { $forumdisplayadd['page'] = '&sortid=' . $sortid; foreach ($_G['gp_searchoption'] as $optionid => $option) { $optionid = intval($optionid); $option['value'] = rawurlencode((string) $option['value']); $option['type'] = rawurlencode((string) $option['type']); $identifier = $sortoptionarray[$sortid][$optionid]['identifier']; $forumdisplayadd['page'] .= $option['value'] ? "&searchoption[{$optionid}][value]={$option['value']}&searchoption[{$optionid}][type]={$option['type']}" : ''; } } if ($searchsorttids = sortsearch($_G['gp_sortid'], $sortoptionarray, $_G['gp_searchoption'], $selectadd, $_G['fid'])) { $filteradd .= "AND t.tid IN (" . dimplode($searchsorttids) . ")"; } } if (isset($_G['gp_searchoption'])) { $_G['gp_searchoption'] = dhtmlspecialchars($_G['gp_searchoption']); } $fidsql = ''; if ($_G['forum']['relatedgroup']) { $relatedgroup = explode(',', $_G['forum']['relatedgroup']); $relatedgroup[] = $_G['fid']; $fidsql = " t.fid IN(" . dimplode($relatedgroup) . ")"; } else { $fidsql = " t.fid='{$_G['fid']}'"; } if (empty($filter) && empty($_G['gp_sortid']) && empty($_G['gp_archiveid']) && empty($_G['forum']['archive']) && empty($_G['forum']['relatedgroup'])) {
$memberlist[$member['uid']]['avatar'] = category_uc_avatar($member['uid'], 'small'); $memberlist[$member['uid']]['threads'] = $member['threads']; } $isgroupadmin = $_G['uid'] == $usergroup['manageuid'] || $channel['managegid'][$_G['groupid']] ? 1 : 0; if ($action == 'list') { loadcache(array('category_option_' . $sortid, 'category_template_' . $sortid)); $sortoptionarray = $_G['cache']['category_option_' . $sortid]; $templatearray = $_G['cache']['category_template_' . $sortid]['subject']; $rtemplatearray = $_G['cache']['category_template_' . $sortid]['recommend']; $recommendlist = recommendsort($sortid, $sortoptionarray, $gid, $rtemplatearray, $districtlist, $modurl); $page = $_G['page']; $start_limit = ($page - 1) * $_G['tpp']; $sortcondition['orderby'] = 'dateline'; $sortcondition['ascdesc'] = 'DESC'; $selectadd = array('groupid' => $gid); $sortdata = sortsearch($_G['gp_sortid'], $sortoptionarray, $_G['gp_searchoption'], $selectadd, $sortcondition, $start_limit, $_G['tpp']); $tidsadd = $sortdata['tids'] ? "tid IN (" . dimplode($sortdata['tids']) . ")" : ''; $_G['category_threadcount'] = $sortdata['count']; $multipage = multi($_G['category_threadcount'], $_G['tpp'], $page, "{$modurl}?mod=usergroup&action=list&sortid={$sortid}&gid={$gid}&cid={$cid}"); $_G['category_threadlist'] = $sortdata['datalist']; $query = DB::query("SELECT * FROM " . DB::table('category_' . $modidentifier . '_thread') . " " . ($tidsadd ? 'WHERE ' . $tidsadd : '') . ""); while ($thread = DB::fetch($query)) { $_G['category_threadlist'][$thread['tid']]['subject'] .= $thread['subject']; $_G['category_threadlist'][$thread['tid']]['author'] .= $thread['author']; $_G['category_threadlist'][$thread['tid']]['authorid'] .= $thread['authorid']; } $sortlistarray = showsorttemplate($sortid, $sortoptionarray, $templatearray, $_G['category_threadlist'], $threadids, $arealist, $modurl); $stemplate = $sortlistarray['template']; $sortexpiration = $sortlistarray['expiration']; } } else {