diff options
author | Maat <maat-pub@mageia.biz> | 2020-05-08 21:52:11 +0200 |
---|---|---|
committer | Maat <maat-pub@mageia.biz> | 2020-05-08 21:52:11 +0200 |
commit | 8ea437e30605e0f66b5220bf904a61d7c1d11ddd (patch) | |
tree | e0db2bb4a012d5b06a633160b19f62f4868ecd28 /phpBB/index.php | |
parent | 36bc1870f21fac04736a1049c1d5b8e127d729f4 (diff) | |
parent | 2fdd46b36431ae0f58bb2e78e42553168db9a0ff (diff) | |
download | forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.gz forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.bz2 forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.tar.xz forums-8ea437e30605e0f66b5220bf904a61d7c1d11ddd.zip |
Merge remote-tracking branch 'upstream/prep-release-3.2.9'
Diffstat (limited to 'phpBB/index.php')
-rw-r--r-- | phpBB/index.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/phpBB/index.php b/phpBB/index.php index e4c03949c1..13b914abd3 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -42,9 +42,10 @@ if (($mark_notification = $request->variable('mark_notification', 0))) if (check_link_hash($request->variable('hash', ''), 'mark_notification_read')) { + /* @var $phpbb_notifications \phpbb\notification\manager */ $phpbb_notifications = $phpbb_container->get('notification_manager'); - $notification = $phpbb_notifications->load_notifications(array( + $notification = $phpbb_notifications->load_notifications('notification.method.board', array( 'notification_id' => $mark_notification, )); @@ -54,6 +55,17 @@ if (($mark_notification = $request->variable('mark_notification', 0))) $notification->mark_read(); + /** + * You can use this event to perform additional tasks or redirect user elsewhere. + * + * @event core.index_mark_notification_after + * @var int mark_notification Notification ID + * @var \phpbb\notification\type\type_interface notification Notification instance + * @since 3.2.6-RC1 + */ + $vars = array('mark_notification', 'notification'); + extract($phpbb_dispatcher->trigger_event('core.index_mark_notification_after', compact($vars))); + if ($request->is_ajax()) { $json_response = new \phpbb\json_response(); @@ -99,11 +111,14 @@ else } $result = $db->sql_query($sql); +/** @var \phpbb\group\helper $group_helper */ +$group_helper = $phpbb_container->get('group_helper'); + $legend = array(); while ($row = $db->sql_fetchrow($result)) { $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : ''; - $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']; + $group_name = $group_helper->get_name($row['group_name']); if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))) { @@ -119,8 +134,10 @@ $db->sql_freeresult($result); $legend = implode($user->lang['COMMA_SEPARATOR'], $legend); // Generate birthday list if required ... +$show_birthdays = ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')); + $birthdays = $birthday_list = array(); -if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) +if ($show_birthdays) { $time = $user->create_datetime(); $now = phpbb_gmgetdate($time->getTimestamp() + $time->getOffset()); @@ -211,7 +228,7 @@ $template->assign_vars(array( 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'), 'U_SEND_PASSWORD' => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '', - 'S_DISPLAY_BIRTHDAY_LIST' => ($config['load_birthdays']) ? true : false, + 'S_DISPLAY_BIRTHDAY_LIST' => $show_birthdays, 'S_INDEX' => true, 'U_MARK_FORUMS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'hash=' . generate_link_hash('global') . '&mark=forums&mark_time=' . time()) : '', |