diff --git a/phpBB/includes/notification/type/base.php b/phpBB/includes/notification/type/base.php index 9ef0e71009..afd6a9fc9b 100644 --- a/phpBB/includes/notification/type/base.php +++ b/phpBB/includes/notification/type/base.php @@ -126,6 +126,17 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i */ public function prepare_for_display() { + if ($this->get_url()) + { + $u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id); + } + else + { + $redirect = (($this->user->page['page_dir']) ? $this->user->page['page_dir'] . '/' : '') . $this->user->page['page_name'] . (($this->user->page['query_string']) ? '?' . $this->user->page['query_string'] : ''); + + $u_mark_read = append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id . '&redirect=' . urlencode($redirect)); + } + return array( 'NOTIFICATION_ID' => $this->notification_id, @@ -138,7 +149,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i 'UNREAD' => $this->unread, - 'U_MARK_READ' => append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'mark_notification=' . $this->notification_id), + 'U_MARK_READ' => ($this->unread) ? $u_mark_read : '', ); } diff --git a/phpBB/index.php b/phpBB/index.php index 7f85879d23..3cb49f1a28 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -36,6 +36,11 @@ if (($mark_notification = request_var('mark_notification', 0))) $notification->mark_read(); + if (($redirect = request_var('redirect', ''))) + { + redirect(append_sid($phpbb_root_path . $redirect)); + } + redirect($notification->get_url()); } } diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index f6bc57fa4b..8fcd595972 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -137,7 +137,7 @@
diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html index f71d8698b9..08b5396827 100644 --- a/phpBB/styles/prosilver/template/ucp_notifications.html +++ b/phpBB/styles/prosilver/template/ucp_notifications.html @@ -77,7 +77,7 @@+ | {notifications.AVATAR} | -+ | - | + |
-
+
{notifications.FORMATTED_TITLE}
{notifications.TIME} + + {L_MARK_READ} + |
{L_MARK_READ} | -|
---|---|---|---|---|---|---|---|
+ | {notification_list.AVATAR} | - | + |
-
+
{notification_list.FORMATTED_TITLE}
{notification_list.TIME} |
- + |