$trades[$attach['pid']]['thumb'] = $attach['thumb'] ? getimgthumbname($trades[$attach['pid']]['attachurl']) : $trades[$attach['pid']]['attachurl']; $trades[$attach['pid']]['width'] = $attach['thumb'] && $_G['setting']['thumbwidth'] < $attach['width'] ? $_G['setting']['thumbwidth'] : $attach['width']; } } } if ($_G['gp_do'] == 'tradeinfo') { $verifyadd = ''; if ($_G['setting']['verify']['enabled']) { $verifyadd = "LEFT JOIN " . DB::table('common_member_verify') . " mv USING(uid)"; $fieldsadd .= ', mv.verify1, mv.verify2, mv.verify3, mv.verify4, mv.verify5'; } $trade = $trades[$_G['gp_pid']]; unset($trades); $posttable = getposttablebytid($_G['tid']); $post = DB::fetch_first("SELECT p.*, m.uid, mp.realname, m.username, m.groupid, m.adminid, m.regdate, ms.lastactivity,\r\n\t\t\tm.credits, m.email, mp.gender, mp.site,\tmp.icq, mp.qq, mp.yahoo, mp.msn, mp.taobao, mp.alipay,\r\n\t\t\tms.buyercredit, ms.sellercredit {$fieldsadd}\r\n\t\t\tFROM " . DB::table($posttable) . " p\r\n\t\t\tLEFT JOIN " . DB::table('common_member') . " m ON m.uid=p.authorid\r\n\t\t\tLEFT JOIN " . DB::table('common_member_status') . " ms USING(uid)\r\n\t\t\tLEFT JOIN " . DB::table('common_member_profile') . " mp USING(uid)\r\n\t\t\t{$verifyadd}\r\n\t\t\tWHERE pid='{$_G['gp_pid']}'"); $postlist[$post['pid']] = viewthread_procpost($post, $lastvisit, $ordertype); $usertrades = $userthreads = array(); if (!$_G['inajax']) { $limit = 6; $query = DB::query("SELECT t.tid, t.pid, t.aid, t.subject, t.price, t.credit, t.displayorder FROM " . DB::table('forum_trade') . " t\r\n\t\t\t\tLEFT JOIN " . DB::table(getattachtablebytid($_G['tid'])) . " a ON t.aid=a.aid\r\n\t\t\t\tWHERE t.sellerid='" . $_G['forum_thread']['authorid'] . "' AND t.tid='{$_G['tid']}' ORDER BY t.displayorder DESC LIMIT " . ($limit + 1)); $usertradecount = 0; while ($usertrade = DB::fetch($query)) { if ($usertrade['pid'] == $post['pid']) { continue; } $usertradecount++; $usertrades[] = $usertrade; if ($usertradecount == $limit) { break; } }
if ($postusers[$uid]['regdate'] + $postusers[$uid]['oltime'] * 3600 > TIMESTAMP) { $postusers[$uid]['oltime'] = 0; } $postusers[$uid]['office'] = $postusers[$uid]['position']; $postusers[$uid]['inblacklist'] = $member_blackList[$uid] ? true : false; $postusers[$uid]['groupcolor'] = $_G['cache']['usergroups'][$postuser['groupid']]['color']; unset($postusers[$uid]['position']); } unset($member_field_forum, $member_status, $member_count, $member_profile, $member_field_home, $member_blackList); $_G['medal_list'] = array(); foreach ($postlist as $pid => $post) { if (getstatus($post['status'], 6)) { $locationpids[] = $pid; } $post = array_merge($postlist[$pid], (array) $postusers[$post['authorid']]); $postlist[$pid] = viewthread_procpost($post, $_G['member']['lastvisit'], $ordertype, $maxposition); } } if ($_G['allblocked']) { $_G['blockedpids'] = array(); } if ($locationpids) { $locations = C::t('forum_post_location')->fetch_all($locationpids); } if ($postlist && $rushids) { foreach ($postlist as $pid => $post) { $post['number'] = $post['position']; $postlist[$pid] = checkrushreply($post); } } if ($_G['setting']['repliesrank'] && $postlist) {
$polloptions[] = array('polloptionid' => $options['polloptionid'], 'polloption' => preg_replace("/\\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\\/\\/([^\\[\"']+?)\\](.+?)\\[\\/url\\]/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $options['polloption']), 'votes' => $options['votes'], 'width' => @round($options['votes'] * 300 / $count['max']) + 2, 'percent' => @sprintf("%01.2f", $options['votes'] * 100 / $count['total'])); } $voterids = explode("\t", $voterids); $voters = array_unique($voterids); $voterscount = count($voters) - 1; array_shift($voters); if (!$expiration) { $expirations = $timestamp + 86400; } else { $expirations = $expiration; if ($expirations > $timestamp) { $thread['remaintime'] = remaintime($expirations - $timestamp); } } $allowvote = $allowvote && (empty($thread['closed']) || $alloweditpoll) && !in_array($discuz_uid ? $discuz_uid : $onlineip, $voters) && $timestamp < $expirations && $expirations > 0; $optiontype = $multiple ? 'checkbox' : 'radio'; $visiblepoll = $visible || $forum['ismoderator'] || $discuz_uid && $discuz_uid == $thread['authorid'] || $expirations >= $timestamp && in_array($discuz_uid ? $discuz_uid : $onlineip, $voters) ? 0 : 1; } else { $db->query("UPDATE {$tablepre}threads SET special='0' WHERE tid='{$tid}'", 'UNBUFFERED'); } $post = $db->fetch_first("SELECT p.*, m.uid, m.username, m.groupid, m.adminid, m.regdate, m.lastactivity, m.posts, m.digestposts, m.oltime,\r\n\tm.pageviews, m.credits, m.extcredits1, m.extcredits2, m.extcredits3, m.extcredits4, m.extcredits5, m.extcredits6,\r\n\tm.extcredits7, m.extcredits8, m.email, m.gender, m.showemail, m.invisible, m.xspacestatus, mf.nickname, mf.site,\r\n\tmf.icq, mf.qq, mf.yahoo, mf.msn, mf.taobao, mf.alipay, mf.location, mf.medals, mf.avatar, mf.avatarwidth,\r\n\tmf.avatarheight, mf.customstatus, mf.spacename {$fieldsadd}\r\n\tFROM {$tablepre}posts p\r\n\tLEFT JOIN {$tablepre}members m ON m.uid=p.authorid\r\n\tLEFT JOIN {$tablepre}memberfields mf ON mf.uid=m.uid\r\n\tWHERE p.tid='{$tid}' AND first=1 LIMIT 1"); $pid = $post['pid']; $postlist[$post['pid']] = viewthread_procpost($post); if ($attachpids) { require_once DISCUZ_ROOT . './include/attachment.func.php'; parseattach($attachpids, $attachtags, $postlist, $showimages); } viewthread_parsetags(); $post = $postlist[$post['pid']]; include template('viewthread_poll'); exit;
$Id: viewthread_special.inc.php 9806 2007-08-15 06:04:37Z cnteacher $ */ if (!defined('IN_DISCUZ')) { exit('Access Denied'); } $query = $db->query("SELECT count(*) FROM {$tablepre}posts WHERE tid='{$tid}' AND first=0 AND invisible='0'"); $repostnum = $db->result($query, 0); $ppp = $forum['threadcaches'] && !$discuz_uid ? $_DCACHE['settings']['postperpage'] : $ppp; $start_limit = $numpost = ($page - 1) * $ppp; if ($start_limit > $repostnum) { $start_limit = $numpost = 0; $page = 1; } if ($thread['special'] == 3) { $thread['price'] < 0 && $start_limit++; $repostnum--; } $multipage = multi($repostnum, $ppp, $page, "viewthread.php?tid={$tid}&do={$do}&extra={$extra}" . (isset($highlight) ? "&highlight=" . rawurlencode($highlight) : '')); $query = $db->query("SELECT p.*,m.username,m.adminid,m.groupid,m.credits FROM {$tablepre}posts p LEFT JOIN {$tablepre}members m ON m.uid=p.authorid WHERE p.tid='{$tid}' AND p.invisible='0' AND p.first='0' ORDER BY p.dateline LIMIT {$start_limit}, {$ppp}"); while ($post = $db->fetch_array($query)) { $post['first'] = 0; $post = viewthread_procpost($post, 1); $postlist[$post['pid']] = $post; } if ($attachpids) { require_once DISCUZ_ROOT . './include/attachment.func.php'; parseattach($attachpids, $attachtags, $postlist, $showimages); } include template('viewthread_special_post'); exit;
public static function transPostContentToHtml($post) { Mobcent::import(sprintf('%s/forum_viewthread_%s.php', MOBCENT_APP_ROOT . '/components/discuz/forum', MobcentDiscuz::getMobcentDiscuzVersion())); ForumUtils::initForum($post['fid'], $post['tid']); loadcache('usergroups'); $userInfo = UserUtils::getUserInfo($post['authorid']); $post = array_merge($userInfo, $post); global $_G; // 处理主题价格 $_G['forum_threadpay'] = FALSE; if ($post['first']) { if ($_G['forum_thread']['price'] > 0 && $_G['forum_thread']['special'] == 0) { if ($_G['setting']['maxchargespan'] && TIMESTAMP - $_G['forum_thread']['dateline'] >= $_G['setting']['maxchargespan'] * 3600) { C::t('forum_thread')->update($_G['tid'], array('price' => 0), false, false, $archiveid); $_G['forum_thread']['price'] = 0; } else { $exemptvalue = $_G['forum']['ismoderator'] ? 128 : 16; if (!($_G['group']['exempt'] & $exemptvalue) && $_G['forum_thread']['authorid'] != $_G['uid']) { if (!C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'BTC', $_G['tid'])) { require_once libfile('thread/pay', 'include'); $_G['forum_threadpay'] = TRUE; } } } } } $lastvisit = $_G['member']['lastvisit']; $ordertype = $maxposition = 0; // 处理附件 $_G['forum_attachpids'] = $_G['forum_attachtags'] = ''; $_G['tid'] = $post['tid']; // 去掉干扰码 $_G['forum']['jammer'] = 0; $post = viewthread_procpost($post, $lastvisit, $ordertype, $maxposition); $postlist[$post['pid']] = $post; if ($_G['forum_attachpids'] && !defined('IN_ARCHIVER')) { require_once libfile('function/attachment'); if (is_array($threadsortshow) && !empty($threadsortshow['sortaids'])) { $skipaids = $threadsortshow['sortaids']; } parseattach($_G['forum_attachpids'], $_G['forum_attachtags'], $postlist, $skipaids); } if (empty($postlist)) { showmessage('post_not_found'); } elseif (!defined('IN_MOBILE_API')) { foreach ($postlist as $pid => $post) { // 取出没有插入的附件 if (!empty($post['imagelist'])) { $postlist[$pid]['message'] .= showattach($post, 1); } if ($post['attachlist']) { $postlist[$pid]['message'] .= showattach($post); } $postlist[$pid]['message'] = preg_replace("/\\[attach\\]\\d+\\[\\/attach\\]/i", '', $postlist[$pid]['message']); } } if ($post['first'] && $_G['forum_threadpay']) { $postlist[$pid]['message'] = $thread['freemessage']; } // 处理屏蔽 if (!$_G['forum']['ismoderator'] && $postlist[$pid]['status'] & 1) { $postlist[$pid]['message'] = WebUtils::t('该帖被管理员或版主屏蔽'); } return $postlist[$post['pid']]; }