Version 4.6.0
This commit is contained in:
1 parent
f79dcf067a
commit
517a5e1f70
2036 files changed
+110041
-26162
No files matched your search
@@ -20,7 +20,7 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* activeUsers Widget
|
||||
*/
|
||||
class _activeUsers extends \IPS\Widget
|
||||
class _activeUsers extends \IPS\Widget\StaticCache
|
||||
{
|
||||
/**
|
||||
* @brief Widget Key
|
||||
@@ -37,6 +37,30 @@ class _activeUsers extends \IPS\Widget
|
||||
*/
|
||||
public $plugin = '';
|
||||
|
||||
/**
|
||||
* @brief Cache Expiration
|
||||
* @note We only let this cache be valid for up to 60 seconds
|
||||
*/
|
||||
public $cacheExpiration = 60;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param String $uniqueKey Unique key for this specific instance
|
||||
* @param array $configuration Widget custom configuration
|
||||
* @param null|string|array $access Array/JSON string of executable apps (core=sidebar only, content=IP.Content only, etc)
|
||||
* @param null|string $orientation Orientation (top, bottom, right, left)
|
||||
* @return void
|
||||
*/
|
||||
public function __construct( $uniqueKey, array $configuration, $access=null, $orientation=null )
|
||||
{
|
||||
parent::__construct( $uniqueKey, $configuration, $access, $orientation );
|
||||
|
||||
$member = \IPS\Member::loggedIn() ?: new \IPS\Member;
|
||||
|
||||
$this->cacheKey = "widget_{$this->key}_" . $this->uniqueKey . '_' . md5( json_encode( $configuration ) . "_" . $member->language()->id . "_" . $member->skin . "_" . $orientation . '-' . (int) \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members' ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a widget
|
||||
*
|
||||
@@ -82,18 +106,21 @@ class _activeUsers extends \IPS\Widget
|
||||
|
||||
if( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
if( !isset( $members[ \IPS\Member::loggedIn()->member_id ] ) )
|
||||
if( !\IPS\Member::loggedIn()->isOnlineAnonymously() )
|
||||
{
|
||||
$memberCount++;
|
||||
if( !isset( $members[ \IPS\Member::loggedIn()->member_id ] ) )
|
||||
{
|
||||
$memberCount++;
|
||||
}
|
||||
|
||||
$members = array_merge( array( \IPS\Member::loggedIn()->member_id => array(
|
||||
'member_id' => \IPS\Member::loggedIn()->member_id,
|
||||
'member_name' => \IPS\Member::loggedIn()->name,
|
||||
'seo_name' => \IPS\Member::loggedIn()->members_seo_name,
|
||||
'member_group' => \IPS\Member::loggedIn()->member_group_id,
|
||||
'in_editor' => 0
|
||||
) ), $members );
|
||||
}
|
||||
|
||||
$members = array_merge( array( \IPS\Member::loggedIn()->member_id => array(
|
||||
'member_id' => \IPS\Member::loggedIn()->member_id,
|
||||
'member_name' => \IPS\Member::loggedIn()->name,
|
||||
'seo_name' => \IPS\Member::loggedIn()->members_seo_name,
|
||||
'member_group' => \IPS\Member::loggedIn()->member_group_id,
|
||||
'in_editor' => 0
|
||||
) ), $members );
|
||||
}
|
||||
|
||||
/* Display */
|
||||
|
||||
Reference in new issue
Block a user