aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorv12mike <github@ingenious.co.nz>2019-09-10 16:32:13 -0400
committerMarc Alexander <admin@m-a-styles.de>2019-11-21 13:44:20 +0100
commit78a913581c727801240758c0a8c3bfae86d124ca (patch)
tree4945aa5238d62b5da58656d202c6f2f4318755b3 /phpBB
parent63b7518a0f8b09d23a0d45c50d98aa3ff607f613 (diff)
downloadforums-78a913581c727801240758c0a8c3bfae86d124ca.tar
forums-78a913581c727801240758c0a8c3bfae86d124ca.tar.gz
forums-78a913581c727801240758c0a8c3bfae86d124ca.tar.bz2
forums-78a913581c727801240758c0a8c3bfae86d124ca.tar.xz
forums-78a913581c727801240758c0a8c3bfae86d124ca.zip
[ticket/9837] Display unapproved posts to posters
Add tests and improve style template PHPBB3-9837
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/language/en/common.php2
-rw-r--r--phpBB/phpbb/content_visibility.php14
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html5
3 files changed, 11 insertions, 10 deletions
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index d050c1b109..04ed4de5b1 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -614,7 +614,7 @@ $lang = array_merge($lang, array(
'POST_TIME' => 'Post time',
'POST_TOPIC' => 'Post a new topic',
'POST_UNAPPROVED_ACTION' => 'Post awaiting approval:',
- 'POST_UNAPPROVED' => 'This post has not been approved.',
+ 'POST_UNAPPROVED' => 'This post is not visible to other users until it has been approved',
'POWERED_BY' => 'Powered by %s',
'PREVIEW' => 'Preview',
'PREVIOUS' => 'Previous', // Used in pagination
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index 699bfa167e..1ee3cfee8b 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -76,7 +76,7 @@ class content_visibility
* @param string $topics_table Topics table name
* @param string $users_table Users table name
*/
- public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table)
+ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table)
{
$this->auth = $auth;
$this->config = $config;
@@ -198,8 +198,8 @@ class content_visibility
* @var array forum_id The forum id in which the search is made.
* @var string table_alias Table alias to prefix in SQL queries
* @var mixed get_visibility_sql_overwrite If a string, forces the function to return get_forums_visibility_sql_overwrite after executing the event
- * If false, get_visibility_sql continues normally
- * It must be either boolean or string
+ * If false, get_visibility_sql continues normally
+ * It must be either boolean or string
* @since 3.1.4-RC1
*/
$vars = array(
@@ -225,10 +225,10 @@ class content_visibility
$visibility_query = $table_alias . $mode . '_visibility = ';
$where_sql .= '(' . $visibility_query . ITEM_APPROVED . ')';
- if ($this->config['display_unapproved_posts'] && ($this->user->data['user_id'] <> ANONYMOUS))
+ 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 .= ' OR ((' . $visibility_query . ITEM_UNAPPROVED . ' OR ' . $visibility_query . ITEM_REAPPROVE .')';
$where_sql .= ' AND ' . $table_alias . $poster_key . ' = ' . ((int) $this->user->data['user_id']) . ')';
}
}
@@ -268,8 +268,8 @@ class content_visibility
* @var string table_alias Table alias to prefix in SQL queries
* @var array approve_forums Array of forums where the user has m_approve permissions
* @var mixed get_forums_visibility_sql_overwrite If a string, forces the function to return get_forums_visibility_sql_overwrite after executing the event
- * If false, get_forums_visibility_sql continues normally
- * It must be either boolean or string
+ * If false, get_forums_visibility_sql continues normally
+ * It must be either boolean or string
* @since 3.1.3-RC1
*/
$vars = array(
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 16e28651bf..f627852969 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -306,8 +306,9 @@
</p>
</form>
<!-- ELSE -->
- <p class="post-notice information">
- {L_POST_UNAPPROVED}
+ <p class="post-notice unapproved">
+ <span><i class="icon fa-exclamation icon-red fa-fw" aria-hidden="true"></i></span>
+ <strong>{L_POST_UNAPPROVED}</strong>
</p>
<!-- ENDIF -->
<!-- ELSEIF postrow.S_POST_DELETED -->