1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/9657] Use the service instead of the static class

PHPBB3-9657
This commit is contained in:
Joas Schilling
2013-07-11 14:24:07 +02:00
parent 9f89cb4cfb
commit 9aed758c13
19 changed files with 102 additions and 63 deletions

View File

@@ -80,10 +80,11 @@ abstract class phpbb_feed_base
* @param phpbb_cache_driver_interface $cache Cache object
* @param phpbb_user $user User object
* @param phpbb_auth $auth Auth object
* @param phpbb_content_visibility $content_visibility Auth object
* @param string $phpEx php file extension
* @return null
*/
function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, $phpEx)
function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, $content_visibility, $phpEx)
{
$this->config = $config;
$this->helper = $helper;
@@ -91,6 +92,7 @@ abstract class phpbb_feed_base
$this->cache = $cache;
$this->user = $user;
$this->auth = $auth;
$this->content_visibility = $content_visibility;
$this->phpEx = $phpEx;
$this->set_keys();

View File

@@ -90,7 +90,7 @@ class phpbb_feed_forum extends phpbb_feed_post_base
function get_sql()
{
$sql_visibility = phpbb_content_visibility::get_visibility_sql('topic', $this->forum_id);
$sql_visibility = $this->content_visibility->get_visibility_sql('topic', $this->forum_id);
// Determine topics with recent activity
$sql = 'SELECT topic_id, topic_last_post_time
@@ -116,7 +116,7 @@ class phpbb_feed_forum extends phpbb_feed_post_base
return false;
}
$sql_visibility = phpbb_content_visibility::get_visibility_sql('post', $this->forum_id, 'p.');
$sql_visibility = $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.');
$this->sql = array(
'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .

View File

@@ -37,7 +37,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
$sql = 'SELECT topic_id, topic_last_post_time
FROM ' . TOPICS_TABLE . '
WHERE topic_moved_id = 0
AND ' . phpbb_content_visibility::get_forums_visibility_sql('topic', $forum_ids) . '
AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $forum_ids) . '
ORDER BY topic_last_post_time DESC';
$result = $this->db->sql_query_limit($sql, $this->num_items);
@@ -56,7 +56,7 @@ class phpbb_feed_overall extends phpbb_feed_post_base
return false;
}
$sql_visibility = phpbb_content_visibility::get_visibility_sql('post', array(), 'p.');
$sql_visibility = $this->content_visibility->get_visibility_sql('post', array(), 'p.');
// Get the actual data
$this->sql = array(

View File

@@ -93,7 +93,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
function get_sql()
{
$sql_visibility = phpbb_content_visibility::get_visibility_sql('post', $this->forum_id, 'p.');
$sql_visibility = $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.');
$this->sql = array(
'SELECT' => 'p.post_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .

View File

@@ -51,7 +51,7 @@ abstract class phpbb_feed_topic_base extends phpbb_feed_base
{
$item_row['statistics'] = $this->user->lang['POSTED'] . ' ' . $this->user->lang['POST_BY_AUTHOR'] . ' ' . $this->user_viewprofile($row)
. ' ' . $this->separator_stats . ' ' . $this->user->format_date($row[$this->get('published')])
. ' ' . $this->separator_stats . ' ' . $this->user->lang['REPLIES'] . ' ' . phpbb_content_visibility::get_count('topic_posts', $row, $row['forum_id']) - 1
. ' ' . $this->separator_stats . ' ' . $this->user->lang['REPLIES'] . ' ' . $this->content_visibility->get_count('topic_posts', $row, $row['forum_id']) - 1
. ' ' . $this->separator_stats . ' ' . $this->user->lang['VIEWS'] . ' ' . $row['topic_views']
. (($this->is_moderator_approve_forum($row['forum_id']) && $row['topic_posts_unapproved']) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POSTS_UNAPPROVED'] : '');
}