phpBB

Code Changes

File: viewonline.php

  Unmodified   Added   Modified   Removed
Line 180Line 180
extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_sql', compact($vars)));

$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));

extract($phpbb_dispatcher->trigger_event('core.viewonline_modify_sql', compact($vars)));

$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));

 
$session_data_rowset = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);


$prev_id = $prev_ip = $user_list = array();
$logged_visible_online = $logged_hidden_online = $counter = 0;


$prev_id = $prev_ip = $user_list = array();
$logged_visible_online = $logged_hidden_online = $counter = 0;

Line 190Line 192
/** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('group_helper');


/** @var \phpbb\group\helper $group_helper */
$group_helper = $phpbb_container->get('group_helper');


while ($row = $db->sql_fetchrow($result))




// Get forum IDs for session pages which have only 't' parameter
$viewonline_helper->get_forum_ids($session_data_rowset);

foreach ($session_data_rowset as $row)

{
if ($row['user_id'] != ANONYMOUS && !isset($prev_id[$row['user_id']]))
{

{
if ($row['user_id'] != ANONYMOUS && !isset($prev_id[$row['user_id']]))
{

Line 438Line 443

$template->assign_block_vars('user_row', $template_row);
}


$template->assign_block_vars('user_row', $template_row);
}

$db->sql_freeresult($result);

 
unset($prev_id, $prev_ip);

$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';

unset($prev_id, $prev_ip);

$order_legend = ($config['legend_sort_groupname']) ? 'group_name' : 'group_legend';

Line 466Line 470
}
$result = $db->sql_query($sql);


}
$result = $db->sql_query($sql);


$legend = '';

$legend = [];

while ($row = $db->sql_fetchrow($result))
{

while ($row = $db->sql_fetchrow($result))
{

 
	$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
$group_name = $group_helper->get_name($row['group_name']);


	if ($row['group_name'] == 'BOTS')
{

	if ($row['group_name'] == 'BOTS')
{

		$legend .= (($legend != '') ? ', ' : '') . '<span style="color:#' . $row['group_colour'] . '">' . $user->lang['G_BOTS'] . '</span>';

		$legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';

	}
else
{

	}
else
{

		$legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_helper->get_name($row['group_name']) . '</a>';

		$legend[] = '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';

	}
}
$db->sql_freeresult($result);

	}
}
$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&amp;sk=$sort_key&amp;sd=$sort_dir&amp;start=$start"));


// Refreshing the page every 60 seconds...
meta_refresh(60, append_sid("{$phpbb_root_path}viewonline.$phpEx", "sg=$show_guests&amp;sk=$sort_key&amp;sd=$sort_dir&amp;start=$start"));