diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2013-07-11 14:24:07 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2013-07-11 14:24:07 +0200 |
commit | 9aed758c1397c31b979f4aca51249c73d21bd6f5 (patch) | |
tree | 03c13aa87f3aa0ca892fe8bca937d2de7054bff5 /phpBB/includes/mcp/mcp_topic.php | |
parent | 9f89cb4cfbbd46ad45a9c7942fc2233b489bb076 (diff) | |
download | forums-9aed758c1397c31b979f4aca51249c73d21bd6f5.tar forums-9aed758c1397c31b979f4aca51249c73d21bd6f5.tar.gz forums-9aed758c1397c31b979f4aca51249c73d21bd6f5.tar.bz2 forums-9aed758c1397c31b979f4aca51249c73d21bd6f5.tar.xz forums-9aed758c1397c31b979f4aca51249c73d21bd6f5.zip |
[ticket/9657] Use the service instead of the static class
PHPBB3-9657
Diffstat (limited to 'phpBB/includes/mcp/mcp_topic.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 1d2030edb1..d0e4a2e057 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -21,7 +21,7 @@ if (!defined('IN_PHPBB')) function mcp_topic_view($id, $mode, $action) { global $phpEx, $phpbb_root_path, $config; - global $template, $db, $user, $auth, $cache; + global $template, $db, $user, $auth, $cache, $phpbb_container; $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); @@ -112,10 +112,11 @@ function mcp_topic_view($id, $mode, $action) 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 p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; + $phpbb_content_visibility = $phpbb_container->get('content.visibility'); if ($total == -1) { - $total = phpbb_content_visibility::get_count('topic_posts', $topic_info, $topic_info['forum_id']); + $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']))); @@ -139,7 +140,7 @@ function mcp_topic_view($id, $mode, $action) FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . ' p.topic_id = ' . $topic_id . ' - AND ' . phpbb_content_visibility::get_visibility_sql('post', $topic_info['forum_id'], 'p.') . ' + AND ' . $phpbb_content_visibility->get_visibility_sql('post', $topic_info['forum_id'], 'p.') . ' AND p.poster_id = u.user_id ' . $limit_time_sql . ' ORDER BY ' . $sort_order_sql; |