aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewforum.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-10-21 23:38:55 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-10-21 23:38:55 +0200
commit6c39563e9f7fad18f1425292dca652861f5e1cb6 (patch)
treedbfd7add9a1efe4d42295170aa88782db74d3de4 /phpBB/viewforum.php
parent2fafa5410770e62daf8ba0ffa46cc9ceeec61608 (diff)
downloadforums-6c39563e9f7fad18f1425292dca652861f5e1cb6.tar
forums-6c39563e9f7fad18f1425292dca652861f5e1cb6.tar.gz
forums-6c39563e9f7fad18f1425292dca652861f5e1cb6.tar.bz2
forums-6c39563e9f7fad18f1425292dca652861f5e1cb6.tar.xz
forums-6c39563e9f7fad18f1425292dca652861f5e1cb6.zip
[feature/soft-delete] Add a function to calculate the actual post/topic count
PHPBB3-9567
Diffstat (limited to 'phpBB/viewforum.php')
-rw-r--r--phpBB/viewforum.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 40ef255004..c1d3b2c03c 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -258,7 +258,7 @@ if ($sort_days)
}
else
{
- $topics_count = ($auth->acl_get('m_approve', $forum_id)) ? $forum_data['forum_topics_real'] : $forum_data['forum_topics'];
+ $topics_count = phpbb_content_visibility::get_count('forum_topics', $forum_data, $forum_id);
$sql_limit_time = '';
}
@@ -668,7 +668,7 @@ if (sizeof($topic_list))
$s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
// Replies
- $replies = ($auth->acl_get('m_approve', $topic_forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
+ $replies = phpbb_content_visibility::get_count('topic_posts', $row, $topic_forum_id) - 1;
if ($row['topic_status'] == ITEM_MOVED)
{
@@ -689,11 +689,12 @@ if (sizeof($topic_list))
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
$topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $row['forum_id']));
- $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id']));
- // @TODO: Make this work for cases where some posts within a topic are deleted.
+ $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id']));
$topic_deleted = ($row['topic_visibility'] == ITEM_DELETED);
+ $posts_deleted = ($row['topic_visibility'] == ITEM_DELETED && $row['topic_posts_softdeleted'] && $auth->acl_get('m_approve', $row['forum_id']));
+ //@todo: this is still some kind of wrong!
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $user->session_id) : '';
- $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=deleted_posts&amp;t=' . $topic_id, true, $user->session_id) : $u_mcp_queue;
+ $u_mcp_queue = (!$u_mcp_queue && ($topic_deleted || $posts_deleted)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=deleted_posts&amp;t=' . $topic_id, true, $user->session_id) : $u_mcp_queue;
// Send vars to template
$topic_row = array(