mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 16:27:38 +02:00
[feature/soft-delete] Correctly calculate the number of replies everywhere
PHPBB3-9567
This commit is contained in:
@@ -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'],
|
||||
|
@@ -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'])));
|
||||
|
@@ -778,7 +778,7 @@ class ucp_main
|
||||
$unread_topic = (isset($topic_tracking_info[$topic_id]) && $row['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
|
||||
|
||||
// Replies
|
||||
$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 && !empty($row['topic_moved_id']))
|
||||
{
|
||||
|
Reference in New Issue
Block a user