protected function get_topic_auth(array $topic_ids)
{
$forum_auth = array('f_read' => array(), 'm_' => array());
$topic_ids = array_unique($topic_ids);
$sql = 'SELECT topic_id, forum_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $this->db->sql_in_set('topic_id', array_map('intval', $topic_ids));
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result)) {
$row['topic_id'] = (int) $row['topic_id'];
$row['forum_id'] = (int) $row['forum_id'];
if ($this->auth->acl_get('f_read', $row['forum_id'])) {
$forum_auth['f_read'][$row['topic_id']] = $row['forum_id'];
}
if ($this->auth->acl_gets('a_', 'm_', $row['forum_id'])) {
$forum_auth['m_'][$row['topic_id']] = $row['forum_id'];
}
}
$this->db->sql_freeresult($result);
return $forum_auth;
}