Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Pause on November 22, 2004, 10:03:06 AM

Title: Users Online - Alphabetical Order
Post by: Pause on November 22, 2004, 10:03:06 AM
Any chance that the Users Online box at the bottom of forums can actually be set to Alphabetical Order? It'd save a lot of time if you're trying to quickly see if a certain fellow forum-member is online!

(I haven't actually looked properly on my own forums as I'm pretty much the only user, but I have noticed on these forums)
Title: Re: Users Online - Alphabetical Order
Post by: Oldiesmann on November 22, 2004, 10:55:17 AM
Sources/BoardIndex.php

Find
// Load the users online right now.
$result = db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))", __FILE__, __LINE__);


Replace
// Load the users online right now.
$result = db_query("
SELECT
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mg.onlineColor, mg.ID_GROUP, mg.groupName
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
ORDER BY mem.realName ASC", __FILE__, __LINE__);
Title: Re: Users Online - Alphabetical Order
Post by: Amacythe on November 22, 2004, 07:46:22 PM
You can also click the link for who's online, and click the username to put them into alphabetical order
Title: Re: Users Online - Alphabetical Order
Post by: Lunatic_10QT on January 10, 2006, 05:16:01 PM
Hi,

How can I do that with SMF 1.1 RC2 ? The code has changed...

Thanks.
Title: Re: Users Online - Alphabetical Order
Post by: 2pac on October 06, 2007, 12:09:28 AM
anyway to have your name not be first on the list either, have it be alphabetically ordered with the rest of them? is there a quick fix or is that just asking too much? thanks!
Title: Re: Users Online - Alphabetical Order
Post by: rockinaway on October 06, 2007, 07:07:12 AM
Quote from: Lunatic_10QT on January 10, 2006, 05:16:01 PM
Hi,

How can I do that with SMF 1.1 RC2 ? The code has changed...

Thanks.

Really you should be looking to update to 1.1.4, serious security risks there :)
Title: Re: Users Online - Alphabetical Order
Post by: cferd on October 13, 2007, 11:18:31 AM
 :) He probably already did. That post was over a year and a half ago.

And the code in 1.1.4 is still the same

Title: Re: Users Online - Alphabetical Order
Post by: 2pac on October 24, 2007, 08:42:57 PM
this doesnt work, anybody have an alternative solution?
Title: Re: Users Online - Alphabetical Order
Post by: 2pac on November 03, 2007, 04:30:14 AM
no solutions? :(
Title: Re: Users Online - Alphabetical Order
Post by: Hoochie Coochie Man on November 26, 2007, 04:27:24 AM
Quote from: ninerskickass on October 24, 2007, 08:42:57 PM
this doesnt work, anybody have an alternative solution?
Yeah it doesn't work!
Title: Re: Users Online - Alphabetical Order
Post by: Hoochie Coochie Man on December 04, 2007, 06:33:26 AM
Quote from: Hoochie Coochie Man on November 26, 2007, 04:27:24 AM
Quote from: ninerskickass on October 24, 2007, 08:42:57 PM
this doesnt work, anybody have an alternative solution?
Yeah it doesn't work!
Anyone?
Title: Re: Users Online - Alphabetical Order
Post by: Sarge on December 14, 2007, 06:13:35 AM
[edit]
Tested and working.
[/edit]

In BoardIndex.php, find:

$context['users_online'][$row['logTime'] . $row['memberName']] = array(


Replace with:

$context['users_online'][strtolower($row['memberName'])] = array(





Find:

$context['list_users_online'][$row['logTime'] . $row['memberName']] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;


Replace with:

$context['list_users_online'][strtolower($row['memberName'])] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;





Find:

krsort($context['users_online']);


Replace with:

ksort($context['users_online']);





Find:

krsort($context['list_users_online']);


Replace with:

ksort($context['list_users_online']);


The above should list online users alphabetically instead of in order of activity.
Title: Re: Users Online - Alphabetical Order
Post by: Hoochie Coochie Man on December 14, 2007, 07:39:20 AM
It doesn't work in "Users online today"
Title: Re: Users Online - Alphabetical Order
Post by: Sarge on December 14, 2007, 08:31:37 AM
Quote from: Hoochie Coochie Man on December 14, 2007, 07:39:20 AM
It doesn't work in "Users online today"

Do you have any mods installed?
Title: Re: Users Online - Alphabetical Order
Post by: Hoochie Coochie Man on December 14, 2007, 09:49:16 AM
Quote from: Sarge on December 14, 2007, 08:31:37 AM
Quote from: Hoochie Coochie Man on December 14, 2007, 07:39:20 AM
It doesn't work in "Users online today"

Do you have any mods installed?

Yes, I have lots of mods installed.

You said "I haven't tested"..
well test it if say so...
Title: Re: Users Online - Alphabetical Order
Post by: Sarge on December 15, 2007, 04:07:20 AM
Quote from: Hoochie Coochie Man on December 14, 2007, 09:49:16 AM
Yes, I have lots of mods installed.

Do you have "Users Online Today" or some other similar mod installed?

Quote from: Hoochie Coochie Man on December 14, 2007, 09:49:16 AM
You said "I haven't tested"..
well test it if say so...

Tested and working.

[edit]
www.zeriyt.com
Title: Re: Users Online - Alphabetical Order
Post by: Hoochie Coochie Man on December 15, 2007, 07:38:07 AM
Quote from: Sarge on December 15, 2007, 04:07:20 AM
Quote from: Hoochie Coochie Man on December 14, 2007, 09:49:16 AM
Yes, I have lots of mods installed.

Do you have "Users Online Today" or some other similar mod installed?


Yes I have "Users Online Today" and I think it doesn't work on "Users Online Today"
Thankyou..
Title: Re: Users Online - Alphabetical Order
Post by: mersindost on March 05, 2008, 07:53:23 AM
Yes,Now Working  ;)

http://www.dizi24.com/Forum24