Who's Online Order

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ElForro
    Member
    • Mar 2006
    • 74
    • 3.5.x

    Who's Online Order

    I remember one option to sort the users in the "Who's Online" table alphabetically or not, and that can reduce some load in the server (if they aren't ordered)..

    The problem is that I can't find that option... Can anyone help me?

    Thanks!
  • r007
    Member
    • Mar 2003
    • 87
    • 3.5.x

    #2
    Hey, I'm not sure if there is an option to turn this on or off in the later versions, I run vBulletin 3.5. If you want to remove the part that orders the online list you will have to modify your index.php file.

    To do this, open up index.php and find where it says: (Line 317 for me)
    Code:
    $forumusers = $db->query_read("
            SELECT
                user.username, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid,
                session.userid, session.inforum, session.lastactivity,
                IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
            FROM " . TABLE_PREFIX . "session AS session
            LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
            WHERE session.lastactivity > $datecut
            " . [COLOR=Red]iif($vbulletin->options['displayloggedin'] == 1, "ORDER BY username ASC")[/COLOR] . "
        ");
    What you want to do is comment out the ORDER BY part, so to do that you add a /* before the first . and a */ before the last .

    So that the whole thing becomes:
    Code:
    $forumusers = $db->query_read("
            SELECT
                user.username, (user.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid,
                session.userid, session.inforum, session.lastactivity,
                IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
            FROM " . TABLE_PREFIX . "session AS session
            LEFT JOIN " . TABLE_PREFIX . "user AS user ON(user.userid = session.userid)
            WHERE session.lastactivity > $datecut
            " [COLOR=DarkGreen]/*. iif($vbulletin->options['displayloggedin'] == 1, "ORDER BY username ASC")*/[/COLOR] . "
        ");
    Like I said before, I run vBulletin 3.5, so my query might be a bit different then yours, so your best bet is doing the commenting yourself and not coping and pasting what I have.

    As a side note, this actually removed .00020 seconds from my query (On my personal computer, so there was only 1 user in the session table) so that's kind of cool. I never thought about this for speeding up my forums
    Last edited by r007; Tue 27 Mar '07, 4:05pm.
    -r007

    Comment

    • ElForro
      Member
      • Mar 2006
      • 74
      • 3.5.x

      #3
      Thanks... Now i'm not sure if this was an option in VBseo or maybe one Plugin... Anyway, I can't find it anywhere... But I think I've read it somewhere before...

      Thanks, I'll try that...

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...