• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Members Online Now sidebar box in alphabetical order

Rudy

Well-known member
#1
Based on Jake's post here:

http://xenforo.com/community/threads/sort-member-list-by-last-activity.20049/

My fellow staffers are requesting that I put the Members Online Now sidebar box in alphabetical order by username. It is likely a small code modification but I just need to know where to fix this at. I believe Jake's fix above only applies to the page where online members are listed, not the sidebar box, as I tried it and there was no change.
 

Jake Bunce

XenForo moderator
Staff member
#2
library/XenForo/Model/Session.php

Make the change in red:

Code:
	public function getSessionActivityQuickList(array $viewingUser, array $conditions = array(), array $forceInclude = null)
	{
		$fetchOptions = array(
			'join' => self::FETCH_USER,
			'order' => 'username'
		);
		$conditions['getInvisible'] = true; // filtered out if needed, but included in count
		$conditions['getUnconfirmed'] = true; // also filtered out but included in count

		$records = $this->getSessionActivityRecords($conditions, $fetchOptions);

		$canBypassUserPrivacy = $this->getModelFromCache('XenForo_Model_User')->canBypassUserPrivacy();

		$forceIncludeUserId = ($forceInclude ? $forceInclude['user_id'] : 0);
 

Eagle

Well-known member
#6
library/XenForo/Model/Session.php

Make the change in red:

Code:
    public function getSessionActivityQuickList(array $viewingUser, array $conditions = array(), array $forceInclude = null)
    {
        $fetchOptions = array(
            'join' => self::FETCH_USER,
            'order' => 'username'
        );
        $conditions['getInvisible'] = true; // filtered out if needed, but included in count
        $conditions['getUnconfirmed'] = true; // also filtered out but included in count

        $records = $this->getSessionActivityRecords($conditions, $fetchOptions);

        $canBypassUserPrivacy = $this->getModelFromCache('XenForo_Model_User')->canBypassUserPrivacy();

        $forceIncludeUserId = ($forceInclude ? $forceInclude['user_id'] : 0);
Thanks but it's should be hard-coded in.
 
#7
What about sorting the Staff_Online_Now by usergroup? Is there a way to say that secondary- Group1>Group4>Group2>....... = A list of which user group should displayed at the top. Groups not listed would be ignored because users have multile groups.