From 09e5896cae23534532d9f44fefc43f4b3f846f1c Mon Sep 17 00:00:00 2001 From: PayBas Date: Wed, 16 Jul 2014 10:39:40 +0200 Subject: [PATCH 1/2] [ticket/12837] Detect "viewing contact admin page" on viewonline PHPBB3-12837 --- phpBB/language/en/common.php | 1 + phpBB/viewonline.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 5af3ad4fbc..a58aec43cd 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -821,6 +821,7 @@ $lang = array_merge($lang, array( 1 => 'Viewed %d time', 2 => 'Viewed %d times', ), + 'VIEWING_CONTACT_ADMIN' => 'Viewing contact page', 'VIEWING_FAQ' => 'Viewing FAQ', 'VIEWING_MEMBERS' => 'Viewing member details', 'VIEWING_ONLINE' => 'Viewing who is online', diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 4c897c58aa..38e2ced341 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -295,8 +295,21 @@ while ($row = $db->sql_fetchrow($result)) break; case 'memberlist': - $location = (strpos($row['session_page'], 'mode=viewprofile') !== false) ? $user->lang['VIEWING_MEMBER_PROFILE'] : $user->lang['VIEWING_MEMBERS']; $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx"); + + if (strpos($row['session_page'], 'mode=viewprofile') !== false) + { + $location = $user->lang['VIEWING_MEMBER_PROFILE']; + } + elseif (strpos($row['session_page'], 'mode=contactadmin') !== false) + { + $location = $user->lang['VIEWING_CONTACT_ADMIN']; + $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin'); + } + else + { + $location = $user->lang['VIEWING_MEMBERS']; + } break; case 'mcp': From a22549f2477533e5efc1bb7038428e5982f0ccf2 Mon Sep 17 00:00:00 2001 From: PayBas Date: Wed, 16 Jul 2014 11:19:28 +0200 Subject: [PATCH 2/2] [ticket/12837] Use else if instead of elseif PHPBB3-12837 --- phpBB/viewonline.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 38e2ced341..a03a81a15e 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -301,7 +301,7 @@ while ($row = $db->sql_fetchrow($result)) { $location = $user->lang['VIEWING_MEMBER_PROFILE']; } - elseif (strpos($row['session_page'], 'mode=contactadmin') !== false) + else if (strpos($row['session_page'], 'mode=contactadmin') !== false) { $location = $user->lang['VIEWING_CONTACT_ADMIN']; $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');