if ($forumIds)
{
/* @var $forumModel XenForo_Model_Forum */
$forumModel = XenForo_Model::create('XenForo_Model_Forum');
$visitor = XenForo_Visitor::getInstance();
$permissionCombinationId = $visitor['permission_combination_id'];
$forums = $forumModel->getForumsByIds($forumIds, array(
'permissionCombinationId' => $permissionCombinationId
));
foreach ($forums AS $forum)
{
$visitor->setNodePermissions($forum['node_id'], $forum['node_permission_cache']);
if ($forumModel->canViewForum($forum))
{
$forumData[$forum['node_id']] = array(
'title' => $forum['title'],
'url' => XenForo_Link::buildPublicLink('forums', $forum)
);
}
}
}