function getByTid($tid)
 {
     global $attachpath, $db_windpost, $foruminfo, $fid, $forumset, $pwforum, $db_hits_store;
     $tid = intval($tid);
     if ($tid <= 0) {
         return $this->buildResponse(THREAD_INVALID_PARAMS);
     }
     $GLOBALS['tid'] = $tid;
     $threadData = $this->_getThread($tid, true);
     if (empty($threadData)) {
         return $this->buildResponse(0);
     }
     $fid = $threadData['fid'];
     $user = $this->getCurrentUser();
     $user->initRight();
     $this->getCustomizedCommonService()->getReadRight($user);
     $GLOBALS['tpc_buy'] = $threadData['buy'];
     $GLOBALS['tpc_author'] = $threadData['author'];
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($fid);
     $foruminfo = $pwforum->foruminfo;
     $forumset = $pwforum->forumset;
     list($windVersion) = explode(',', WIND_VERSION);
     if ($windVersion == '8.0') {
         $threadData = $this->_isMyFavoredForEarly($tid, $threadData);
     } else {
         $threadData = $this->_isMyFavoredForAfter($tid, $threadData);
     }
     $udb = $this->_getUDb($threadData);
     $bandb = $pwforum->forumBan($udb);
     isset($bandb[$threadData['uid']]) && ($threadData['groupid'] = 6);
     $_attachList = array();
     if ($threadData['aid']) {
         $query = $GLOBALS['db']->query('SELECT * FROM pw_attachs WHERE tid=' . pwEscape($tid) . ' AND pid=0');
         while ($rt = $GLOBALS['db']->fetch_array($query)) {
             $_attachList[] = $rt;
         }
     }
     $imgsInContent = $this->getCustomizedCommonService()->parseImgInContent($threadData);
     $threadData['content'] = $this->getCustomizedCommonService()->parsePostContent($threadData);
     $threadData['content'] = $this->getCustomizedCommonService()->clearHtmlTag($threadData['content'], '<br>');
     $threadData['content'] = $this->getCustomizedCommonService()->parseEmotionInContent($threadData['content']);
     $threadData['attachlist'] = $this->getCustomizedCommonService()->getAttachWithThumblist($_attachList);
     $threadData['attachlist'] = array_merge($imgsInContent, $threadData['attachlist']);
     $this->getCustomizedCommonService()->clearAttachSign($_attachList, &$threadData['content']);
     $threadData['icon'] = $this->getCustomizedCommonService()->getUserIcon($threadData['icon']);
     if ($db_hits_store == 0) {
         $GLOBALS['db']->update('UPDATE pw_threads SET hits=hits+1 WHERE tid=' . pwEscape($tid));
     } elseif ($db_hits_store == 1) {
         $GLOBALS['db']->update('UPDATE pw_hits_threads SET hits=hits+1 WHERE tid=' . pwEscape($tid));
     } elseif ($db_hits_store == 2) {
         if (class_exists("pwCache") && method_exists("pwCache", "writeover")) {
             pwCache::writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab');
         } else {
             writeover(D_P . 'data/bbscache/hits.txt', $tid . "\t", 'ab');
         }
     }
     return $this->buildResponse(0, $threadData);
 }
