$navigation .= ' <em>›</em> <a href="forum.php?mod=forumdisplay&fid=' . $_G['fid'] . '&archiveid=' . $archiveid . '">' . $t_name . '</a>'; } unset($t_link, $t_name); } $_GET['extra'] = $_GET['extra'] ? rawurlencode($_GET['extra']) : ''; if (@in_array('forum_viewthread', $_G['setting']['rewritestatus'])) { $canonical = rewriteoutput('forum_viewthread', 1, '', $_G['tid'], 1, '', ''); } else { $canonical = 'forum.php?mod=viewthread&tid=' . $_G['tid']; } $_G['setting']['seohead'] .= '<link href="' . $_G['siteurl'] . $canonical . '" rel="canonical" />'; $_G['forum_tagscript'] = ''; $threadsort = $thread['sortid'] && isset($_G['forum']['threadsorts']['types'][$thread['sortid']]) ? 1 : 0; if ($threadsort) { require_once libfile('function/threadsort'); $threadsortshow = threadsortshow($thread['sortid'], $_G['tid']); } if (empty($_G['forum']['allowview'])) { if (!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) { showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); } elseif ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) { showmessagenoperm('viewperm', $_G['fid']); } } elseif ($_G['forum']['allowview'] == -1) { showmessage('forum_access_view_disallow'); } if ($_G['forum']['formulaperm']) { formulaperm($_G['forum']['formulaperm']); } if ($_G['forum']['password'] && $_G['forum']['password'] != $_G['cookie']['fidpw' . $_G['fid']]) { dheader("Location: {$_G['siteurl']}forum.php?mod=forumdisplay&fid={$_G['fid']}");
public function common_reply_oneself_fenlei($tid) { $sortid = C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($tid, null); global $_G; if (!empty($sortid)) { $threadsortshow = threadsortshow($sortid[0]['sortid'], $tid); $fenlei = ""; foreach ($threadsortshow[optionlist] as $k1 => $v1) { if ($v1['type'] == "image") { $fenlei .= $v1['title'] . ":\r\n"; } else { $fenlei .= $v1['title'] . ':' . $v1['value'] . "\r\n"; } } $fenlei = str_replace("»", "", $fenlei); $fenlei = str_replace(" ", " ", $fenlei); $fenlei = preg_replace("/\\<(?!br).(.*?)\\>/is", '', $fenlei); foreach ($threadsortshow[optionlist] as $opt) { $opt_arr[] = $opt; } $fenlei = ""; foreach ($opt_arr as $v1) { $fenlei .= $v1['title'] . ':' . $v1['value'] . "\r\n"; } $fenlei = str_replace("»", "", $fenlei); $fenlei = str_replace(" ", " ", $fenlei); $fenlei = str_replace('onload="thumbImg(this)"', '', $fenlei); $fenlei = str_replace('data/attachment/forum', '/mobcent/data/attachment/forum/mobcentSmallPreview', $fenlei); $fenlei = trim(str_replace('border="0"', 'width="2" height="4" /', $fenlei)); $fenlei1 = doContent($fenlei); $fenlei2 = getContentFont($fenlei); foreach ($fenlei1 as $k => $v) { if ($v['type'] == 0) { unset($fenlei1[$k]); } else { } } $fenlei_array2 = explode('|~|', $fenlei2); foreach ($fenlei_array2 as $k => $v) { if (!empty($v)) { $fenlei_arr[] = array("infor" => str_replace('<hr class="l" />', '', preg_replace("#(\\w*)\\<.*?\\>(\\w*)#", "\$1\$2", $v)), "type" => 0); } if (preg_replace("#(\\w*)\\<.*?\\>(\\w*)#", "\$1\$2", $fenlei1[$k]["infor"])) { $fenlei_arr[] = $fenlei1[$k]; } } return $fenlei_arr; } }
private function _getSortInfo($thread) { // from forum_viewthread template $sort = array('title' => '', 'summary' => ''); global $_G; $threadsort = $thread['sortid'] && isset($_G['forum']['threadsorts']['types'][$thread['sortid']]) ? 1 : 0; if ($threadsort) { require_once libfile('function/threadsort'); $threadsortshow = threadsortshow($thread['sortid'], $_G['tid']); } if ($threadsort && $threadsortshow) { if ($threadsortshow['typetemplate']) { //echo $threadsortshow['typetemplate']; $sort = $this->_getSortByTemplate($threadsortshow); } elseif ($threadsortshow['optionlist']) { if ($threadsortshow['optionlist'] == 'expire') { $sort['summary'] = WebUtils::t("该信息已经过期\n"); } else { $sort['title'] = $_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]; if (is_array($threadsortshow['optionlist'])) { foreach ($threadsortshow['optionlist'] as $option) { if ($option['type'] != 'info') { $sort['summary'] .= sprintf("%s :\t", $option['title']); if ($option['value'] || $option['type'] == 'number' && $option['value'] !== '') { $matches = array(); preg_match('/action=protectsort.+?optionid=(\\d+)/', $option['value'], $matches); if (!empty($matches)) { $option['value'] = $this->_getProtectSortOptionListValue($_G['tid'], $matches[1]); } else { $option['value'] = WebUtils::emptyHtml($option['value']); } $sort['summary'] .= $option['value'] . $option['unit']; } $sort['summary'] .= "\n"; } } } } } } return $sort; }
private function _convertSortInfo($sortId, $tid) { global $_G; $returnStr = array(); require_once libfile('function/threadsort'); $sortInfo = threadsortshow($sortId, $tid); foreach ($sortInfo['optionlist'] as $value) { if ($value['type'] != 'select') { $returnStr[] = $value['title'] . ':' . $value['value']; } } if (count($returnStr)) { return implode('<br/>', $returnStr); } return false; }
$status = groupperm($_G['forum'], $_G['uid']); if ($status == 1) { showmessage('forum_group_status_off'); } elseif ($status == 2) { showmessage('forum_group_noallowed', 'forum.php?mod=group&fid=' . $_G['fid']); } elseif ($status == 3) { showmessage('forum_group_moderated', 'forum.php?mod=group&fid=' . $_G['fid']); } $navigation = ' <em>›</em> <a href="group.php">' . $_G['setting']['navs'][3]['navname'] . '</a> ' . get_groupnav($_G['forum']); $_G['grouptypeid'] = $_G['forum']['fup']; } $_G['forum_tagscript'] = ''; $threadsort = $_G['forum_thread']['sortid'] && isset($_G['forum']['threadsorts']['types'][$_G['forum_thread']['sortid']]) ? 1 : 0; if ($threadsort) { require_once libfile('function/threadsort'); $threadsortshow = threadsortshow($_G['forum_thread']['sortid'], $_G['tid']); } if (empty($_G['forum']['allowview'])) { if (!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) { showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1)); } elseif ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) { $navtitle = ''; showmessagenoperm('viewperm', $_G['fid']); } } elseif ($_G['forum']['allowview'] == -1) { $navtitle = ''; showmessage('forum_access_view_disallow'); } if ($_G['forum']['formulaperm']) { formulaperm($_G['forum']['formulaperm']); }
} } 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']) {