} */ if (!empty($_G['uid']) && empty($category_usergroup['allowpost'])) { showmessage(lang('category/template', 'house_class_nothing')); } if ($category_usergroup['postdayper'] && $_G['category_member']['todaythreads'] >= $category_usergroup['postdayper']) { showmessage(lang('category/template', 'house_post_thread_max')); } require_once libfile('function/category'); $actionarray = array('newthread', 'edit', 'nav'); $action = in_array($_G['gp_action'], $actionarray) ? $_G['gp_action'] : ''; $sortarray = $cityarray = $districtarray = $streetarray = array(); $cityid = intval($_G['gp_cityid']); $districtid = intval($_G['gp_districtid']); $streetid = intval($_G['gp_streetid']); $avatar = category_uc_avatar($_G['uid']); $usergrouplist[$usergroupid]['icon'] = $usergrouplist[$usergroupid]['icon'] ? $_G['setting']['attachurl'] . 'common/' . $usergrouplist[$usergroupid]['icon'] : ''; $usergrouplist[$usergroupid]['postdayper'] = $usergrouplist[$usergroupid]['postdayper'] ? intval($usergrouplist[$usergroupid]['postdayper']) : ''; $_G['category_member']['todaythreads'] = intval($_G['category_member']['todaythreads']); $subject = isset($_G['gp_subject']) ? dhtmlspecialchars(censor(trim($_G['gp_subject']))) : ''; $subject = !empty($subject) ? str_replace("\t", ' ', $subject) : $subject; $message = isset($_G['gp_message']) ? censor(trim($_G['gp_message'])) : ''; if ($action == 'nav') { foreach ($sortlist as $id => $sort) { $sortarray[$id] = $sort['name']; } foreach ($arealist['district'][$cityid] as $aid => $area) { $districtarray[$aid]['title'] = $area; } if (!empty($districtid) && $arealist['street'][$districtid]) { foreach ($arealist['street'][$districtid] as $aid => $area) {
} if ($sortdata['recommend']) { $recommend = DB::fetch_first("SELECT expiration FROM " . DB::table('category_threadmod') . " WHERE tid='{$tid}' AND action='recommend' ORDER BY expiration DESC LIMIT 1"); if (TIMESTAMP > $recommend['expiration'] && !empty($recommend['expiration'])) { DB::query("UPDATE " . DB::table('category_sortvalue') . "{$sortid} SET recommend='0' WHERE tid='{$tid}'", 'UNBUFFERED'); } } } $navigation = "› <a href=\"{$modurl}?mod=list&cid={$cid}&sortid={$sortid}\">" . $sortlist[$sortid]['name'] . "</a> "; $navigation .= $arealist['city'][$cityid] ? "› <a href=\"{$modurl}?mod=list&cid={$cid}&sortid={$sortid}&filter=all&city={$cityid}\">" . $arealist['city'][$cityid] . "</a> " : ''; $navigation .= $arealist['district'][$cityid][$districtid] ? "› <a href=\"{$modurl}?mod=list&cid={$cid}&sortid={$sortid}&filter=all&city={$cityid}&district={$districtid}\">" . $arealist['district'][$cityid][$districtid] . "</a> " : ''; $navigation .= $arealist['street'][$districtid][$streetid] ? "› <a href=\"{$modurl}?mod=list&cid={$cid}&sortid={$sortid}&filter=all&city={$cityid}&district={$districtid}&street={$streetid}\">" . $arealist['street'][$districtid][$streetid] . "</a> " : ''; $navtitle = $arealist['city'][$cityid] . $arealist['district'][$cityid][$districtid] . $arealist['street'][$districtid][$streetid] . $thread['subject'] . ' - ' . $sortlist[$sortid]['name'] . ' - '; require_once libfile('function/category'); $threadsortshow = threadsortshow($thread['tid'], $sortoptionarray, $templatearray, $thread['authorid'], $sortdata['groupid']); $thread['avatar'] = category_uc_avatar($thread['authorid']); $thread['dateline'] = dgmdate($sortdata['dateline'], 'd'); $thread['message'] = nl2br(dhtmlspecialchars($thread['message'])); $groupid = $sortdata['groupid']; if ($usergrouplist[$groupid]['type'] == 'intermediary') { $usergrouptitle = $usergrouplist[$groupid]['title'] ? "<a href=\"{$modurl}?mod=usergroup&gid={$groupid}&cid={$cid}&sortid={$sortid}\">" . $usergrouplist[$groupid]['title'] . "</a>" : ''; $usergroupicon = $usergrouplist[$groupid]['icon'] ? "<a href=\"{$modurl}?mod=usergroup&gid={$groupid}&cid={$cid}&sortid={$sortid}\"><img src=\"" . $_G['setting']['attachurl'] . 'common/' . $usergrouplist[$groupid]['icon'] . "\"></a>" : ''; } else { $usergrouptitle = $usergrouplist[$groupid]['title'] ? $usergrouplist[$groupid]['title'] : ''; $usergroupicon = $usergrouplist[$groupid]['icon'] ? "<img src=\"" . $_G['setting']['attachurl'] . 'common/' . $usergrouplist[$groupid]['icon'] . "\">" : ''; } visitedsetcookie($thread['tid']); $neighborhoodlist = neighborhood($thread['tid'], $sortid, $cityid, $districtid, $streetid, $sortoptionarray, $ntemplatearray, $modurl); $piclist = array(); if ($sortdata['attachid']) { $query = DB::query("SELECT url FROM " . DB::table('category_' . $modidentifier . '_pic') . " WHERE tid='{$thread['tid']}' ORDER BY dateline");
foreach ($districtarray as $did => $district) { $districtlist[$did] = $district; } } } require_once libfile('function/category'); $_G['category_threadlist'] = $threadids = $memberlist = array(); $isgroupadmin = 0; if (!empty($gid)) { $usergroup = DB::fetch_first("SELECT * FROM " . DB::table('category_' . $modidentifier . '_usergroup') . " WHERE gid='{$gid}'"); $usergroup['banner'] = $usergroup['banner'] ? get_logoimg($usergroup['banner']) : ''; $navtitle = $usergroup['title'] . ' - '; $query = DB::query("SELECT cm.threads, m.uid, m.username FROM " . DB::table('category_' . $modidentifier . '_member') . " cm\n\t\t\tLEFT JOIN " . DB::table('common_member') . " m ON cm.uid=m.uid\n\t\t\tWHERE cm.groupid='{$gid}' ORDER BY cm.threads DESC LIMIT 5"); while ($member = DB::fetch($query)) { $memberlist[$member['uid']]['username'] = $member['username']; $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']);
exit('Access Denied'); } $uid = !empty($_G['gp_uid']) ? intval($_G['gp_uid']) : $_G['uid']; if (empty($sortid)) { showmessage(lang('category/template', 'house_lack_args')); } $isgroupadmin = $_G['uid'] == $uid ? 1 : 0; $usergroup = $category_usergroup; $member = DB::fetch_first("SELECT cm.threads, cm.groupid, m.uid, m.username FROM " . DB::table('category_' . $modidentifier . '_member') . " cm\n\tLEFT JOIN " . DB::table('common_member') . " m ON cm.uid=m.uid WHERE cm.uid='{$uid}'"); if (empty($member['uid'])) { showmessage(lang('category/template', 'house_class_nothing')); } require_once libfile('function/category'); $usergroupid = $member['groupid']; $username = $member['username']; $avatar = category_uc_avatar($member['uid']); $usergrouplist[$usergroupid]['icon'] = $usergrouplist[$usergroupid]['icon'] ? $_G['setting']['attachurl'] . 'common/' . $usergrouplist[$usergroupid]['icon'] : ''; $usergrouplist[$usergroupid]['postdayper'] = $usergrouplist[$usergroupid]['postdayper'] ? intval($usergrouplist[$usergroupid]['postdayper']) : ''; $_G['category_member']['todaythreads'] = intval($_G['category_member']['todaythreads']); loadcache(array('category_option_' . $sortid, 'category_template_' . $sortid)); $sortoptionarray = $_G['cache']['category_option_' . $sortid]; $templatearray = $_G['cache']['category_template_' . $sortid]['subject']; $_G['category_threadlist'] = $threadids = array(); $page = $_G['page']; $start_limit = ($page - 1) * $_G['tpp']; $colorarray = array('', '#EE1B2E', '#EE5023', '#996600', '#3C9D40', '#2897C5', '#2B65B7', '#8F2A90', '#EC1282'); $_G['category_threadcount'] = DB::result_first("SELECT COUNT(*) FROM " . DB::table('category_' . $modidentifier . '_thread') . " WHERE sortid='{$sortid}' AND authorid='{$uid}'"); $multipage = multi($_G['category_threadcount'], $_G['tpp'], $page, "{$modurl}?mod=my&sortid={$sortid}&uid={$uid}"); $query = DB::query("SELECT t.*, ts.* FROM " . DB::table('category_' . $modidentifier . '_thread') . " t\n\tLEFT JOIN " . DB::table('category_sortvalue') . "{$sortid} ts ON t.tid=ts.tid\n\tWHERE sortid='{$sortid}' AND authorid='{$uid}' ORDER BY ts.dateline DESC LIMIT {$start_limit}, {$_G['tpp']}"); while ($thread = DB::fetch($query)) { if ($thread['highlight']) {