aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/mcp.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-10-15 15:53:32 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-10-15 15:53:32 +0200
commit33073fafbe53cb103e9e00bceb249a0879a2eb9c (patch)
tree3bced7cf702eec4ddfcc7c26a05936c756447c71 /phpBB/mcp.php
parentb1ce8a8c13eca920abf3659fcbfec267684071bb (diff)
downloadforums-33073fafbe53cb103e9e00bceb249a0879a2eb9c.tar
forums-33073fafbe53cb103e9e00bceb249a0879a2eb9c.tar.gz
forums-33073fafbe53cb103e9e00bceb249a0879a2eb9c.tar.bz2
forums-33073fafbe53cb103e9e00bceb249a0879a2eb9c.tar.xz
forums-33073fafbe53cb103e9e00bceb249a0879a2eb9c.zip
[feature/soft-delete] Add module for soft deleted topics
Unapproved/soft deleted posts are posts, that have a different visibility than the topic. All others will be hidden from the posts list and can be managed with the topic modules. PHPBB3-9567
Diffstat (limited to 'phpBB/mcp.php')
-rw-r--r--phpBB/mcp.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index a4801940a6..09fe70cde1 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -652,7 +652,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$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 = ' . $visibility_const . '
AND t.topic_id = p.topic_id
- AND t.topic_first_post_id <> p.post_id';
+ AND t.topic_visibility <> p.post_visibility';
if ($min_time)
{
@@ -661,6 +661,8 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
break;
case 'unapproved_topics':
+ case 'deleted_topics':
+ $visibility_const = ($mode == 'unapproved_topics') ? ITEM_UNAPPROVED : ITEM_DELETED;
$type = 'topics';
$default_key = 't';
$default_dir = 'd';
@@ -668,7 +670,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$sql = 'SELECT COUNT(topic_id) AS total
FROM ' . TOPICS_TABLE . "
$where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
- AND topic_visibility = ' . ITEM_UNAPPROVED;
+ AND topic_visibility = ' . $visibility_const;
if ($min_time)
{
@@ -798,7 +800,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', 'deleted_posts')) || $where_sql != 'WHERE')
+ if (($sort_days && $mode != 'viewlogs') || in_array($mode, array('reports', 'unapproved_topics', 'unapproved_posts', 'deleted_topics', 'deleted_posts')) || $where_sql != 'WHERE')
{
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');