mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-22 02:50:00 +01:00
[ticket/12459] Fix: Soft deleted topics should appear in feeds
As for the posts, a soft deleted topic should appear (with a corresponding message) in topic's based feeds. PHPBB3-12459
This commit is contained in:
parent
68293450f9
commit
9dc4e5a61f
@ -740,6 +740,7 @@ $lang = array_merge($lang, array(
|
||||
'TOPIC_REVIEW' => 'Topic review',
|
||||
'TOPIC_TITLE' => 'Topic title',
|
||||
'TOPIC_UNAPPROVED' => 'This topic has not been approved',
|
||||
'TOPIC_DELETED' => 'Deleted topic:',
|
||||
'TOTAL_ATTACHMENTS' => 'Attachment(s)',
|
||||
'TOTAL_LOGS' => array(
|
||||
1 => '%d log',
|
||||
|
@ -64,9 +64,8 @@ class news extends \phpbb\feed\topic_base
|
||||
// We really have to get the post ids first!
|
||||
$sql = 'SELECT topic_first_post_id, topic_time
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $this->db->sql_in_set('forum_id', $in_fid_ary) . '
|
||||
AND topic_moved_id = 0
|
||||
AND topic_visibility = ' . ITEM_APPROVED . '
|
||||
WHERE topic_moved_id = 0
|
||||
AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->num_items);
|
||||
|
||||
@ -85,7 +84,7 @@ class news extends \phpbb\feed\topic_base
|
||||
$this->sql = array(
|
||||
'SELECT' => 'f.forum_id, f.forum_name,
|
||||
t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time,
|
||||
p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment',
|
||||
p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
|
||||
'FROM' => array(
|
||||
TOPICS_TABLE => 't',
|
||||
POSTS_TABLE => 'p',
|
||||
|
@ -45,9 +45,24 @@ abstract class topic_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->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'] : '');
|
||||
. ' ' . $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'];
|
||||
|
||||
if ($this->is_moderator_approve_forum($row['forum_id']))
|
||||
{
|
||||
if ( (int)$row['topic_visibility'] === ITEM_DELETED)
|
||||
{
|
||||
$item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_DELETED'];
|
||||
}
|
||||
else if ((int)$row['topic_visibility'] === ITEM_UNAPPROVED)
|
||||
{
|
||||
$item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['TOPIC_UNAPPROVED'];
|
||||
}
|
||||
else if ($row['topic_posts_unapproved'])
|
||||
{
|
||||
$item_row['statistics'] .= ' ' . $this->separator_stats . ' ' . $this->user->lang['POSTS_UNAPPROVED'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,9 +36,8 @@ class topics extends \phpbb\feed\topic_base
|
||||
// We really have to get the post ids first!
|
||||
$sql = 'SELECT topic_first_post_id, topic_time
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $this->db->sql_in_set('forum_id', $in_fid_ary) . '
|
||||
AND topic_moved_id = 0
|
||||
AND topic_visibility = ' . ITEM_APPROVED . '
|
||||
WHERE topic_moved_id = 0
|
||||
AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
|
||||
ORDER BY topic_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->num_items);
|
||||
|
||||
@ -57,7 +56,7 @@ class topics extends \phpbb\feed\topic_base
|
||||
$this->sql = array(
|
||||
'SELECT' => 'f.forum_id, f.forum_name,
|
||||
t.topic_id, t.topic_title, t.topic_poster, t.topic_first_poster_name, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views, t.topic_time, t.topic_last_post_time,
|
||||
p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment',
|
||||
p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
|
||||
'FROM' => array(
|
||||
TOPICS_TABLE => 't',
|
||||
POSTS_TABLE => 'p',
|
||||
|
@ -51,9 +51,8 @@ class topics_active extends \phpbb\feed\topic_base
|
||||
// We really have to get the post ids first!
|
||||
$sql = 'SELECT topic_last_post_id, topic_last_post_time
|
||||
FROM ' . TOPICS_TABLE . '
|
||||
WHERE ' . $this->db->sql_in_set('forum_id', $in_fid_ary) . '
|
||||
AND topic_moved_id = 0
|
||||
AND topic_visibility = ' . ITEM_APPROVED . '
|
||||
WHERE topic_moved_id = 0
|
||||
AND ' . $this->content_visibility->get_forums_visibility_sql('topic', $in_fid_ary) . '
|
||||
' . $last_post_time_sql . '
|
||||
ORDER BY topic_last_post_time DESC';
|
||||
$result = $this->db->sql_query_limit($sql, $this->num_items);
|
||||
@ -74,7 +73,7 @@ class topics_active extends \phpbb\feed\topic_base
|
||||
'SELECT' => 'f.forum_id, f.forum_name,
|
||||
t.topic_id, t.topic_title, t.topic_posts_approved, t.topic_posts_unapproved, t.topic_posts_softdeleted, t.topic_views,
|
||||
t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_post_time,
|
||||
p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment',
|
||||
p.post_id, p.post_time, p.post_edit_time, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, t.topic_visibility',
|
||||
'FROM' => array(
|
||||
TOPICS_TABLE => 't',
|
||||
POSTS_TABLE => 'p',
|
||||
|
Loading…
x
Reference in New Issue
Block a user