private function _getThreadPostsInfos($posts, $finalId) {/*{{{*/ $postInfos = array(); foreach($posts as $post) { if($post instanceof Proposal) { $post = DAL::get()->find('proposal', $post->id); } //判断post内容是否为咨询首帖,如果是咨询首帖则按规则转换 $content = $this->changePostContent($post); if($post->isNormalStatus()) { $postInfo['postId'] = $post->id; $postInfo['userId'] = $post->user->id; $postInfo['content'] = XString::getContentWithOutHtml($content); $postInfo['htmlContent'] = $this->getContentWithHTML($content); if($post instanceof Proposal) { // $postInfo['content'] = $post->getContent4Wap(); // $postInfo['content'] = $post->getContent4Wap(); $bingLiSet = BingLiDtoHelper::create($post)->getAll(); $content = BingLiDtoDisplay::getContent($bingLiSet); $postInfo['content'] = $content; } else { $postInfo['content'] = XString::getContentWithOutHtml($content); } $postInfo['postTime'] = substr($post->ctime, 0, 16); $postInfo['adminComment'] = XString::getContentWithOutHtml($post->adminComment); $postInfo['latestId'] = $post->id; $postInfo['type'] = 'post'; $postInfo['attachmentIds'] = implode($post->attachmentIds,","); $postInfo['attachments'] = array(); foreach($post->attachmentIds as $attachmentId) { $postInfo['attachments'][] = $this->getAttachmentInfoByAttachId($attachmentId); } $postInfo['presentImgUrl'] = ''; $postInfo['isFinal'] = 0; if($post->id == $finalId) { $postInfo['isFinal'] = 1; } if (false == empty($postInfo)) { $postInfos[] = $postInfo; } } } return $postInfos; }/*}}}*/
private function changePostContent($post) {/*{{{*/ $bingLiSet = BingLiDtoHelper::create($post)->getAll(); return BingLiDtoDisplay::getContent($bingLiSet); }/*}}}*/