public function getPostsInThread($threadId, array $fetchOptions = array())
{
$options = XenForo_Application::get('options');
if ($options->EWRporta_globalize['article'])
{
$fetchOptions['join'] += self::FETCH_THREAD;
$limitOptions = $this->prepareLimitFetchOptions($fetchOptions);
$stateLimit = $this->prepareStateLimitFromConditions($fetchOptions, 'post');
$joinOptions = $this->preparePostJoinOptions($fetchOptions);
return $this->fetchAllKeyed('
SELECT post.*
' . $joinOptions['selectFields'] . '
FROM xf_post AS post
' . $joinOptions['joinTables'] . '
WHERE post.thread_id = ?
AND (((' . $stateLimit . ')
' . $this->addPositionLimit('post', $limitOptions['limit'], $limitOptions['offset']) . ')
OR post.post_id = thread.first_post_id)
ORDER BY post.position ASC, post.post_date ASC
', 'post_id', $threadId);
}
return parent::getPostsInThread($threadId, $fetchOptions);
}