$Date: 2007-12-17 18:07:20 -0500 (Mon, 17 Dec 2007) $ | > $Revision: 1149 $ | > $Author: bfarber $ +--------------------------------------------------------------------------- | | > Show online users | > Module written by Matt Mecham | > Date started: 12th March 2002 | | > Module Version Number: 1.0.0 | > DBA Checked: Thu 20 May 2004 | > Quality Checked: Wed 15 Sept. 2004 +-------------------------------------------------------------------------- */ if ( ! defined( 'IN_IPB' ) ) { print "

Incorrect access

You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files."; exit(); } class online { var $output = ""; var $page_title = ""; var $nav = array(); var $html = ""; var $first = 0; var $perpage = 25; var $forums = array(); var $cats = array(); var $sessions = array(); var $where = array(); var $seen_name = array(); /*-------------------------------------------------------------------------*/ // AUTO RUN /*-------------------------------------------------------------------------*/ function auto_run() { //----------------------------------------- // Are we allowed to see the online list? //----------------------------------------- $this->ipsclass->input['st'] = intval($this->ipsclass->input['st']) >=0 ? intval($this->ipsclass->input['st']) : 0; if ( $this->ipsclass->vars['allow_online_list'] != 1 ) { $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission') ); } //----------------------------------------- // Require the HTML and language modules //----------------------------------------- $this->ipsclass->load_language('lang_online'); $this->ipsclass->load_template('skin_online'); $this->base_url = $this->ipsclass->base_url; //----------------------------------------- // Build up our language hash //----------------------------------------- foreach ($this->ipsclass->lang as $k => $v) { if ( preg_match( "/^WHERE_(\w+)$/", $k, $match ) ) { $this->where[ $match[1] ] = $this->ipsclass->lang[$k]; } } unset($match); //----------------------------------------- // What to do? //----------------------------------------- switch($this->ipsclass->input['CODE']) { case 'listall': $this->list_all(); break; default: $this->list_all(); break; } //----------------------------------------- // If we have any HTML to print, do so... //----------------------------------------- $this->ipsclass->print->add_output("$this->output"); $this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, 'NAV' => $this->nav ) ); } /*-------------------------------------------------------------------------*/ // list_all // ------------------ // List all online users /*-------------------------------------------------------------------------*/ function list_all() { //----------------------------------------- // INIT //----------------------------------------- $this->first = intval($this->ipsclass->input['st']) > 0 ? intval($this->ipsclass->input['st']) : 0; $show_mem_html = ""; $sort_order_html = ""; $sort_key_html = ""; $final = array(); $tid_array = array(); $topics = array(); $modules = array(); $final_modules = array(); $show_mem = array( 'reg', 'guest', 'all' ); $sort_order = array( 'desc', 'asc' ); $sort_key = array( 'click', 'name' ); $show_mem_value = (isset($this->ipsclass->input['show_mem']) AND $this->ipsclass->input['show_mem']) ? $this->ipsclass->input['show_mem'] : 'all'; $sort_order_value = (isset($this->ipsclass->input['sort_order']) AND $this->ipsclass->input['sort_order']) ? $this->ipsclass->input['sort_order'] : 'desc'; $sort_key_value = (isset($this->ipsclass->input['sort_key']) AND $this->ipsclass->input['sort_key']) ? $this->ipsclass->input['sort_key'] : 'click'; //----------------------------------------- // Get member groups //----------------------------------------- $our_mgroups = array(); if( $this->ipsclass->member['mgroup_others'] ) { $our_mgroups = explode( ",", $this->ipsclass->clean_perm_string( $this->ipsclass->member['mgroup_others'] ) ); } $our_mgroups[] = $this->ipsclass->member['mgroup']; //----------------------------------------- // Build lists //----------------------------------------- $oo = "