mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-07 01:06:48 +02:00
[feature/soft-delete] Implement the ability to soft-delete and restore posts
The soft delete feature seems to work. Tests are pending. A real icon is pending. Add the permissions and the interface to soft-delete posts. Also able to restore posts via the MCP queue PHPBB3-9657
This commit is contained in:
committed by
Joas Schilling
parent
c32d760806
commit
fb13ab83e4
@@ -640,6 +640,8 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
|
||||
break;
|
||||
|
||||
case 'unapproved_posts':
|
||||
case 'deleted_posts':
|
||||
$visibility_const = ($mode == 'unapproved_posts') ? ITEM_UNAPPROVED : ITEM_DELETED;
|
||||
$type = 'posts';
|
||||
$default_key = 't';
|
||||
$default_dir = 'd';
|
||||
@@ -648,7 +650,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
|
||||
$sql = 'SELECT COUNT(p.post_id) AS total
|
||||
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
|
||||
$where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
|
||||
AND p.post_visibility = ' . ITEM_UNAPPROVED . '
|
||||
AND p.post_visibility = ' . $visibility_const . '
|
||||
AND t.topic_id = p.topic_id
|
||||
AND t.topic_first_post_id <> p.post_id';
|
||||
|
||||
@@ -796,7 +798,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
|
||||
'S_SELECT_SORT_DAYS' => $s_limit_days)
|
||||
);
|
||||
|
||||
if (($sort_days && $mode != 'viewlogs') || in_array($mode, array('reports', 'unapproved_topics', 'unapproved_posts')) || $where_sql != 'WHERE')
|
||||
if (($sort_days && $mode != 'viewlogs') || in_array($mode, array('reports', 'unapproved_topics', 'unapproved_posts', 'deleted_posts')) || $where_sql != 'WHERE')
|
||||
{
|
||||
$result = $db->sql_query($sql);
|
||||
$total = (int) $db->sql_fetchfield('total');
|
||||
|
Reference in New Issue
Block a user