aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/content_visibility.php
diff options
context:
space:
mode:
authorv12mike <github@ingenious.co.nz>2019-09-10 08:33:01 -0400
committerMarc Alexander <admin@m-a-styles.de>2019-11-21 13:44:19 +0100
commit63b7518a0f8b09d23a0d45c50d98aa3ff607f613 (patch)
tree00fab54c2fd8658d889eb264d49983d5da84a3c3 /phpBB/phpbb/content_visibility.php
parent01b0ec19c681b76b59ae37c77d56357b2197bb8b (diff)
downloadforums-63b7518a0f8b09d23a0d45c50d98aa3ff607f613.tar
forums-63b7518a0f8b09d23a0d45c50d98aa3ff607f613.tar.gz
forums-63b7518a0f8b09d23a0d45c50d98aa3ff607f613.tar.bz2
forums-63b7518a0f8b09d23a0d45c50d98aa3ff607f613.tar.xz
forums-63b7518a0f8b09d23a0d45c50d98aa3ff607f613.zip
[ticket/9837] Make unapproved posts visible to posters
Improvements for feature following review PHPBB3-9837
Diffstat (limited to 'phpBB/phpbb/content_visibility.php')
-rw-r--r--phpBB/phpbb/content_visibility.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index 8249e9c36d..699bfa167e 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -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 . ')';
}