Members Online Now sidebar box in alphabetical order

Wildcat Media

Well-known member
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.
 
library/XenForo/Model/Session.php

Make the change in red:

Rich (BB 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);
 
library/XenForo/Model/Session.php

Make the change in red:

Rich (BB 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.
 
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.
 
Top Bottom