diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-08-23 11:43:45 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-08-23 11:43:45 +0000 |
| commit | c7a0d176722ff508ba8dbefe2e1407efca06e46c (patch) | |
| tree | 0c20c2b85ede1a706ab3e0615b776cadfe28b501 /phpBB | |
| parent | 714f77f6cebcaf2c54d83cb03fc0045f8b43eebb (diff) | |
| download | forums-c7a0d176722ff508ba8dbefe2e1407efca06e46c.tar forums-c7a0d176722ff508ba8dbefe2e1407efca06e46c.tar.gz forums-c7a0d176722ff508ba8dbefe2e1407efca06e46c.tar.bz2 forums-c7a0d176722ff508ba8dbefe2e1407efca06e46c.tar.xz forums-c7a0d176722ff508ba8dbefe2e1407efca06e46c.zip | |
Fixed problem with not all topics being displayed when there were announcements
git-svn-id: file:///svn/phpbb/trunk@916 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
| -rw-r--r-- | phpBB/viewforum.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index bc47f2c9c9..ad8d132cdc 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -255,8 +255,7 @@ $sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as i AND t.topic_poster = u.user_id AND p.post_id = t.topic_last_post_id AND p.poster_id = u2.user_id - AND ( t.topic_type = " . POST_GLOBAL_ANNOUNCE . " - OR t.topic_type = " . POST_ANNOUNCE . " ) + AND t.topic_type = " . POST_ANNOUNCE . " ORDER BY p.post_time DESC"; if(!$ta_result = $db->sql_query($sql)) { @@ -265,6 +264,11 @@ if(!$ta_result = $db->sql_query($sql)) $total_announcements = $db->sql_numrows($ta_result); // +// Total topics ... +// +$total_topics += $total_announcements; + +// // Define censored word matches // $sql = "SELECT word, replacement @@ -374,21 +378,21 @@ $template->assign_vars(array( // // Okay, lets dump out the page ... // -if($total_topics || $total_announcements) +if($total_topics) { // // First get announcements // - while( $row = $db->sql_fetchrow($ta_result) ) + while( $ta_row = $db->sql_fetchrow($ta_result) ) { - $topic_rowset[] = $row; + $topic_rowset[] = $ta_row; } // // Now get everything else // - while( $row = $db->sql_fetchrow($t_result) ) + while( $t_row = $db->sql_fetchrow($t_result) ) { - $topic_rowset[] = $row; + $topic_rowset[] = $t_row; } for($i = 0; $i < $total_topics; $i++) @@ -461,10 +465,8 @@ if($total_topics || $total_announcements) $topic_type = $lang['Topic_Moved'] . " "; $topic_id = $topic_rowset[$i]['topic_moved_id']; } - else { - if($topic_rowset[$i]['topic_type'] == POST_ANNOUNCE) { $folder = $images['folder_announce']; @@ -520,7 +522,6 @@ if($total_topics || $total_announcements) $folder_image = "<img src=\"$folder\" alt=\"" . $lang['No_new_posts'] . "\" />"; } } - } $view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"); |
