Advertisement:

Author Topic: Users Online - Alphabetical Order  (Read 21498 times)

Offline Pause

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,618
  • Official Cheesecake
Users Online - Alphabetical Order
« 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)

Offline Oldiesmann

  • Developer
  • SMF Super Hero
  • *
  • Posts: 24,814
  • Gender: Male
  • Ask me about the function DB :)
    • oldiesmann on Facebook
    • Oldiesmann on GitHub
    • http://www.linkedin.com/in/michaeleshom on LinkedIn
    • @oldiesmann on Twitter
    • Archie Comics Fan Forum
Re: Users Online - Alphabetical Order
« Reply #1 on: November 22, 2004, 10:55:17 AM »
Sources/BoardIndex.php

Find
Code: [Select]
// 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
Code: [Select]
// 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__);
Michael Eshom
Webmaster / SMF Lead Developer
oldiesmann@simplemachines.org

Offline Amacythe

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,060
  • Gender: Female
Re: Users Online - Alphabetical Order
« Reply #2 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

Offline Lunatic_10QT

  • Semi-Newbie
  • *
  • Posts: 32
Re: Users Online - Alphabetical Order
« Reply #3 on: January 10, 2006, 05:16:01 PM »
Hi,

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

Thanks.

Offline 2pac

  • Jr. Member
  • **
  • Posts: 235
  • Gender: Male
  • Str8 Ballin'
Re: Users Online - Alphabetical Order
« Reply #4 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!

Offline rockinaway

  • Sophist Member
  • *****
  • Posts: 1,134
  • Gender: Male
    • AdminFuel
Re: Users Online - Alphabetical Order
« Reply #5 on: October 06, 2007, 07:07:12 AM »
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 :)
Have I helped you? Then please join AdminFuel - The forum for forum administrators.

If you need help managing your forum, or maybe launching it, then visit us and view the quality articles, downloads and posts.

Offline cferd

  • Jr. Member
  • **
  • Posts: 213
Re: Users Online - Alphabetical Order
« Reply #6 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


Offline 2pac

  • Jr. Member
  • **
  • Posts: 235
  • Gender: Male
  • Str8 Ballin'
Re: Users Online - Alphabetical Order
« Reply #7 on: October 24, 2007, 08:42:57 PM »
this doesnt work, anybody have an alternative solution?

Offline 2pac

  • Jr. Member
  • **
  • Posts: 235
  • Gender: Male
  • Str8 Ballin'
Re: Users Online - Alphabetical Order
« Reply #8 on: November 03, 2007, 04:30:14 AM »
no solutions? :(

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Users Online - Alphabetical Order
« Reply #9 on: November 26, 2007, 04:27:24 AM »
this doesnt work, anybody have an alternative solution?
Yeah it doesn't work!
İnadına SMF 1.1.X

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Users Online - Alphabetical Order
« Reply #10 on: December 04, 2007, 06:33:26 AM »
this doesnt work, anybody have an alternative solution?
Yeah it doesn't work!
Anyone?
İnadına SMF 1.1.X

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
Re: Users Online - Alphabetical Order
« Reply #11 on: December 14, 2007, 06:13:35 AM »
[edit]
Tested and working.
[/edit]

In BoardIndex.php, find:
Code: [Select]
$context['users_online'][$row['logTime'] . $row['memberName']] = array(

Replace with:
Code: [Select]
$context['users_online'][strtolower($row['memberName'])] = array(



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

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



Find:
Code: [Select]
krsort($context['users_online']);

Replace with:
Code: [Select]
ksort($context['users_online']);



Find:
Code: [Select]
krsort($context['list_users_online']);

Replace with:
Code: [Select]
ksort($context['list_users_online']);

The above should list online users alphabetically instead of in order of activity.
« Last Edit: December 15, 2007, 04:08:17 AM by Sarge »
    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Users Online - Alphabetical Order
« Reply #12 on: December 14, 2007, 07:39:20 AM »
It doesn't work in "Users online today"
İnadına SMF 1.1.X

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
Re: Users Online - Alphabetical Order
« Reply #13 on: December 14, 2007, 08:31:37 AM »
It doesn't work in "Users online today"

Do you have any mods installed?
    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Users Online - Alphabetical Order
« Reply #14 on: December 14, 2007, 09:49:16 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...
İnadına SMF 1.1.X

Offline Sarge

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,209
  • Gender: Male
    • Zëri YT!
Re: Users Online - Alphabetical Order
« Reply #15 on: December 15, 2007, 04:07:20 AM »
Yes, I have lots of mods installed.

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

You said "I haven't tested"..
well test it if say so...

Tested and working.

[edit]
www.zeriyt.com
« Last Edit: December 15, 2007, 04:16:11 AM by Sarge »
    Please do not PM me with support requests unless I invite you to.

http://www.zeriyt.com/   ~   http://www.galeriashqiptare.net/


Quote
<H> I had zero posts when I started posting

Offline Hoochie Coochie Man

  • SMF Hero
  • ******
  • Posts: 5,135
  • Gender: Male
    • İstanblues.org
Re: Users Online - Alphabetical Order
« Reply #16 on: December 15, 2007, 07:38:07 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..
İnadına SMF 1.1.X

Offline mersindost

  • SMF Hero
  • ******
  • Posts: 1,999
  • Gender: Male
  • Since 11 Years
Re: Users Online - Alphabetical Order
« Reply #17 on: March 05, 2008, 07:53:23 AM »
I Am Simple Machines Hero, Because I LOVE Simple Machines