From db952fe0945ecfa1594297e8c436fde7d1d4e2b2 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 5 May 2007 14:29:49 +0000 Subject: [PATCH] #9873 git-svn-id: file:///svn/phpbb/trunk@7473 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/mcp/mcp_topic.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index b9f66082fe..ba9c681d4e 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -81,7 +81,7 @@ function mcp_topic_view($id, $mode, $action) $sort_by_sql = $sort_order_sql = array(); mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql); - $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : ''; + $limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; if ($total == -1) { @@ -99,7 +99,8 @@ function mcp_topic_view($id, $mode, $action) WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . ' p.topic_id = ' . $topic_id . ' ' . ((!$auth->acl_get('m_approve', $topic_info['forum_id'])) ? ' AND p.post_approved = 1 ' : '') . ' - AND p.poster_id = u.user_id + AND p.poster_id = u.user_id ' . + $limit_time_sql . ' ORDER BY ' . $sort_order_sql; $result = $db->sql_query_limit($sql, $posts_per_page, $start); @@ -132,9 +133,10 @@ function mcp_topic_view($id, $mode, $action) $topic_tracking_info = get_complete_topic_tracking($topic_info['forum_id'], $topic_id); } + $has_unapproved_posts = false; + foreach ($rowset as $i => $row) { - $has_unapproved_posts = false; $message = $row['post_text']; $post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : $topic_info['topic_title'];