From 66ee80c9e2e0ed168ff019bae0b0f4f7d5d650f0 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Wed, 23 Sep 2015 18:54:46 +0200 Subject: [ticket/14192] Add core.memberlist_memberrow_before event PHPBB3-14192 --- phpBB/memberlist.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'phpBB/memberlist.php') diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index e64dab635b..af86af4d73 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1448,6 +1448,20 @@ switch ($mode) usort($user_list, 'phpbb_sort_last_active'); } + // do we need to display contact fields as such + $use_contact_fields = false; + + /** + * Modify list of users before member row is created + * + * @event core.memberlist_memberrow_before + * @var array user_list Array containing list of users + * @var bool use_contact_fields Should we display contact fields as such? + * @since 3.1.7-RC1 + */ + $vars = array('user_list', 'use_contact_fields'); + extract($phpbb_dispatcher->trigger_event('core.memberlist_memberrow_before', compact($vars))); + for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i) { $user_id = $user_list[$i]; @@ -1458,7 +1472,7 @@ switch ($mode) $cp_row = array(); if ($config['load_cpf_memberlist']) { - $cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], false) : array(); + $cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], $use_contact_fields) : array(); } $memberrow = array_merge(phpbb_show_profile($row, false, false, false), array( -- cgit v1.2.1