aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/index.php')
-rw-r--r--phpBB/index.php25
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()) : '',