From 9aed758c1397c31b979f4aca51249c73d21bd6f5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 Jul 2013 14:24:07 +0200 Subject: [ticket/9657] Use the service instead of the static class PHPBB3-9657 --- phpBB/includes/feed/topic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/feed/topic.php') diff --git a/phpBB/includes/feed/topic.php b/phpBB/includes/feed/topic.php index 42bd291343..10f86486c6 100644 --- a/phpBB/includes/feed/topic.php +++ b/phpBB/includes/feed/topic.php @@ -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, ' . -- cgit v1.2.1 From 5ab0090e6c9fa1b497938a932cdf28ba55a17e7c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 Jul 2013 22:35:55 -0400 Subject: [ticket/9657] Remove sql_visibility as it is always non-empty PHPBB3-9657 --- phpBB/includes/feed/topic.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'phpBB/includes/feed/topic.php') diff --git a/phpBB/includes/feed/topic.php b/phpBB/includes/feed/topic.php index 10f86486c6..36f958ac60 100644 --- a/phpBB/includes/feed/topic.php +++ b/phpBB/includes/feed/topic.php @@ -93,8 +93,6 @@ class phpbb_feed_topic extends phpbb_feed_post_base function get_sql() { - $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, ' . 'u.username, u.user_id', @@ -103,7 +101,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base USERS_TABLE => 'u', ), 'WHERE' => 'p.topic_id = ' . $this->topic_id . ' - ' . (($sql_visibility) ? ' AND ' . $sql_visibility : '') . ' + AND ' . $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.') . ' AND p.poster_id = u.user_id', 'ORDER_BY' => 'p.post_time DESC', ); -- cgit v1.2.1 From 7030578bbe9e11c18b5becaf8b06e670e3c2e3cd Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 14 Jul 2013 01:32:34 -0400 Subject: [ticket/11698] Moving all autoloadable files to phpbb/ PHPBB3-11698 --- phpBB/includes/feed/topic.php | 116 ------------------------------------------ 1 file changed, 116 deletions(-) delete mode 100644 phpBB/includes/feed/topic.php (limited to 'phpBB/includes/feed/topic.php') diff --git a/phpBB/includes/feed/topic.php b/phpBB/includes/feed/topic.php deleted file mode 100644 index 36f958ac60..0000000000 --- a/phpBB/includes/feed/topic.php +++ /dev/null @@ -1,116 +0,0 @@ -num_items} posts made within this topic. -* -* @package phpBB3 -*/ -class phpbb_feed_topic extends phpbb_feed_post_base -{ - var $topic_id = 0; - var $forum_id = 0; - var $topic_data = array(); - - /** - * Set the Topic ID - * - * @param int $topic_id Topic ID - * @return phpbb_feed_topic - */ - public function set_topic_id($topic_id) - { - $this->topic_id = (int) $topic_id; - - return $this; - } - - function open() - { - $sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_replies, t.topic_type - FROM ' . TOPICS_TABLE . ' t - LEFT JOIN ' . FORUMS_TABLE . ' f - ON (f.forum_id = t.forum_id) - WHERE t.topic_id = ' . $this->topic_id; - $result = $this->db->sql_query($sql); - $this->topic_data = $this->db->sql_fetchrow($result); - $this->db->sql_freeresult($result); - - if (empty($this->topic_data)) - { - trigger_error('NO_TOPIC'); - } - - $this->forum_id = (int) $this->topic_data['forum_id']; - - // Make sure topic is either approved or user authed - if (!$this->topic_data['topic_approved'] && !$this->auth->acl_get('m_approve', $this->forum_id)) - { - trigger_error('SORRY_AUTH_READ'); - } - - // Make sure forum is not excluded from feed - if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->topic_data['forum_options'])) - { - trigger_error('NO_FEED'); - } - - // Make sure we can read this forum - if (!$this->auth->acl_get('f_read', $this->forum_id)) - { - trigger_error('SORRY_AUTH_READ'); - } - - // Make sure forum is not passworded or user is authed - if ($this->topic_data['forum_password']) - { - $forum_ids_passworded = $this->get_passworded_forums(); - - if (isset($forum_ids_passworded[$this->forum_id])) - { - trigger_error('SORRY_AUTH_READ'); - } - - unset($forum_ids_passworded); - } - } - - function get_sql() - { - $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, ' . - 'u.username, u.user_id', - 'FROM' => array( - POSTS_TABLE => 'p', - USERS_TABLE => 'u', - ), - 'WHERE' => 'p.topic_id = ' . $this->topic_id . ' - AND ' . $this->content_visibility->get_visibility_sql('post', $this->forum_id, 'p.') . ' - AND p.poster_id = u.user_id', - 'ORDER_BY' => 'p.post_time DESC', - ); - - return true; - } - - function get_item() - { - return ($row = parent::get_item()) ? array_merge($this->topic_data, $row) : $row; - } -} -- cgit v1.2.1