From e7f970e26d636d69ea742bf591dc5fc9dc15a0a9 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 16 Apr 2014 23:41:10 +0200 Subject: [ticket/12413] Fatal Error for feed.php?mode=forums https://tracker.phpbb.com/browse/PHPBB3-12413 http://area51.phpbb.com/phpBB/viewtopic.php?f=81&t=45475 PHPBB3-12413 --- phpBB/phpbb/feed/post_base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/feed/post_base.php') diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php index c797d6a8ca..57eb70ea12 100644 --- a/phpBB/phpbb/feed/post_base.php +++ b/phpBB/phpbb/feed/post_base.php @@ -14,7 +14,7 @@ namespace phpbb\feed; * * @package phpBB3 */ -abstract class post_base extends \phpbb\feed\base +abstract class post_base extends \phpbb\feed\attachments_base { var $num_items = 'feed_limit_post'; var $attachments = array(); -- cgit v1.2.1 From 7d8d8394fc36b1564ea083447329ab9f54a3db01 Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Fri, 25 Apr 2014 17:00:24 +0200 Subject: [ticket/12413] Fix: coding style PHPBB3-12413 --- phpBB/phpbb/feed/post_base.php | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'phpBB/phpbb/feed/post_base.php') diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php index 57eb70ea12..de98f446f3 100644 --- a/phpBB/phpbb/feed/post_base.php +++ b/phpBB/phpbb/feed/post_base.php @@ -49,41 +49,4 @@ abstract class post_base extends \phpbb\feed\attachments_base . (($this->is_moderator_approve_forum($row['forum_id']) && $row['post_visibility'] !== ITEM_APPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : ''); } } - - function fetch_attachments() - { - $sql_array = array( - 'SELECT' => 'a.*', - 'FROM' => array( - ATTACHMENTS_TABLE => 'a' - ), - 'WHERE' => 'a.in_message = 0 ', - 'ORDER_BY' => 'a.filetime DESC, a.post_msg_id ASC', - ); - - if (isset($this->topic_id)) - { - $sql_array['WHERE'] .= 'AND a.topic_id = ' . (int) $this->topic_id; - } - else if (isset($this->forum_id)) - { - $sql_array['LEFT_JOIN'] = array( - array( - 'FROM' => array(TOPICS_TABLE => 't'), - 'ON' => 'a.topic_id = t.topic_id', - ) - ); - $sql_array['WHERE'] .= 'AND t.forum_id = ' . (int) $this->forum_id; - } - - $sql = $this->db->sql_build_query('SELECT', $sql_array); - $result = $this->db->sql_query($sql); - - // Set attachments in feed items - while ($row = $this->db->sql_fetchrow($result)) - { - $this->attachments[$row['post_msg_id']][] = $row; - } - $this->db->sql_freeresult($result); - } } -- cgit v1.2.1 From 68293450f98b97e7f0bf3d62f5835ae08dbbea09 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 17 Apr 2014 20:00:06 +0200 Subject: [ticket/12459] Fix: the posts were always marked as unapproved the database return a string, so the strict comparison always returned false PHPBB3-12459 --- phpBB/phpbb/feed/post_base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/feed/post_base.php') diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php index de98f446f3..cf1b59a090 100644 --- a/phpBB/phpbb/feed/post_base.php +++ b/phpBB/phpbb/feed/post_base.php @@ -46,7 +46,7 @@ abstract class post_base extends \phpbb\feed\attachments_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->is_moderator_approve_forum($row['forum_id']) && $row['post_visibility'] !== ITEM_APPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : ''); + . (($this->is_moderator_approve_forum($row['forum_id']) && (int)$row['post_visibility'] !== ITEM_APPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : ''); } } } -- cgit v1.2.1 From 3bf61d4df044d8ca5d65381d7b0081327d6912e9 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 20 Apr 2014 18:35:31 +0200 Subject: [ticket/12459] Fix: Differentiating unapproved and deleted posts Unapproved and deleted posts should not be displayed with the same message (POST_UNAPPROVED) PHPBB3-12459 --- phpBB/phpbb/feed/post_base.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/feed/post_base.php') diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php index cf1b59a090..cfcd8671a3 100644 --- a/phpBB/phpbb/feed/post_base.php +++ b/phpBB/phpbb/feed/post_base.php @@ -46,7 +46,8 @@ abstract class post_base extends \phpbb\feed\attachments_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->is_moderator_approve_forum($row['forum_id']) && (int)$row['post_visibility'] !== ITEM_APPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : ''); + . (($this->is_moderator_approve_forum($row['forum_id']) && (int)$row['post_visibility'] === ITEM_UNAPPROVED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_UNAPPROVED'] : '') + . (($this->is_moderator_approve_forum($row['forum_id']) && (int)$row['post_visibility'] === ITEM_DELETED) ? ' ' . $this->separator_stats . ' ' . $this->user->lang['POST_DELETED'] : ''); } } } -- cgit v1.2.1