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;
 }/*}}}*/
Example #2
0
<?php if (false == empty($bingliSet->contents)) { $dto = array_pop($bingliSet->contents); ?>
    <ul class="bingli blcontent">
        <li class="title">ÄÚÈÝ£º</li>
        <li class="item"><?=BingLiDtoDisplay::doProcessContent4Front($dto->content)?></li>
    </ul>
<? } ?>
 private function getBingLi4Contents($bingLiSet, &$allBingli)
 {/*{{{*/
     if (false == empty($bingLiSet->contents))
     {
         $contentsArr = array();
         foreach ($bingLiSet->contents as $dto)
         {
             $content = str_replace("(发病时间、主要症状、就诊医院等)", "", $this->decodeStr(BingLiDtoDisplay::doProcessContent4Front($dto->content)));
             $content = str_replace(array("\n\n\n"), "\n", $content);
             $content = str_replace("曾经治疗情况和效果:\n\n\n\n想得到怎样的帮助:", "想得到怎样的帮助:", $content);
             $content = preg_replace("/想得到怎样的帮助:\n\n$/", "", $content);
             $contentsArr[] = $content;
         }
         $allBingli['contents'] = $contentsArr;
     }
 }/*}}}*/
        }
    }
    $hospitals = NodeClient::getInstance()->getHospitalBingLiByIds($ids);
    foreach($bingliSet->treatement as $dto)
    {
        include("_treatment_readonly.php");
    }
?>
    </div>
<?php } ?>

<?php if (false == empty($bingliSet->contents)) { $dto = array_pop($bingliSet->contents); ?>
    <div class="item_height"></div>
    <div class="item">
      <div class="block_title">内容:</div>
          <p><?=BingLiDtoDisplay::doProcessContent4Front($dto->content)?></p>
    </div>
<? } ?>

<?php if (false == empty($proposal->attachmentIds)) {
    $attachmentIds = $proposal->attachmentIds;
    ?>
    <div class="item_line"></div>
    <div class="item">
      <div class="block_title">上传病历:</div>
<?php include ('_showattachlist.php');?>
    </div>
    </div>
<?php }?>
  </div>
</div>
 private function changePostContent($post)
 {/*{{{*/
     $bingLiSet = BingLiDtoHelper::create($post)->getAll();
     return BingLiDtoDisplay::getContent($bingLiSet);
 }/*}}}*/