• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Remove Guests From 'Online' Page

Jake Bunce

Well-known member
Licensed customer
Screen shot 2011-10-06 at 2.07.02 PM.webp

Edit this file:

library/XenForo/ControllerPublic/Online.php

Add the red code (don't forget the comma on the far right):

Rich (BB code):
		$conditions = array(
			'cutOff' => array('>', $sessionModel->getOnlineStatusTimeout()),
			'getInvisible' => $bypassUserPrivacy,
			'getUnconfirmed' => $bypassUserPrivacy,

			// allow force including of self, even if invisible
			'forceInclude' => ($bypassUserPrivacy ? false : XenForo_Visitor::getUserId()),

			'userLimit' => 'registered'
		);

		$onlineUsers = $sessionModel->getSessionActivityRecords($conditions, array(
			'perPage' => $userPerPage,
			'page' => $page,
			'join' => XenForo_Model_Session::FETCH_USER,
			'order' => 'view_date'
		));
 
I felt maybe the best approach to this would be

Current Visitors
Admin
RegisteredUserJake
Guests (23)

where 23 is the number of guests.
 
Jake,

Sometimes I want to see guests. But I feel it's more important to see registered members.

Would you know a way to order the 'logged in' users before the 'guests'?
 
If a site had 200 guests .... how many pages of blank guests would there be ? Is that useful ?

Current Visitors
Admin
RegisteredUserJake
Guests (3)
- viewing forum list 3 min ago.
- editing their avatar 9 min ago.
- viewing list of online members 23 min ago.
 
You can order by username or last activity (default). The session model doesn't support any other ordering or grouping options.
 
Hey james,

thank you for replying :)

If it does same some queries, it is a very interesting tweak for busy XFs.
 
You can order by username or last activity (default). The session model doesn't support any other ordering or grouping options.

And how about some toggle so you can switch between logged in members and guests? That would be the best! :)
 
Back
Top Bottom