diff options
author | Tom Beddard <subblue@users.sourceforge.net> | 2006-01-07 01:07:07 +0000 |
---|---|---|
committer | Tom Beddard <subblue@users.sourceforge.net> | 2006-01-07 01:07:07 +0000 |
commit | df3faf5e207e960722cc3b45de5d22108135382c (patch) | |
tree | 7bc6fcc82a1e7ffcf1a66556a5e360e1a7b0a0d1 | |
parent | 9187d51a4b96ab4030d67c835abce2e39632c419 (diff) | |
download | forums-df3faf5e207e960722cc3b45de5d22108135382c.tar forums-df3faf5e207e960722cc3b45de5d22108135382c.tar.gz forums-df3faf5e207e960722cc3b45de5d22108135382c.tar.bz2 forums-df3faf5e207e960722cc3b45de5d22108135382c.tar.xz forums-df3faf5e207e960722cc3b45de5d22108135382c.zip |
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
-rw-r--r-- | phpBB/includes/ucp/ucp_main.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 8bc98adb3d..8b92ae30b9 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -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); |