Who's Online

Please post general support questions for the phpBB3 core system on phpBB.com!
Bitte allgemeine Supportanfragen zu phpBB3 auf phpBB.de stellen!
Forum rules
Please post general support questions for the phpBB3 core system on phpBB.com!
Bitte allgemeine Supportanfragen zu phpBB3 auf phpBB.de stellen!

Topic author
Cherry
Active Member
Active Member
Posts: 2
Joined: 12. April 2010 21:42

Who's Online

Post by Cherry » 12. April 2010 21:47

What I am trying to do, is show the Who's online list, with a user on each line, but I have not found a way to do this yet.

My current code:

Code: Select all

<!--version $Id: whois_online.html 503 2009-04-20 18:34:29Z kevin74 $ //-->
{$C_BLOCK_H_L}<!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF -->{$C_BLOCK_H_R}
<table class="tablebg" cellspacing="1" width="100%">
<tr>

	<td class="row1" width="100%"><span class="genmed"><span style="float:left;">{LOGGED_IN_USER_LIST}</span><br /></span></td>
</tr>

</table>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
How could I get it to show a new user on each line, rather than being separated with a ",".

User avatar

Huor
Valued Contributor
Valued Contributor
Posts: 95
Joined: 9. October 2008 00:46

Re: Who's Online

Post by Huor » 12. April 2010 22:44

As far as i know the LOGGED_IN_USER_LIST is built in a php file (sorry dont know yet which one). But you need to edit this php file in order to display each user on a separate line. Hope this hint is useful. If not please tell.

User avatar

Marc
Dev
Dev
Posts: 2487
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München

Re: Who's Online

Post by Marc » 13. April 2010 13:37

phpBB actually assigns those values, therefore it doesn't have anything to do with the Portal.
I'll move the topic to General phpBB3 support.

Anyhow, this is what you need to do:
Open includes/functions.php
Find:

Code: Select all

$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; 
(Around line 3811)

Replace with:

Code: Select all

$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link . '<br />' : $user_online_link . '<br />'; 


Topic author
Cherry
Active Member
Active Member
Posts: 2
Joined: 12. April 2010 21:42

Re: Who's Online

Post by Cherry » 13. April 2010 14:24

Thanks very much, but is there a way to just make this vertical list show in the portal, and still show the horizontal one on the index page?

User avatar

Marc
Dev
Dev
Posts: 2487
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München

Re: Who's Online

Post by Marc » 13. April 2010 16:44

No, not as far as I know.

User avatar

Huor
Valued Contributor
Valued Contributor
Posts: 95
Joined: 9. October 2008 00:46

Re: Who's Online

Post by Huor » 14. April 2010 00:37

i am not sure if its working but i post it here - maybe someone else could verify it.

in the file /portal/block/whois_online.php

FIND:

Code: Select all

while ($row = $db->sql_fetchrow($result))
{
	$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';

	if ($row['group_name'] == 'BOTS')
	{
		$legend .= (($legend != '') ? ', ' : '') . '<span' . $colour_text . '>' . $user->lang['G_BOTS'] . '</span>';
	}
	else
	{
		$legend .= (($legend != '') ? ', ' : '') . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
	}
}

and replace the ', ' with a '<br />' )in the line legend .= .... :

Code: Select all

while ($row = $db->sql_fetchrow($result))
{
	$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';

	if ($row['group_name'] == 'BOTS')
	{
		$legend .= (($legend != '') ? '<br />' : '') . '<span' . $colour_text . '>' . $user->lang['G_BOTS'] . '</span>';
	}
	else
	{
		$legend .= (($legend != '') ? '<br />' : '') . '<a' . $colour_text . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
	}
}

edit: Just figured out that the legend *knocksheadonthewall*. But I assume the user list can be inserted here as well in the assign_vars block and with a str_replace?

Return to “General phpBB3 Support”