From 40d825d1c6533e8bc83526c6339f9f1ef6ab5b50 Mon Sep 17 00:00:00 2001 From: Alec Date: Sat, 12 Jan 2019 07:07:41 -0500 Subject: [PATCH] [ticket/15925] Add core.sync_modify_topic_data Allow modification of topic_data when syncing topics Another event has been added to modify the contents of $row This means that topic_data can be populated with anything added to that query PHPBB3-15925 --- phpBB/includes/functions_admin.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index c7659b0305..a990a084e7 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2118,6 +2118,22 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false, $topic_data[$topic_id]['last_poster_name'] = ($row['poster_id'] == ANONYMOUS) ? $row['post_username'] : $row['username']; $topic_data[$topic_id]['last_poster_colour'] = $row['user_colour']; } + + /** + * Event to modify the topic_data when syncing topics + * + * @event core.sync_modify_topic_data + * @var array topic_data Array with the topics' data we are syncing + * @var array row Array with some of the current user and post data + * @var int topic_id The current topic_id of $row + * @since 3.2.6-RC1 + */ + $vars = array( + 'topic_data', + 'row', + 'topic_id', + ); + extract($phpbb_dispatcher->trigger_event('core.sync_modify_topic_data', compact($vars))); } $db->sql_freeresult($result);