Version 2.1.7
This commit is contained in:
1 parent
0eecc172d9
commit
f73f8bff6d
941 files changed
+215301
-103093
No files matched your search
@@ -0,0 +1,271 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
| Ïðàâà íà ïåðåâîä IBResource (http://www.ibresource.ru)
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $
|
||||
| > $Revision: 23 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > PORTAL PLUG IN MODULE: SHOW ONLINE USERS
|
||||
| > Module written by Matt Mecham
|
||||
| > Date started: Tuesday 2nd August 2005 (12:56)
|
||||
+--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* Portal Plug In Module
|
||||
*
|
||||
* This module shows the online users
|
||||
*
|
||||
* @package InvisionPowerBoard
|
||||
* @subpackage PortalPlugIn
|
||||
* @author Matt Mecham
|
||||
* @copyright Invision Power Services, Inc.
|
||||
* @version 2.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Portal Plug In Module
|
||||
*
|
||||
* This module shows the online users
|
||||
* Each class name MUST be in the format of:
|
||||
* ppi_{file_name_minus_dot_php}
|
||||
*
|
||||
* @package InvisionPowerBoard
|
||||
* @subpackage PortalPlugIn
|
||||
* @author Matt Mecham
|
||||
* @copyright Invision Power Services, Inc.
|
||||
* @version 2.1
|
||||
*/
|
||||
class ppi_online_users
|
||||
{
|
||||
/**
|
||||
* IPS Global object
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
var $ipsclass;
|
||||
|
||||
/**
|
||||
* Array of portal objects including:
|
||||
* good_forum, bad_forum
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
var $portal_object = array();
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// INIT
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* This function must be available always
|
||||
* Add any set up here, such as loading language and skins, etc
|
||||
*
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
// MAIN FUNCTION
|
||||
/*-------------------------------------------------------------------------*/
|
||||
/**
|
||||
* Main function
|
||||
*
|
||||
* @return VOID
|
||||
*/
|
||||
function online_users_show()
|
||||
{
|
||||
$this->sep_char = '<{ACTIVE_LIST_SEP}>';
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the users from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$time = time() - ( ($this->ipsclass->vars['au_cutoff'] ? $this->ipsclass->vars['au_cutoff'] : 15) * 60 );
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, member_id, member_name, login_type, running_time, member_group',
|
||||
'from' => 'sessions',
|
||||
'where' => "running_time > $time",
|
||||
'order' => "running_time DESC"
|
||||
) );
|
||||
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
//-----------------------------------------
|
||||
// Cache all printed members
|
||||
//-----------------------------------------
|
||||
|
||||
if ($this->ipsclass->vars['au_cutoff'] == "")
|
||||
{
|
||||
$this->ipsclass->vars['au_cutoff'] = 15;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the users from the DB
|
||||
//-----------------------------------------
|
||||
|
||||
$cut_off = $this->ipsclass->vars['au_cutoff'] * 60;
|
||||
$time = time() - $cut_off;
|
||||
$qe = "";
|
||||
$rows = array( 0 => array( 'login_type' => substr($this->ipsclass->member['login_anonymous'],0, 1),
|
||||
'running_time' => time(),
|
||||
'member_id' => $this->ipsclass->member['id'],
|
||||
'member_name' => $this->ipsclass->member['members_display_name'],
|
||||
'member_group' => $this->ipsclass->member['mgroup'] ) );
|
||||
|
||||
if ( $this->ipsclass->member['id'] )
|
||||
{
|
||||
$qe = "member_id !=".intval($this->ipsclass->member['id'])." AND ";
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => 'id, member_id, member_name, login_type, running_time, member_group',
|
||||
'from' => 'sessions',
|
||||
'where' => $qe." running_time > $time",
|
||||
'order' => "running_time DESC"
|
||||
) );
|
||||
|
||||
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
//-----------------------------------------
|
||||
// FETCH...
|
||||
//-----------------------------------------
|
||||
|
||||
while ($r = $this->ipsclass->DB->fetch_row() )
|
||||
{
|
||||
$rows[] = $r;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// cache all printed members so we
|
||||
// don't double print them
|
||||
//-----------------------------------------
|
||||
|
||||
$cached = array();
|
||||
|
||||
foreach ( $rows as $result )
|
||||
{
|
||||
$last_date = $this->ipsclass->get_time( $result['running_time'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Bot?
|
||||
//-----------------------------------------
|
||||
|
||||
if ( strstr( $result['id'], '_session' ) )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Seen bot of this type yet?
|
||||
//-----------------------------------------
|
||||
|
||||
$botname = preg_replace( '/^(.+?)=/', "\\1", $result['id'] );
|
||||
|
||||
if ( ! $cached[ $result['member_name'] ] )
|
||||
{
|
||||
if ( $this->ipsclass->vars['spider_anon'] )
|
||||
{
|
||||
if ( $this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group'] )
|
||||
{
|
||||
$active['NAMES'] .= "{$result['member_name']}*{$this->sep_char} \n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['NAMES'] .= "{$result['member_name']}{$this->sep_char} \n";
|
||||
}
|
||||
|
||||
$cached[ $result['member_name'] ] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Yup, count others as guest
|
||||
//-----------------------------------------
|
||||
|
||||
$active['GUESTS']++;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Guest?
|
||||
//-----------------------------------------
|
||||
|
||||
else if ($result['member_id'] == 0 )
|
||||
{
|
||||
$active['GUESTS']++;
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Member?
|
||||
//-----------------------------------------
|
||||
|
||||
else
|
||||
{
|
||||
if ( empty( $cached[ $result['member_id'] ] ) )
|
||||
{
|
||||
$cached[ $result['member_id'] ] = 1;
|
||||
|
||||
$result['prefix'] = $this->ipsclass->cache['group_cache'][ $result['member_group'] ]['prefix'];
|
||||
$result['suffix'] = $this->ipsclass->cache['group_cache'][ $result['member_group'] ]['suffix'];
|
||||
|
||||
if ($result['login_type'])
|
||||
{
|
||||
if ( ($this->ipsclass->member['mgroup'] == $this->ipsclass->vars['admin_group']) and ($this->ipsclass->vars['disable_admin_anon'] != 1) )
|
||||
{
|
||||
$active['NAMES'] .= "<a href='{$this->ipsclass->base_url}showuser={$result['member_id']}' title='$last_date'>{$result['prefix']}{$result['member_name']}{$result['suffix']}</a>*{$this->sep_char} \n";
|
||||
$active['ANON']++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['ANON']++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$active['MEMBERS']++;
|
||||
$active['NAMES'] .= "<a href='{$this->ipsclass->base_url}showuser={$result['member_id']}' title='$last_date'>{$result['prefix']}{$result['member_name']}{$result['suffix']}</a>{$this->sep_char} \n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$active['names'] = preg_replace( "/".preg_quote($this->sep_char)."$/", "", trim($active['NAMES']) );
|
||||
|
||||
$active['total'] = $active['MEMBERS'] + $active['GUESTS'] + $active['ANON'];
|
||||
$active['visitors'] = $active['GUESTS'] + $active['ANON'];
|
||||
$active['members'] = $active['MEMBERS'];
|
||||
|
||||
//-----------------------------------------
|
||||
// Parse language
|
||||
//-----------------------------------------
|
||||
|
||||
$breakdown = sprintf( $this->ipsclass->lang['online_breakdown'], intval($active['total']) );
|
||||
$split = sprintf( $this->ipsclass->lang['online_split'] , intval($active['members']), intval($active['visitors']) );
|
||||
|
||||
|
||||
return $this->ipsclass->compiled_templates['skin_portal']->tmpl_onlineusers($breakdown, $split, $active['names']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in new issue
Block a user