diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2009-04-30 08:15:32 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2009-04-30 08:15:32 +0000 |
commit | 4ea3402f9363c9259881bc8ea6ce7fc6cb212657 (patch) | |
tree | 6ebf080129c673c6a71e243c9db5264fb4b21880 /phpBB/posting.php | |
parent | de617ed0df64cbdfa238f788eef163c09222f1d0 (diff) | |
download | forums-4ea3402f9363c9259881bc8ea6ce7fc6cb212657.tar forums-4ea3402f9363c9259881bc8ea6ce7fc6cb212657.tar.gz forums-4ea3402f9363c9259881bc8ea6ce7fc6cb212657.tar.bz2 forums-4ea3402f9363c9259881bc8ea6ce7fc6cb212657.tar.xz forums-4ea3402f9363c9259881bc8ea6ce7fc6cb212657.zip |
Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9499 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r-- | phpBB/posting.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index cc98e9c496..c16c55111a 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -75,6 +75,16 @@ switch ($mode) trigger_error('NO_TOPIC'); } + // Force forum id + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query($sql); + $f_id = (int) $db->sql_fetchfield('forum_id'); + $db->sql_freeresult($result); + + $forum_id = (!$f_id) ? $forum_id : $f_id; + $sql = 'SELECT f.*, t.* FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f WHERE t.topic_id = $topic_id @@ -91,6 +101,16 @@ switch ($mode) trigger_error('NO_POST'); } + // Force forum id + $sql = 'SELECT forum_id + FROM ' . POSTS_TABLE . ' + WHERE post_id = ' . $post_id; + $result = $db->sql_query($sql); + $f_id = (int) $db->sql_fetchfield('forum_id'); + $db->sql_freeresult($result); + + $forum_id = (!$f_id) ? $forum_id : $f_id; + $sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . " u WHERE p.post_id = $post_id |