From 5f0c024f0c4f9f6b88e2e3ac94d7c5a74e956672 Mon Sep 17 00:00:00 2001 From: gpolins Date: Sun, 19 Aug 2001 22:09:33 +0000 Subject: [PATCH] Fixed moved topic in sync git-svn-id: file:///svn/phpbb/trunk@907 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1b65481e8e..5d37cc724a 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -526,7 +526,7 @@ function sync($type, $id) switch($type) { case 'forum': - $sql = "SELECT max(post_id) AS last_post FROM ".POSTS_TABLE." WHERE forum_id = $id"; + $sql = "SELECT max(p.post_id) AS last_post FROM ".POSTS_TABLE." p, ".TOPICS_TABLE." t WHERE p.forum_id = $id AND p.topic_id = t.topic_id AND t.topic_status <> ".TOPIC_MOVED; if(!$result = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not get post ID", "Error", __LINE__, __FILE__, $sql);