1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-19 06:51:33 +02:00

[ticket/9837] Make unapproved posts visible to posters

Improvements for feature following review

PHPBB3-9837
This commit is contained in:
v12mike
2019-09-10 08:33:01 -04:00
committed by Marc Alexander
parent 01b0ec19c6
commit 63b7518a0f
5 changed files with 38 additions and 5 deletions

View File

@@ -222,15 +222,16 @@ class content_visibility
}
else
{
$field_name = ($mode === 'topic') ? 'topic_poster' : 'poster_id';
$visibility_query = $table_alias . $mode . '_visibility = ';
$where_sql .= '(' . $visibility_query . ITEM_APPROVED . ')';
$where_sql .= ' OR (';
$where_sql .= '(' . $visibility_query . ITEM_UNAPPROVED . ' OR ' . $visibility_query . ITEM_REAPPROVE . ')';
$where_sql .= ' AND ' . $table_alias . $field_name . ' = ' . ((int) $this->user->data['user_id']) . ')';
if ($this->config['display_unapproved_posts'] && ($this->user->data['user_id'] <> ANONYMOUS))
{
$poster_key = ($mode === 'topic') ? 'topic_poster' : 'poster_id';
$where_sql .= ' OR (' . $visibility_query . ITEM_UNAPPROVED;
$where_sql .= ' AND ' . $table_alias . $poster_key . ' = ' . ((int) $this->user->data['user_id']) . ')';
}
}
return '(' . $where_sql . ')';
}