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

XF 1.2 Hide guest from online page

Discussion in 'Styling and Customization Questions' started by dbembibre, Aug 5, 2013.

  1. dbembibre

    dbembibre Active Member

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    In 1.2 there is already a userLimit in the conditions:

    Code:
    		$conditions = array(
    			'userLimit' => $userLimit,
    			'cutOff' => array('>', $sessionModel->getOnlineStatusTimeout()),
    			'getInvisible' => $bypassUserPrivacy,
    			'getUnconfirmed' => $bypassUserPrivacy,
    
    			// allow force including of self, even if invisible
    			'forceInclude' => ($bypassUserPrivacy ? false : XenForo_Visitor::getUserId())
    		);
    
    Try replacing this:

    Code:
    		$conditions = array(
    			'userLimit' => $userLimit,
    			'cutOff' => array('>', $sessionModel->getOnlineStatusTimeout()),
    			'getInvisible' => $bypassUserPrivacy,
    			'getUnconfirmed' => $bypassUserPrivacy,
    
    			// allow force including of self, even if invisible
    			'forceInclude' => ($bypassUserPrivacy ? false : XenForo_Visitor::getUserId())
    		);
    
    With this:

    Code:
    		$conditions = array(
    			'userLimit' => ($userLimit ? $userLimit : 'registered'),
    			'cutOff' => array('>', $sessionModel->getOnlineStatusTimeout()),
    			'getInvisible' => $bypassUserPrivacy,
    			'getUnconfirmed' => $bypassUserPrivacy,
    
    			// allow force including of self, even if invisible
    			'forceInclude' => ($bypassUserPrivacy ? false : XenForo_Visitor::getUserId())
    		);
    
     
    Breixo and dbembibre like this.
  3. dbembibre

    dbembibre Active Member

    Great @Jake Bunce i try the same solution but without the ternary operator, thanks a lot
     

Share This Page