1. 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

Discussion in 'Styling and Customization Questions' started by Rudy, Oct 25, 2012.

  1. Rudy

    Rudy Well-Known Member

    Based on Jake's post here:


    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.
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member


    Make the change in red:

    	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);
    viper357, Eagle, semprot and 3 others like this.
  3. Rudy

    Rudy Well-Known Member

    Thanks much! I wasn't sure which file to find that in.
  4. Joshua

    Joshua Active Member

    Will this fix still work for 1.2 or will a sort option be hard-coded in?
  5. Amaury

    Amaury Well-Known Member

    In 1.2, it's still ordered by last activity.
  6. Eagle

    Eagle Well-Known Member

    Thanks but it's should be hard-coded in.
  7. celebrir

    celebrir Member

    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.

Share This Page