mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 22:08:54 +00:00
[feature/soft-delete] Split unapproved/soft deleted posts from topics
If a topic is soft deleted through a moderator, the topic_delete_user is set. If it is passively soft deleted (f.e. while the only approved post is deleted) the topic_delete_user is not set. This way, we can distinguish between these two cases. The same also applies to unapproved posts. So we need to set the topic_delete_user when an unapproved topic is posted. Topics that were soft deleted/unapproved by a user (rather then passive) are going to be displayed in the Topics modules, while all others are in the posts modules of the MCP queue. PHPBB3-9567
This commit is contained in:
parent
2adb37049e
commit
0822d2bb61
2 changed files with 4 additions and 1 deletions
|
@ -1864,6 +1864,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
|||
'forum_id' => $data['forum_id'],
|
||||
'icon_id' => $data['icon_id'],
|
||||
'topic_visibility' => $post_visibility,
|
||||
'topic_delete_user' => ($post_visibility != ITEM_APPROVED) ? (int) $user->data['user_id'] : 0,
|
||||
'topic_title' => $subject,
|
||||
'topic_first_poster_name' => (!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : ''),
|
||||
'topic_first_poster_colour' => $user->data['user_colour'],
|
||||
|
|
|
@ -335,7 +335,8 @@ class mcp_queue
|
|||
' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
|
||||
' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
|
||||
AND t.topic_id = p.topic_id
|
||||
AND t.topic_visibility <> p.post_visibility
|
||||
AND (t.topic_visibility <> p.post_visibility
|
||||
OR t.topic_delete_user = 0)
|
||||
$limit_time_sql
|
||||
ORDER BY $sort_order_sql";
|
||||
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
|
||||
|
@ -384,6 +385,7 @@ class mcp_queue
|
|||
FROM ' . TOPICS_TABLE . ' t
|
||||
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
|
||||
AND topic_visibility = ' . $visibility_const . "
|
||||
AND topic_delete_user <> 0
|
||||
$limit_time_sql
|
||||
ORDER BY $sort_order_sql";
|
||||
$result = $db->sql_query_limit($sql, $config['topics_per_page'], $start);
|
||||
|
|
Loading…
Add table
Reference in a new issue