aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrechosen <rechosen@gmail.com>2013-09-06 15:04:52 +0200
committerrechosen <rechosen@gmail.com>2013-09-06 15:04:52 +0200
commit3dfad1f01e61c80fe89721d7bd826fd77f79cf9a (patch)
tree1a2ecef7d1b5c79d404fd06ef098097f53ed51f1
parentdd86e8d0ae0179cf50076cdb1a8020266b6432a5 (diff)
downloadforums-3dfad1f01e61c80fe89721d7bd826fd77f79cf9a.tar
forums-3dfad1f01e61c80fe89721d7bd826fd77f79cf9a.tar.gz
forums-3dfad1f01e61c80fe89721d7bd826fd77f79cf9a.tar.bz2
forums-3dfad1f01e61c80fe89721d7bd826fd77f79cf9a.tar.xz
forums-3dfad1f01e61c80fe89721d7bd826fd77f79cf9a.zip
[ticket/9550] Add the core.viewtopic_post_rowset_data event to viewtopic.php
To allow extra fields added to the query retrieving post data to be used for setting template variables, they need to be added to the post rowset. This commit adds the core.viewtopic_post_rowset_data event that enables extension developers to modify the post rowset when the database row is still available. PHPBB3-9550
-rw-r--r--phpBB/viewtopic.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index bc54a249a9..af2056fdeb 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -1012,7 +1012,7 @@ while ($row = $db->sql_fetchrow($result))
}
}
- $rowset[$row['post_id']] = array(
+ $rowset_data = array(
'hide_post' => (($row['foe'] || $row['post_visibility'] == ITEM_DELETED) && ($view != 'show' || $post_id != $row['post_id'])) ? true : false,
'post_id' => $row['post_id'],
@@ -1047,6 +1047,19 @@ while ($row = $db->sql_fetchrow($result))
'foe' => $row['foe'],
);
+ /**
+ * Modify the post rowset containing data to be displayed with posts
+ *
+ * @event core.viewtopic_post_rowset_data
+ * @var array rowset_data Array with the rowset data for this post
+ * @var array row Array with original user and post data
+ * @since 3.1-A1
+ */
+ $vars = array('rowset_data', 'row');
+ extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_rowset_data', compact($vars)));
+
+ $rowset[$row['post_id']] = $rowset_data;
+
// Define the global bbcode bitfield, will be used to load bbcodes
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);