Fix for SQL error when the $forum_ary array is empty when there are no global announcements to view

git-svn-id: file:///svn/phpbb/trunk@5435 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Tom Beddard 2006-01-07 01:07:07 +00:00
parent 9187d51a4b
commit df3faf5e20

View file

@ -60,8 +60,12 @@ class ucp_main
// Determine first forum the user is able to read into - for global announcement link
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST . '
AND forum_id NOT IN (' . implode(', ', $forum_ary) . ')';
WHERE forum_type = ' . FORUM_POST;
if (sizeof($forum_ary))
{
$sql .= ' AND forum_id NOT IN ( ' . implode(', ', $forum_ary) . ')';
}
$result = $db->sql_query_limit($sql, 1);
$g_forum_id = (int) $db->sql_fetchfield('forum_id', 0, $result);
$db->sql_freeresult($result);