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/viewforum.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/viewforum.php')
-rw-r--r-- | phpBB/viewforum.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index c180bd098d..4128fbdfeb 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -246,11 +246,13 @@ $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_po $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param, $default_sort_days, $default_sort_key, $default_sort_dir); +$phpbb_content_visibility = $phpbb_container->get('content.visibility'); + // Limit topics to certain time frame, obtain correct topic count if ($sort_days) { $min_post_time = time() - ($sort_days * 86400); - $sql_visibility = phpbb_content_visibility::get_visibility_sql('topic', $forum_id); + $sql_visibility = $phpbb_content_visibility->get_visibility_sql('topic', $forum_id); $sql = 'SELECT COUNT(topic_id) AS num_topics FROM ' . TOPICS_TABLE . " @@ -274,7 +276,7 @@ if ($sort_days) } else { - $topics_count = phpbb_content_visibility::get_count('forum_topics', $forum_data, $forum_id); + $topics_count = $phpbb_content_visibility->get_count('forum_topics', $forum_data, $forum_id); $sql_limit_time = ''; } @@ -371,7 +373,7 @@ $sql_array = array( 'LEFT_JOIN' => array(), ); -$sql_approved = phpbb_content_visibility::get_visibility_sql('topic', $forum_id, 't.'); +$sql_approved = $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.'); $sql_approved = ($sql_approved) ? ' AND ' . $sql_approved : ''; if ($user->data['is_registered']) @@ -685,7 +687,7 @@ if (sizeof($topic_list)) $s_type_switch_test = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0; // Replies - $replies = phpbb_content_visibility::get_count('topic_posts', $row, $topic_forum_id) - 1; + $replies = $phpbb_content_visibility->get_count('topic_posts', $row, $topic_forum_id) - 1; if ($row['topic_status'] == ITEM_MOVED) { |