News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

[fixed]If a username contains only numbers, Users Online sorting is broken

Started by porplemontage, August 28, 2012, 10:34:55 PM

Previous topic - Next topic

porplemontage

If a username contains only numbers, that user will always be the first person in the "Users Online" list on the forum index. The list is supposed to be sorted by activity, yet these users are "pinned" to the top of the list regardless of their activity (as long as they classify as online). Note that this is not an issue when viewing the full Who's Online list (index.php?action=who), just at the bottom of the forum index.

I'm using SMF 2.0.2. The theme is essentially the default with custom styling.

emanuele

Hello porplemontage and welcome to sm.org! :)

Thanks for the report.
Yep, this is a bug that has been fixed recently in the development code.
The fix is rather easy, in Subs-MembersOnline.php you have to apply the following four changes:
Code (find) Select
$membersOnlineStats['users_online'][$row[$membersOnlineOptions['sort']] . $row['member_name']] = array(
Code (replace with) Select
$membersOnlineStats['users_online'][$row[$membersOnlineOptions['sort']] . '_' . $row['member_name']] = array(

Code (find) Select
$membersOnlineStats['list_users_online'][$row[$membersOnlineOptions['sort']] . $row['member_name']] = empty($row['show_online']) ? '<em>' . $link . '</em>' : $link;
Code (replace with) Select
$membersOnlineStats['list_users_online'][$row[$membersOnlineOptions['sort']] . '_' . $row['member_name']] = empty($row['show_online']) ? '<em>' . $link . '</em>' : $link;

Code (find) Select
$membersOnlineStats['users_online'][$sort . $spiders[$id]] = array(
Code (replace with) Select
$membersOnlineStats['users_online'][$sort . '_' . $spiders[$id]] = array(

Code (find) Select
$membersOnlineStats['list_users_online'][$sort . $spiders[$id]] = $link;
Code (replace with) Select
$membersOnlineStats['list_users_online'][$sort . '_' . $spiders[$id]] = $link;


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Angelina Belle

I added the notation "fixed" because I could not find it in the bug tracker.
Never attribute to malice that which is adequately explained by stupidity. -- Hanlon's Razor

emanuele

It's in the fixed/bogus boards.
This topic should be moved, I kept it here just for porplemontage's convenience so that he can easily find it in the "close" future. :)


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Advertisement: