diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-10-22 11:14:00 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-10-22 11:14:00 +0200 |
commit | 9945561b4b58e4825fd2290ae1fbbb3d49fd3e7c (patch) | |
tree | e97eabe9c1ad105d829473327661b29535a4f393 /phpBB/includes/mcp | |
parent | 6c39563e9f7fad18f1425292dca652861f5e1cb6 (diff) | |
download | forums-9945561b4b58e4825fd2290ae1fbbb3d49fd3e7c.tar forums-9945561b4b58e4825fd2290ae1fbbb3d49fd3e7c.tar.gz forums-9945561b4b58e4825fd2290ae1fbbb3d49fd3e7c.tar.bz2 forums-9945561b4b58e4825fd2290ae1fbbb3d49fd3e7c.tar.xz forums-9945561b4b58e4825fd2290ae1fbbb3d49fd3e7c.zip |
[feature/soft-delete] Correctly calculate the number of replies everywhere
PHPBB3-9567
Diffstat (limited to 'phpBB/includes/mcp')
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 5 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 9 |
2 files changed, 4 insertions, 10 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 02a1ba6dcc..c04a4d37d4 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -203,7 +203,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $row = &$topic_rows[$topic_id]; - $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; + $replies = phpbb_content_visibility::get_count('topic_posts', $row, $forum_id) - 1; if ($row['topic_status'] == ITEM_MOVED) { @@ -220,6 +220,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $topic_title = censor_text($row['topic_title']); + // @todo: $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; $topic_deleted = ($row['topic_visibility'] == ITEM_DELETED) ? true : false; @@ -248,7 +249,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'TOPIC_TYPE' => $topic_type, 'TOPIC_TITLE' => $topic_title, - 'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'], + 'REPLIES' => phpbb_content_visibility::get_count('topic_posts', $row, $row['forum_id']) - 1, 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 8320699a8c..0259a12ca8 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -115,14 +115,7 @@ function mcp_topic_view($id, $mode, $action) if ($total == -1) { - if ($auth->acl_get('m_approve', $topic_info['forum_id'])) - { - $total = $topic_info['topic_replies_real'] + 1; - } - else - { - $total = $topic_info['topic_replies'] + 1; - } + $total = phpbb_content_visibility::get_count('topic_posts', $topic_info, $topic_info['forum_id']); } $posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page']))); |