From 79b8f564273a09cdb71444603db4f93e936ee307 Mon Sep 17 00:00:00 2001
From: GanstaZ <33817937+GanstaZ@users.noreply.github.com>
Date: Wed, 25 Oct 2023 15:56:03 +0300
Subject: [PATCH 1/2] [ticket/17200] Fix color error in viewonline legend
PHPBB3-17200
---
phpBB/viewonline.php | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index c9c7e730a5a..17ed26d714c 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -470,20 +470,25 @@
}
$result = $db->sql_query($sql);
-$legend = '';
+$legend = [];
while ($row = $db->sql_fetchrow($result))
{
- if ($row['group_name'] == 'BOTS')
+ $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
+ $group_name = $group_helper->get_name($row['group_name']);
+
+ if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
{
- $legend .= (($legend != '') ? ', ' : '') . '' . $user->lang['G_BOTS'] . '';
+ $legend[] = '' . $group_name . '';
}
else
{
- $legend .= (($legend != '') ? ', ' : '') . '' . $group_helper->get_name($row['group_name']) . '';
+ $legend[] = '' . $group_name . '';
}
}
$db->sql_freeresult($result);
+$legend = implode($user->lang['COMMA_SEPARATOR'], $legend);
+
// Refreshing the page every 60 seconds...
meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&sk=$sort_key&sd=$sort_dir&start=$start"));
From 5ab3916311092e29e9475572dbffd2009ad0e9d9 Mon Sep 17 00:00:00 2001
From: GanstaZ <33817937+GanstaZ@users.noreply.github.com>
Date: Sat, 28 Oct 2023 16:52:32 +0300
Subject: [PATCH 2/2] [ticket/17200] Remove not needed addition
PHPBB3-17200
---
phpBB/viewonline.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 17ed26d714c..815c9f44e05 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -476,7 +476,7 @@
$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
$group_name = $group_helper->get_name($row['group_name']);
- if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
+ if ($row['group_name'] == 'BOTS')
{
$legend[] = '' . $group_name . '';
}