/**
  * action implement
  */
 public function actionImplement($in)
 {
     global $db;
     $result = false;
     switch ($in->data['type']) {
         case 'newtopic':
         case 'sub':
         case 'quote':
         case 'tag':
             $oViewableThreadList = new ViewableThreadList();
             $oViewableThreadList->setObjectIDs(array($in->data['id']));
             $oViewableThreadList->readObjects();
             $result = $oViewableThreadList->getObjects();
             if (sizeof($result) == 1 && isset($result[$in->data['id']])) {
                 $thread = $result[$in->data['id']]->getDecoratedObject();
                 if ($thread->userID == (int) $in->data['authorid']) {
                     $result = true;
                 }
             }
             break;
         case 'conv':
             $oViewableConversationMessageList = new ViewableConversationMessageList();
             $oViewableConversationMessageList->setObjectIDs(array($in->data['id']));
             $oViewableConversationMessageList->readObjects();
             $result = $oViewableConversationMessageList->getObjects();
             if (sizeof($result) == 1 && isset($result[$in->data['id']])) {
                 $pm = $result[$in->data['id']]->getDecoratedObject();
                 if ($pm->userID == (int) $in->data['authorid']) {
                     $result = true;
                 }
             }
             break;
     }
     $this->data = array('result' => $result, 'result_text' => 'fail');
 }
Example #2
0
 /**
  * forum advanced search
  *
  * @param  Array  $filter  search filter
  * @param  Object  $oMbqDataPage
  * @param  Array  $mbqOpt
  * $mbqOpt['case'] = 'advanced' means advanced search
  * @return  Object  $oMbqDataPage
  */
 public function forumAdvancedSearch($filter, $oMbqDataPage, $mbqOpt)
 {
     if ($mbqOpt['case'] == 'getLatestTopic' || $mbqOpt['case'] == 'getUnreadTopic' || $mbqOpt['case'] == 'getParticipatedTopic') {
         $oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
         if ($mbqOpt['case'] == 'getParticipatedTopic') {
             $oViewableThreadList = new ViewableThreadList();
             $oViewableThreadList->sqlOffset = $oMbqDataPage->startNum;
             $oViewableThreadList->sqlLimit = $oMbqDataPage->numPerPage;
             $oViewableThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
             //!!!
             $oViewableThreadList->getConditionBuilder()->add('thread.threadID IN (SELECT threadID from wbb' . WCF_N . '_post where userID = ?)', array(MbqMain::$oCurMbqEtUser->userId->oriValue));
             //!!!
             $oViewableThreadList->readObjects();
             $oMbqDataPage->totalNum = $oViewableThreadList->countObjects();
             /* common begin */
             $mbqOpt['case'] = 'byObjsViewableThread';
             $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
             return $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($oViewableThreadList->getObjects(), $mbqOpt);
         } elseif ($mbqOpt['case'] == 'getLatestTopic') {
             $oViewableThreadList = new ViewableThreadList();
             $oViewableThreadList->sqlOffset = $oMbqDataPage->startNum;
             $oViewableThreadList->sqlLimit = $oMbqDataPage->numPerPage;
             $oViewableThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
             //!!!
             $oViewableThreadList->readObjects();
             $oMbqDataPage->totalNum = $oViewableThreadList->countObjects();
             /* common begin */
             $mbqOpt['case'] = 'byObjsViewableThread';
             $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
             return $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($oViewableThreadList->getObjects(), $mbqOpt);
             /* common end */
         } elseif ($mbqOpt['case'] == 'getUnreadTopic') {
             require_once MBQ_APPEXTENTION_PATH . 'ExttMbqBoardQuickSearchAction.php';
             $oExttMbqBoardQuickSearchAction = new ExttMbqBoardQuickSearchAction();
             $oExttMbqBoardQuickSearchAction->exttMbqStartNum = $oMbqDataPage->startNum;
             $oExttMbqBoardQuickSearchAction->exttMbqNumPerPage = $oMbqDataPage->numPerPage;
             $ret = $oExttMbqBoardQuickSearchAction->execute();
             $oMbqDataPage->totalNum = $ret['total'];
             $newMbqOpt['case'] = 'byTopicIds';
             $newMbqOpt['oMbqDataPage'] = $oMbqDataPage;
             $oMbqDataPage = $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($ret['topicIds'], $newMbqOpt);
             return $oMbqDataPage;
         }
     } elseif ($mbqOpt['case'] == 'searchTopic') {
         $oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
         $oViewableThreadList = new ViewableThreadList();
         $oViewableThreadList->sqlOffset = $oMbqDataPage->startNum;
         $oViewableThreadList->sqlLimit = $oMbqDataPage->numPerPage;
         $oViewableThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
         //!!!
         $oViewableThreadList->getConditionBuilder()->add('thread.threadID IN (SELECT threadID from wbb' . WCF_N . '_post as mbqPost where mbqPost.subject LIKE ? OR mbqPost.message LIKE ?)', array('%' . addcslashes($filter['keywords'], '_%') . '%', '%' . addcslashes($filter['keywords'], '_%') . '%'));
         //!!!
         $oViewableThreadList->readObjects();
         $oMbqDataPage->totalNum = $oViewableThreadList->countObjects();
         /* common begin */
         $mbqOpt['case'] = 'byObjsViewableThread';
         $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
         return $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($oViewableThreadList->getObjects(), $mbqOpt);
         /* common end */
     } elseif ($mbqOpt['case'] == 'searchPost') {
         $oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost');
         $oViewablePostList = new ViewablePostList();
         $oViewablePostList->sqlJoins .= 'INNER JOIN wbb' . WCF_N . '_thread thread ON (post.threadID = thread.threadID AND thread.isAnnouncement = 0)';
         //!!!
         $oViewablePostList->getConditionBuilder()->add('(post.subject LIKE ? OR post.message LIKE ?)', array('%' . addcslashes($filter['keywords'], '_%') . '%', '%' . addcslashes($filter['keywords'], '_%') . '%'));
         //!!!
         $oViewablePostList->readObjects();
         $oMbqDataPage->totalNum = $oViewablePostList->countObjects();
         /* common begin */
         $mbqOpt['case'] = 'byObjsViewablePost';
         $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
         return $oMbqRdEtForumPost->getObjsMbqEtForumPost($oViewablePostList->getObjects(), $mbqOpt);
         /* common end */
     } elseif ($mbqOpt['case'] == 'advanced') {
         MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . MBQ_ERR_INFO_NOT_ACHIEVE);
     }
     MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . MBQ_ERR_INFO_UNKNOWN_CASE);
 }
