aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorbrunoais <brunoaiss@gmail.com>2015-02-08 23:52:27 +0000
committerbrunoais <brunoaiss@gmail.com>2015-02-08 23:52:27 +0000
commit1bcce756337bb1db81da4f8f3e2f938578ab30b2 (patch)
treef2d4f3d868047ada457465705e833308896970ed /phpBB/phpbb
parentc6a371531bab7ba7f003c57d25b6b515718eb54f (diff)
downloadforums-1bcce756337bb1db81da4f8f3e2f938578ab30b2.tar
forums-1bcce756337bb1db81da4f8f3e2f938578ab30b2.tar.gz
forums-1bcce756337bb1db81da4f8f3e2f938578ab30b2.tar.bz2
forums-1bcce756337bb1db81da4f8f3e2f938578ab30b2.tar.xz
forums-1bcce756337bb1db81da4f8f3e2f938578ab30b2.zip
[ticket/13592] Allow changing get_visibility_sql's result
PHPBB3-13592
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/content_visibility.php24
1 files changed, 22 insertions, 2 deletions
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index c8516d6c85..03ffc0ceaf 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -143,12 +143,32 @@ class content_visibility
*/
public function get_visibility_sql($mode, $forum_id, $table_alias = '')
{
+ $where_sql = '';
+
+ /**
+ * Allow changing the result of calling get_visibility_sql
+ *
+ * @event core.phpbb_content_visibility_get_forums_visibility_before
+ * @var string where_sql Extra visibility conditions. It must end with either an SQL "AND" or an "OR"
+ * @var string mode Either "topic" or "post" depending on the query this is being used in
+ * @var array forum_id The forum ids which the post/topic is from
+ * @var string table_alias Table alias to prefix in SQL queries
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'where_sql',
+ 'mode',
+ 'forum_id',
+ 'table_alias',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_forums_visibility_before', compact($vars)));
+
if ($this->auth->acl_get('m_approve', $forum_id))
{
- return '1 = 1';
+ return $where_sql . '1 = 1';
}
- return $table_alias . $mode . '_visibility = ' . ITEM_APPROVED;
+ return $where_sql . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED;
}
/**