diff options
Diffstat (limited to 'phpBB/memberlist.php')
-rw-r--r-- | phpBB/memberlist.php | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 4f9a8cdff3..f142d182bc 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -575,6 +575,26 @@ switch ($mode) unset($module); } + /** + * Modify user data before we display the profile + * + * @event core.memberlist_view_profile + * @var array member Title of the index page + * @var bool user_notes_enabled Is the mcp user notes module + * enabled? + * @var bool warn_user_enabled Is the mcp warnings module + * enabled? + * @var bool zebra_enabled Is the ucp zebra module + * enabled? + * @var bool friends_enabled Is the ucp friends module + * enabled? + * @var bool foes_enabled Is the ucp foes module + * enabled? + * @since 3.1-A1 + */ + $vars = array('member', 'user_notes_enabled', 'warn_user_enabled', 'zebra_enabled', 'friends_enabled', 'foes_enabled'); + extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars))); + $template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled)); // Custom Profile Fields @@ -1631,7 +1651,7 @@ page_footer(); */ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false) { - global $config, $auth, $template, $user, $phpEx, $phpbb_root_path; + global $config, $auth, $template, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher; $username = $data['username']; $user_id = $data['user_id']; @@ -1693,7 +1713,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f } // Dump it out to the template - return array( + $template_data = array( 'AGE' => $age, 'RANK_TITLE' => $rank_title, 'JOINED' => $user->format_date($data['user_regdate']), @@ -1741,6 +1761,19 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f 'L_VIEWING_PROFILE' => sprintf($user->lang['VIEWING_PROFILE'], $username), ); + + /** + * Preparing a user's data before displaying it in profile and memberlist + * + * @event core.memberlist_prepare_profile_data + * @var array data Array with user's data + * @var array template_data Template array with user's data + * @since 3.1-A1 + */ + $vars = array('data', 'template_data'); + extract($phpbb_dispatcher->trigger_event('core.memberlist_prepare_profile_data', compact($vars))); + + return $template_data; } function _sort_last_active($first, $second) |