D
D
Denis2015-09-26 00:55:51
MySQL
Denis, 2015-09-26 00:55:51

Displaying online status for guests (not registered) wordpress?

Hello everyone please help!!! you need to display the online user's session for site guests so that they can see that this person is online.
PS online shows users only after registration ((
here is the code: I think I need to dig here?

}
  
    if(!isset($_SESSION['users'][$ID])) {
      $_SESSION['users'][$ID]=time()+20000;
    }
    
    die();
  }
  
  /**
   * Filters user statuses
     *
     * @access public
     * @return void
     */
  public static function filterStatuses() {
    $limit=time();		
    if(isset($_SESSION['users']) && (!isset($_SESSION['time']) || $_SESSION['time']<$limit)) {	
      $_SESSION['time']=$limit+150;
      foreach($_SESSION['users'] as $ID=>$time) {
        if($time<$limit) {
          unset($_SESSION['users'][$ID]);
        }
      }
    }
  }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question