From efbf14f029b7e6a1724fb1c5aa32294eb33017bc Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 22 May 2012 03:08:39 +0200 Subject: [ticket/10565] update_forum_tracking_info(): Remove unnecessary GROUP BY clause PHPBB3-10565 --- phpBB/includes/functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ce80dc4a66..b415b2742d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1924,8 +1924,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti AND t.topic_last_post_time > ' . $mark_time_forum . ' AND t.topic_moved_id = 0 ' . $sql_update_unapproved . ' - AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time) - GROUP BY t.forum_id'; + AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time)'; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); -- cgit v1.2.1 From 896b43aa5b7fe439106beb50cf56d6f066928537 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 22 May 2012 03:11:53 +0200 Subject: [ticket/10565] Add line breaks to query in order to follow coding guidelines. PHPBB3-10565 --- phpBB/includes/functions.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index b415b2742d..bc811cc75b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1918,13 +1918,17 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti } else { - $sql = 'SELECT t.forum_id FROM ' . TOPICS_TABLE . ' t - LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ') + $sql = 'SELECT t.forum_id + FROM ' . TOPICS_TABLE . ' t + LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt + ON (tt.topic_id = t.topic_id + AND tt.user_id = ' . $user->data['user_id'] . ') WHERE t.forum_id = ' . $forum_id . ' AND t.topic_last_post_time > ' . $mark_time_forum . ' AND t.topic_moved_id = 0 ' . $sql_update_unapproved . ' - AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time)'; + AND (tt.topic_id IS NULL + OR tt.mark_time < t.topic_last_post_time)'; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); -- cgit v1.2.1