protected function _getAllThreads($tableid, $num, $tid = 0, $orderType = 'ASC') { $result = array(); $orderType = strtoupper($orderType) == 'DESC' ? 'DESC' : 'ASC'; $glue = $orderType == 'DESC' ? '<' : '>'; $key = $orderType == 'DESC' ? 'minTid' : 'maxTid'; $tIds = $vtIds = array(); foreach (C::t('forum_thread')->fetch_all_new_thread_by_tid($tid, 0, $num, $tableid, $glue, $orderType) as $thread) { $result[$key] = $thread['tid']; $result['data'][$thread['tid']] = Cloud_Service_SearchHelper::convertThread($thread); if ($result['data'][$thread['tid']]['specialType'] == 'poll') { $vtIds[] = $thread['tid']; } } if (!empty($vtIds)) { $polls = Cloud_Service_SearchHelper::getPollInfo($vtIds); foreach ($polls as $tId => $poll) { $result['data'][$tId]['pollInfo'] = $poll; } } return $result; }