Jaxel
Well-known member
This is the code I am using to retrieve thread information:
For some reason, its not excluding thread information that the user can't view... such as threads from private forums. It displays all threads, no matter the permission requirements of the forum.
Code:
public function getThreads()
{
$options = XenForo_Application::get('options');
$visitorID = XenForo_Visitor::getUserId();
$conditions = array(
'deleted' => false,
'moderated' => false,
);
$fetchOptions = array(
'join' => XenForo_Model_Thread::FETCH_FORUM | XenForo_Model_Thread::FETCH_USER,
'readUserId' => $visitorID,
'postCountUserId' => $visitorID,
'permissionCombinationId' => $visitorID,
'order' => 'last_post_date',
'orderDirection' => 'desc',
'limit' => $options->EWRporta_threadcount,
);
$threads = $this->getModelFromCache('XenForo_Model_Thread')->getThreads($conditions, $fetchOptions);
foreach ($threads AS &$thread)
{
$thread = $this->getModelFromCache('XenForo_Model_Thread')->prepareThread($thread, $thread);
$thread['canInlineMod'] = false;
$thread['canEditThread'] = false;
}
return $threads;
}
For some reason, its not excluding thread information that the user can't view... such as threads from private forums. It displays all threads, no matter the permission requirements of the forum.