public function getGlobalForumRss()
{
$threadModel = $this->_getThreadModel();
$visitor = XenForo_Visitor::getInstance();
$threadsPerPage = max(1, XenForo_Application::get('options')->discussionsPerPage);
$autoReadDate = XenForo_Application::$time - (XenForo_Application::get('options')->readMarkingDataLifetime * 86400);
$threads = $threadModel->getThreads(
array('find_new' => true, 'last_post_date' => array('>', $autoReadDate)),
array(
'limit' => $threadsPerPage * 3, // to filter
'order' => 'last_post_date',
'join' =>
XenForo_Model_Thread::FETCH_FORUM | XenForo_Model_Thread::FETCH_FORUM_OPTIONS |
XenForo_Model_Thread::FETCH_USER,
'permissionCombinationId' => $visitor['permission_combination_id']
)
);
foreach ($threads AS $key => $thread)
{
$thread['permissions'] = XenForo_Permission::unserializePermissions($thread['node_permission_cache']);
if (!$threadModel->canViewThreadAndContainer($thread, $thread, $null, $thread['permissions']))
{
unset($threads[$key]);
}
}
$threads = array_slice($threads, 0, $threadsPerPage, true);
$viewParams = array(
'threads' => $threads
);
return $this->responseView('XenForo_ViewPublic_Forum_GlobalRss', '', $viewParams);
}