Пример #2
0
 }
 if (!$pwpost->isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($pwpost->isBM, 'replylock')) {
     Showmsg('reply_lockatc');
 }
 require_once R_P . 'require/bbscode.php';
 if ($article == '0') {
     $atcarray = $tpcarray;
 } else {
     !is_numeric($pid) && Showmsg('illegal_tid');
     $atcarray = $db->get_one("SELECT p.author,p.subject,p.postdate,p.content,p.ifshield,p.anonymous,m.uid,m.groupid,m.userstatus FROM {$pw_posts} p LEFT JOIN pw_members m ON p.authorid=m.uid WHERE p.pid=" . pwEscape($pid));
 }
 if ($atcarray['ifshield'] == '1') {
     $atcarray['content'] = shield('shield_article');
 } elseif ($atcarray['ifshield'] == '2') {
     $atcarray['content'] = shield('shield_del_article');
 } elseif ($pwforum->forumBan($atcarray)) {
     $atcarray['content'] = shield('ban_article');
 }
 $old_author = $atcarray['anonymous'] ? $db_anonymousname : $atcarray['author'];
 $replytitle = $atcarray['subject'];
 $wtof_oldfile = get_date($atcarray['postdate']);
 $old_content = $atcarray['content'];
 $old_content = preg_replace("/\\[hide=(.+?)\\](.+?)\\[\\/hide\\]/is", getLangInfo('post', 'hide_post'), $old_content);
 $old_content = preg_replace("/\\[post\\](.+?)\\[\\/post\\]/is", getLangInfo('post', 'post_post'), $old_content);
 $old_content = preg_replace("/\\[sell=(.+?)\\](.+?)\\[\\/sell\\]/is", getLangInfo('post', 'sell_post'), $old_content);
 $old_content = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/is", "", $old_content);
 $bit_content = explode("\n", $old_content);
 if (count($bit_content) > 5) {
     $old_content = "{$bit_content['0']}\n{$bit_content['1']}\n{$bit_content['2']}\n{$bit_content['3']}\n{$bit_content['4']}\n.......";
 }
 if (strpos($old_content, $db_bbsurl) !== false) {
Пример #3
0
        $showCustom && ($customdb = $_cacheService->getMemberCreditByUserIds($_userIds));
        $db_showcolony && ($colonydb = $_cacheService->getCmemberAndColonyByUserIds($_userIds));
        //为了兼容原来版本中的查询字段取别名 'icon as micon'
        if (S::isArray($pwMembers)) {
            foreach ($pwMembers as $k => $v) {
                $pwMembers[$k]['micon'] = $pwMembers[$k]['icon'];
                unset($pwMembers[$k]['icon']);
            }
        }
    } else {
        $_dbCacheService = Perf::gatherCache('pw_membersdbcache');
        list($pwMembers, $customdb, $colonydb) = $_dbCacheService->getUserDBCacheByUserIds($_userIds, $showCustom, $db_showcolony, $showfield);
    }
}
//用户禁言及词语过滤
$bandb = S::isArray($pwMembers) ? $pwforum->forumBan($pwMembers) : null;
$start_limit = $page == 1 || $start_limit < 0 ? 0 : $start_limit + 1;
//帖子详细内容
$ping_logs = array();
$pageinverse && ($start_limit += $readnum - 1);
require_once R_P . 'require/showimg.php';
if (S::isArray($readdb)) {
    foreach ($readdb as $key => $read) {
        $read = array_merge((array) $read, (array) $pwMembers[$read['authorid']]);
        isset($bandb[$read['authorid']]) && ($read['groupid'] = 6);
        if (($read['ifshield'] || $read['groupid'] == 6 && $db_shield) && !$admincheck) {
            unset($readdb[$key]);
            continue;
        }
        if ($read['istop'] == 'topped') {
            $readdb[$key] = viewread($read, '');
Пример #4
0
        	
        		if ($tmpUIDs) {#会员信息
        			$query = $db->query("SELECT m.uid,m.username,m.gender,m.oicq,m.aliww,m.groupid,m.memberid,m.icon AS micon ,m.hack,m.honor,m.signature,m.regdate,m.medals,m.userstatus,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.currency,md.thisvisit,md.lastvisit,md.onlinetime,md.starttime $fieldinfo FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid $tableinfo WHERE m.uid IN (".S::sqlImplode($tmpUIDs,false).") ");
        			while ($rt = $db->fetch_array($query)) {
        				is_array($pwMembers[$rt['uid']]) ? $pwMembers[$rt['uid']] += $rt : $pwMembers[$rt['uid']] = $rt;
        				$tmpCacheData['UID_'.$rt['uid']] = $rt;
        			}
        			is_object($_cache) && $_cache->update($tmpCacheData,3600);
        			$db->free_result($query);
        		}
        		unset($skey,$_uids,$_cache,$tmpUIDs,$tmpCREDITs,$tmpGROUPs,$tmpColonydb,$tmpCustomdb,$tmpCacheData);
        		**/
    }
}
//用户禁言及词语过滤
$bandb = $pwforum->forumBan($pwMembers);
$start_limit = $page == 1 || $start_limit < 0 ? 0 : $start_limit + 1;
//帖子详细内容
$ping_logs = array();
$pageinverse && ($start_limit += $readnum - 1);
//地区字段
$hasAreas = false;
$areaFields = array();
foreach ($customfield as $v) {
    if ($v['viewinread'] && $v['type'] == 7) {
        $hasAreas = true;
        $areaFields[] = $v['fieldname'] ? $v['fieldname'] : 'field_' . (int) $v[id];
    }
}
$hasAreas && ($areaids = $areas = array());
if ($replyReward) {