1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. 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

Discussion in 'Code Modifications [Archive]' started by Jake Bunce, Oct 6, 2011.

  1. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Screen shot 2011-10-06 at 2.07.02 PM.png

    Edit this file:


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

    		$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'
  2. Digital Doctor

    Digital Doctor Well-Known Member

    I felt maybe the best approach to this would be

    Current Visitors
    Guests (23)

    where 23 is the number of guests.
  3. Dodgeboard

    Dodgeboard Well-Known Member


    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'?
  4. Digital Doctor

    Digital Doctor Well-Known Member

    If a site had 200 guests .... how many pages of blank guests would there be ? Is that useful ?

    Current Visitors
    Guests (3)
    - viewing forum list 3 min ago.
    - editing their avatar 9 min ago.
    - viewing list of online members 23 min ago.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can order by username or last activity (default). The session model doesn't support any other ordering or grouping options.
    Dodgeboard likes this.
  6. Dodgeboard

    Dodgeboard Well-Known Member

    Thanks Jake!
  7. Rho Delta

    Rho Delta Well-Known Member

    I like to know how many lurkers I have.
  8. Mr.Smith

    Mr.Smith Member

    hey Jake,

    will this save some queries?

  9. James

    James Well-Known Member

    I don't think so, but it should drastically reduce the amount of results returned from the query.
  10. Mr.Smith

    Mr.Smith Member

    Hey james,

    thank you for replying :)

    If it does same some queries, it is a very interesting tweak for busy XFs.
  11. Bellinis

    Bellinis Active Member

    And how about some toggle so you can switch between logged in members and guests? That would be the best! :)
  12. Digital Doctor

    Digital Doctor Well-Known Member

    Good idea.

Share This Page