Example #3
0
 /**
  * get topic by topic id
  *
  * @param  Integer  $topicId
  * @return Mixed
  */
 protected function getTopicByTopicId($topicId)
 {
     $oViewableThreadList = new ViewableThreadList();
     $oViewableThreadList->setObjectIDs(array($topicId));
     $oViewableThreadList->readObjects();
     $objsViewableThread = $oViewableThreadList->getObjects();
     if ($objsViewableThread && ($oViewableThread = array_shift($objsViewableThread)) && ($oThread = $oViewableThread->getDecoratedObject()) && $oThread->threadID) {
         return $oThread;
     } else {
         return false;
     }
 }
 /**
  * forum advanced search
  *
  * @param  Array  $filter  search filter
  * @param  Object  $oMbqDataPage
  * @param  Array  $mbqOpt
  * $mbqOpt['case'] = 'advanced' means advanced search
  * @return  Object  $oMbqDataPage
  */
 public function forumAdvancedSearch($filter = array(), $oMbqDataPage = null, $mbqOpt = array())
 {
     if ($mbqOpt['case'] == 'getLatestTopic' || $mbqOpt['case'] == 'getUnreadTopic' || $mbqOpt['case'] == 'getParticipatedTopic') {
         $oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
         if ($mbqOpt['case'] == 'getParticipatedTopic') {
             $oViewableThreadList = new ViewableThreadList();
             $oViewableThreadList->sqlOffset = $oMbqDataPage->startNum;
             $oViewableThreadList->sqlLimit = $oMbqDataPage->numPerPage;
             $oViewableThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
             //!!!
             $oViewableThreadList->getConditionBuilder()->add('thread.threadID IN (SELECT threadID from wbb' . WCF_N . '_post where userID = ?)', array(MbqMain::$oCurMbqEtUser->userId->oriValue));
             //!!!
             $oViewableThreadList->readObjects();
             $oMbqDataPage->totalNum = $oViewableThreadList->countObjects();
             $oUnreadThreadList = new ViewableThreadList();
             $oUnreadThreadList->sqlConditionJoins = "    LEFT JOIN   wcf" . WCF_N . "_tracked_visit tracked_thread_visit\r\n                            ON      (tracked_thread_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wbb.thread') . " AND tracked_thread_visit.objectID = thread.threadID AND tracked_thread_visit.userID = " . WCF::getUser()->userID . ")\r\n                            LEFT JOIN   wcf" . WCF_N . "_tracked_visit tracked_board_visit\r\n                            ON      (tracked_board_visit.objectTypeID = " . VisitTracker::getInstance()->getObjectTypeID('com.woltlab.wbb.board') . " AND tracked_board_visit.objectID = thread.boardID AND tracked_board_visit.userID = " . WCF::getUser()->userID . ")";
             $oUnreadThreadList->sqlOffset = $oMbqDataPage->startNum;
             $oUnreadThreadList->sqlLimit = $oMbqDataPage->numPerPage;
             $oUnreadThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
             //!!!
             $oUnreadThreadList->getConditionBuilder()->add('thread.threadID IN (SELECT threadID from wbb' . WCF_N . '_post where userID = ?)', array(MbqMain::$oCurMbqEtUser->userId->oriValue));
             //!!!
             $oUnreadThreadList->getConditionBuilder()->add('thread.lastPostTime > ?', array(VisitTracker::getInstance()->getVisitTime('com.woltlab.wbb.thread')));
             $oUnreadThreadList->getConditionBuilder()->add("(thread.lastPostTime > tracked_thread_visit.visitTime OR tracked_thread_visit.visitTime IS NULL)");
             $oUnreadThreadList->getConditionBuilder()->add("(thread.lastPostTime > tracked_board_visit.visitTime OR tracked_board_visit.visitTime IS NULL)");
             $oUnreadThreadList->readObjects();
             $oMbqDataPage->totalUnreadNum = $oUnreadThreadList->countObjects();
             /* common begin */
             $mbqOpt['case'] = 'byObjsViewableThread';
             $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
             return $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($oViewableThreadList->getObjects(), $mbqOpt);
         } elseif ($mbqOpt['case'] == 'getLatestTopic') {
             $oViewableThreadList = new ViewableThreadList();
             $oViewableThreadList->sqlOffset = $oMbqDataPage->startNum;
             $oViewableThreadList->sqlLimit = $oMbqDataPage->numPerPage;
             $oViewableThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
             //!!!
             $oViewableThreadList->getConditionBuilder()->add('thread.boardID IN (?)', array(MbqMain::$oMbqAppEnv->accessibleBoardIds));
             $oViewableThreadList->readObjects();
             $oMbqDataPage->totalNum = $oViewableThreadList->countObjects();
             /* common begin */
             $mbqOpt['case'] = 'byObjsViewableThread';
             $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
             return $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($oViewableThreadList->getObjects(), $mbqOpt);
             /* common end */
         } elseif ($mbqOpt['case'] == 'getUnreadTopic') {
             require_once MBQ_APPEXTENTION_PATH . 'ExttMbqBoardQuickSearchAction.php';
             $oExttMbqBoardQuickSearchAction = new ExttMbqBoardQuickSearchAction();
             $oExttMbqBoardQuickSearchAction->exttMbqStartNum = $oMbqDataPage->startNum;
             $oExttMbqBoardQuickSearchAction->exttMbqNumPerPage = $oMbqDataPage->numPerPage;
             $ret = $oExttMbqBoardQuickSearchAction->execute();
             $oMbqDataPage->totalNum = $ret['total'];
             $newMbqOpt['case'] = 'byTopicIds';
             $newMbqOpt['oMbqDataPage'] = $oMbqDataPage;
             $oMbqDataPage = $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($ret['topicIds'], $newMbqOpt);
             return $oMbqDataPage;
         }
     } elseif ($mbqOpt['case'] == 'searchTopic') {
         $oMbqRdEtForumTopic = MbqMain::$oClk->newObj('MbqRdEtForumTopic');
         $oViewableThreadList = new ViewableThreadList();
         $oViewableThreadList->sqlOffset = $oMbqDataPage->startNum;
         $oViewableThreadList->sqlLimit = $oMbqDataPage->numPerPage;
         $oViewableThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
         //!!!
         $oViewableThreadList->getConditionBuilder()->add('thread.boardID IN (?)', array(MbqMain::$oMbqAppEnv->accessibleBoardIds));
         $oViewableThreadList->getConditionBuilder()->add('thread.threadID IN (SELECT threadID from wbb' . WCF_N . '_post as mbqPost where mbqPost.subject LIKE ? OR mbqPost.message LIKE ?)', array('%' . addcslashes($filter['keywords'], '_%') . '%', '%' . addcslashes($filter['keywords'], '_%') . '%'));
         //!!!
         $oViewableThreadList->readObjects();
         $oMbqDataPage->totalNum = $oViewableThreadList->countObjects();
         /* common begin */
         $mbqOpt['case'] = 'byObjsViewableThread';
         $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
         return $oMbqRdEtForumTopic->getObjsMbqEtForumTopic($oViewableThreadList->getObjects(), $mbqOpt);
         /* common end */
     } elseif ($mbqOpt['case'] == 'searchPost') {
         $oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost');
         $oViewablePostList = new ViewablePostList();
         $oViewablePostList->sqlConditionJoins .= 'INNER JOIN wbb' . WCF_N . '_thread thread ON (post.threadID = thread.threadID AND thread.isAnnouncement = 0)';
         //!!!
         $oViewablePostList->getConditionBuilder()->add('thread.boardID IN (?)', array(MbqMain::$oMbqAppEnv->accessibleBoardIds));
         $oViewablePostList->getConditionBuilder()->add('(post.subject LIKE ? OR post.message LIKE ?)', array('%' . addcslashes($filter['keywords'], '_%') . '%', '%' . addcslashes($filter['keywords'], '_%') . '%'));
         //!!!
         $oViewablePostList->readObjects();
         $oMbqDataPage->totalNum = $oViewablePostList->countObjects();
         /* common begin */
         $mbqOpt['case'] = 'byObjsViewablePost';
         $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
         return $oMbqRdEtForumPost->getObjsMbqEtForumPost($oViewablePostList->getObjects(), $mbqOpt);
         /* common end */
     } elseif ($mbqOpt['case'] == 'advanced') {
         MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . MBQ_ERR_INFO_NOT_ACHIEVE);
     }
     MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . MBQ_ERR_INFO_UNKNOWN_CASE);
 }
 /**
  * get forum topic objs
  *
  * @param  Mixed  $var
  * @param  Array  $mbqOpt
  * $mbqOpt['case'] = 'byForum' means get data by forum obj.$var is the forum obj.
  * $mbqOpt['case'] = 'byObjsViewableThread' means get data by objsViewableThread.$var is the objsViewableThread.
  * $mbqOpt['case'] = 'byTopicIds' means get data by topic ids.$var is the ids.
  * $mbqOpt['case'] = 'byAuthor' means get data by author.$var is the MbqEtUser obj.
  * $mbqOpt['case'] = 'subscribed' means get subscribed data.$var is the user id.
  * $mbqOpt['top'] = true means get sticky data.
  * $mbqOpt['notIncludeTop'] = true means get not sticky data.
  * @return  Mixed
  */
 public function getObjsMbqEtForumTopic($var = null, $mbqOpt = array())
 {
     if ($mbqOpt['case'] == 'byForum') {
         $oMbqEtForum = $var;
         if ($mbqOpt['oMbqDataPage']) {
             $oMbqDataPage = $mbqOpt['oMbqDataPage'];
             //ref wbb\page\BoardPage::initObjectList()
             $oBoardThreadList = new BoardThreadList($oMbqEtForum->mbqBind['oDetailedBoardNode']->getBoard(), 1000);
             //!!!
             if (isset($mbqOpt['ann']) && $mbqOpt['ann'] == true) {
                 $oBoardThreadList->sqlOffset = $oMbqDataPage->startNum;
                 $oBoardThreadList->sqlLimit = $oMbqDataPage->numPerPage;
                 $oBoardThreadList->readObjects();
                 $oMbqDataPage->totalNum = $oBoardThreadList->countAnnouncements();
                 $objsViewableThread = array();
                 foreach ($oBoardThreadList->getObjects() as $oViewableThread) {
                     if ($oViewableThread->getDecoratedObject()->isAnnouncement) {
                         //filter the announcement ViewableThread
                         $objsViewableThread[] = $oViewableThread;
                     }
                 }
             } elseif (isset($mbqOpt['top']) && $mbqOpt['top'] == true) {
                 $oBoardThreadList->getConditionBuilder()->add('thread.isSticky = 1');
                 $oBoardThreadList->sqlOffset = $oMbqDataPage->startNum;
                 $oBoardThreadList->sqlLimit = $oMbqDataPage->numPerPage;
                 $oBoardThreadList->readObjects();
                 $oMbqDataPage->totalNum = $oBoardThreadList->countObjects();
                 $objsViewableThread = array();
                 foreach ($oBoardThreadList->getObjects() as $oViewableThread) {
                     if (!$oViewableThread->getDecoratedObject()->isAnnouncement) {
                         //filter the announcement ViewableThread
                         $objsViewableThread[] = $oViewableThread;
                     }
                 }
             } else {
                 $oBoardThreadList->getConditionBuilder()->add('thread.isSticky = 0');
                 $oBoardThreadList->sqlOffset = $oMbqDataPage->startNum;
                 $oBoardThreadList->sqlLimit = $oMbqDataPage->numPerPage;
                 $oBoardThreadList->readObjects();
                 $oMbqDataPage->totalNum = $oBoardThreadList->countObjects();
                 $objsViewableThread = array();
                 foreach ($oBoardThreadList->getObjects() as $oViewableThread) {
                     if (!$oViewableThread->getDecoratedObject()->isAnnouncement) {
                         //filter the announcement ViewableThread
                         $objsViewableThread[] = $oViewableThread;
                     }
                 }
             }
             /* common begin */
             $mbqOpt['case'] = 'byObjsViewableThread';
             $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
             $mbqOpt['originCase'] = 'byForum';
             return $this->getObjsMbqEtForumTopic($objsViewableThread, $mbqOpt);
             /* common end */
         }
     } elseif ($mbqOpt['case'] == 'subscribed') {
         if ($mbqOpt['oMbqDataPage']) {
             $oMbqDataPage = $mbqOpt['oMbqDataPage'];
             $oWatchedThreadList = new WatchedThreadList();
             $oWatchedThreadList->sqlOffset = $oMbqDataPage->startNum;
             $oWatchedThreadList->sqlLimit = $oMbqDataPage->numPerPage;
             $oWatchedThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
             //!!!
             $oWatchedThreadList->readObjectIDs();
             $oMbqDataPage->totalNum = $oWatchedThreadList->countObjects();
             /* common begin */
             $mbqOpt['case'] = 'byTopicIds';
             $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
             return $this->getObjsMbqEtForumTopic($oWatchedThreadList->objectIDs, $mbqOpt);
             /* common end */
         }
     } elseif ($mbqOpt['case'] == 'byAuthor') {
         if ($mbqOpt['oMbqDataPage']) {
             $oMbqDataPage = $mbqOpt['oMbqDataPage'];
             $oViewableThreadList = new ViewableThreadList();
             $oViewableThreadList->sqlOffset = $oMbqDataPage->startNum;
             $oViewableThreadList->sqlLimit = $oMbqDataPage->numPerPage;
             $oViewableThreadList->getConditionBuilder()->add('thread.boardID IN (?)', array(MbqMain::$oMbqAppEnv->accessibleBoardIds));
             $oViewableThreadList->getConditionBuilder()->add('thread.userID = ?', array($var->userId->oriValue));
             //!!!
             $oViewableThreadList->getConditionBuilder()->add('thread.isAnnouncement = 0');
             //!!!
             $oViewableThreadList->readObjects();
             $oMbqDataPage->totalNum = $oViewableThreadList->countObjects();
             /* common begin */
             $mbqOpt['case'] = 'byObjsViewableThread';
             $mbqOpt['oMbqDataPage'] = $oMbqDataPage;
             return $this->getObjsMbqEtForumTopic($oViewableThreadList->getObjects(), $mbqOpt);
             /* common end */
         }
     } elseif ($mbqOpt['case'] == 'byTopicIds') {
         //ref wbb\data\thread\ViewableThread::getThread()
         $oViewableThreadList = new ViewableThreadList();
         $oViewableThreadList->setObjectIDs($var);
         $oViewableThreadList->readObjects();
         /* common begin */
         $mbqOpt['case'] = 'byObjsViewableThread';
         return $this->getObjsMbqEtForumTopic($oViewableThreadList->getObjects(), $mbqOpt);
         /* common end */
     } elseif ($mbqOpt['case'] == 'byObjsViewableThread') {
         $objsViewableThread = $var;
         /* common begin */
         $objsMbqEtForumTopic = array();
         $authorUserIds = array();
         $lastReplyUserIds = array();
         $forumIds = array();
         $topicIds = array();
         foreach ($objsViewableThread as $oViewableThread) {
             if ($oViewableThread->getDecoratedObject()->isDisabled && (!WCF::getSession()->getPermission('mod.board.isSuperMod') || !WCF::getSession()->getPermission('mod.board.canEnableThread'))) {
                 continue;
             }
             $objsMbqEtForumTopic[] = $this->initOMbqEtForumTopic($oViewableThread, array('case' => 'oViewableThread'));
         }
         foreach ($objsMbqEtForumTopic as $oMbqEtForumTopic) {
             $authorUserIds[$oMbqEtForumTopic->topicAuthorId->oriValue] = $oMbqEtForumTopic->topicAuthorId->oriValue;
             $lastReplyUserIds[$oMbqEtForumTopic->lastReplyAuthorId->oriValue] = $oMbqEtForumTopic->lastReplyAuthorId->oriValue;
             $forumIds[$oMbqEtForumTopic->forumId->oriValue] = $oMbqEtForumTopic->forumId->oriValue;
             $topicIds[$oMbqEtForumTopic->topicId->oriValue] = $oMbqEtForumTopic->topicId->oriValue;
         }
         //make topicContent and shortContent properties from first post,ref wbb\page\ThreadPage::initObjectList()
         $oMbqRdEtForumPost = MbqMain::$oClk->newObj('MbqRdEtForumPost');
         foreach ($objsMbqEtForumTopic as &$oMbqEtForumTopic) {
             $oThreadPostList = new ThreadPostList($oMbqEtForumTopic->mbqBind['oViewableThread']->getDecoratedObject());
             $oThreadPostList->setObjectIDs(array($oMbqEtForumTopic->mbqBind['oViewableThread']->getDecoratedObject()->firstPostID));
             $oThreadPostList->readObjects();
             foreach ($oThreadPostList->getObjects() as $oViewablePost) {
                 $oMbqEtForumTopic->topicContent->setOriValue($oViewablePost->getDecoratedObject()->getMessage());
                 $oMbqEtForumTopic->oFirstMbqEtForumPost = $oViewablePost;
                 $shortContent = MbqMain::$oMbqCm->getShortContent($oMbqRdEtForumPost->processContentForDisplay($oViewablePost, true));
                 break;
                 //only get the first post
             }
             $oThreadPostList->setObjectIDs(array($oMbqEtForumTopic->mbqBind['oViewableThread']->getDecoratedObject()->lastPostID));
             $oThreadPostList->readObjects();
             foreach ($oThreadPostList->getObjects() as $oViewablePost) {
                 $oMbqEtForumTopic->oLastMbqEtForumPost = $oViewablePost;
                 $oMbqEtForumTopic->shortContent->setOriValue(MbqMain::$oMbqCm->getShortContent($oMbqRdEtForumPost->processContentForDisplay($oViewablePost, true)));
                 break;
                 //only get the lase post
             }
             if (isset($mbqOpt['originCase']) && $mbqOpt['originCase'] == "byForum" && isset($shortContent)) {
                 $oMbqEtForumTopic->shortContent->setOriValue($shortContent);
             }
         }
         /* load oMbqEtForum property */
         $oMbqRdEtForum = MbqMain::$oClk->newObj('MbqRdEtForum');
         $objsMbqEtForum = $oMbqRdEtForum->getObjsMbqEtForum($forumIds, array('case' => 'byForumIds'));
         foreach ($objsMbqEtForum as $oNewMbqEtForum) {
             foreach ($objsMbqEtForumTopic as &$oMbqEtForumTopic) {
                 if ($oNewMbqEtForum->forumId->oriValue == $oMbqEtForumTopic->forumId->oriValue) {
                     $oMbqEtForumTopic->oMbqEtForum = $oNewMbqEtForum;
                 }
             }
         }
         /* load topic author */
         $oMbqRdEtUser = MbqMain::$oClk->newObj('MbqRdEtUser');
         $objsAuthorMbqEtUser = $oMbqRdEtUser->getObjsMbqEtUser($authorUserIds, array('case' => 'byUserIds'));
         foreach ($objsMbqEtForumTopic as &$oMbqEtForumTopic) {
             foreach ($objsAuthorMbqEtUser as $oAuthorMbqEtUser) {
                 if ($oMbqEtForumTopic->topicAuthorId->oriValue == $oAuthorMbqEtUser->userId->oriValue) {
                     $oMbqEtForumTopic->oAuthorMbqEtUser = $oAuthorMbqEtUser;
                     if ($oMbqEtForumTopic->oAuthorMbqEtUser->iconUrl->hasSetOriValue()) {
                         $oMbqEtForumTopic->authorIconUrl->setOriValue($oMbqEtForumTopic->oAuthorMbqEtUser->iconUrl->oriValue);
                     }
                     break;
                 }
             }
         }
         /* load oLastReplyMbqEtUser */
         $objsLastReplyMbqEtUser = $oMbqRdEtUser->getObjsMbqEtUser($lastReplyUserIds, array('case' => 'byUserIds'));
         foreach ($objsMbqEtForumTopic as &$oMbqEtForumTopic) {
             foreach ($objsLastReplyMbqEtUser as $oLastReplyMbqEtUser) {
                 if ($oMbqEtForumTopic->lastReplyAuthorId->oriValue == $oLastReplyMbqEtUser->userId->oriValue) {
                     $oMbqEtForumTopic->oLastReplyMbqEtUser = $oLastReplyMbqEtUser;
                     break;
                 }
             }
         }
         /* make other properties */
         $oMbqAclEtForumPost = MbqMain::$oClk->newObj('MbqAclEtForumPost');
         foreach ($objsMbqEtForumTopic as &$oMbqEtForumTopic) {
             if ($oMbqAclEtForumPost->canAclReplyPost($oMbqEtForumTopic)) {
                 $oMbqEtForumTopic->canReply->setOriValue(MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canReply.range.yes'));
             } else {
                 $oMbqEtForumTopic->canReply->setOriValue(MbqBaseFdt::getFdt('MbqFdtForum.MbqEtForumTopic.canReply.range.no'));
             }
         }
         if (isset($mbqOpt['oMbqDataPage'])) {
             $oMbqDataPage = $mbqOpt['oMbqDataPage'];
             $oMbqDataPage->datas = $objsMbqEtForumTopic;
             return $oMbqDataPage;
         } else {
             return $objsMbqEtForumTopic;
         }
         /* common end */
     }
     MbqError::alert('', __METHOD__ . ',line:' . __LINE__ . '.' . MBQ_ERR_INFO_UNKNOWN_CASE);
 }