From 5177807da135f67f5435cbcad407ca190093c3fa Mon Sep 17 00:00:00 2001 From: Bart van Bragt Date: Thu, 19 Jun 2003 19:21:10 +0000 Subject: [PATCH] Removed extraneous 2 joins to posts table on next/prev topic links git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@4153 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewtopic.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index e1cea49b0d..3aba35e79e 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -103,14 +103,12 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) ) $sql_ordering = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'ASC' : 'DESC'; $sql = "SELECT t.topic_id - FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2 - WHERE t2.topic_id = $topic_id - AND p2.post_id = t2.topic_last_post_id + FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2 + WHERE + t2.topic_id = $topic_id AND t.forum_id = t2.forum_id - AND p.post_id = t.topic_last_post_id - AND p.post_time $sql_condition p2.post_time - AND p.topic_id = t.topic_id - ORDER BY p.post_time $sql_ordering + AND t.topic_last_post_id $sql_condition t2.topic_last_post_id + ORDER BY t.topic_last_post_id $sql_ordering LIMIT 1"; if ( !($result = $db->sql_query($sql)) ) {