Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -52,7 +52,16 @@ class _whosOnline extends \IPS\Widget\StaticCache
|
||||
|
||||
$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' ) ) );
|
||||
if( $member->member_id AND !$member->isOnlineAnonymously() )
|
||||
{
|
||||
\IPS\Output::i()->jsVars['member_id'] = $member->member_id;
|
||||
\IPS\Output::i()->jsVars['member_url'] = (string) $member->url();
|
||||
\IPS\Output::i()->jsVars['member_hovercardUrl'] = (string) $member->url()->setQueryString( 'do', 'hovercard' );
|
||||
\IPS\Output::i()->jsVars['member_formattedName'] = str_replace( '"', '\\"', \IPS\Member\Group::load( $member->member_group_id )->formatName( $member->name ) );
|
||||
}
|
||||
|
||||
$theme = $member->skin ?: \IPS\Theme::defaultTheme();
|
||||
$this->cacheKey = "widget_{$this->key}_" . $this->uniqueKey . '_' . md5( json_encode( $configuration ) . "_" . $member->language()->id . "_" . $theme . "_" . $orientation . '-' . (int) \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'online', 'front' ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,7 +72,7 @@ class _whosOnline extends \IPS\Widget\StaticCache
|
||||
public function render()
|
||||
{
|
||||
/* Do we have permission? */
|
||||
if ( !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'online' ) ) )
|
||||
if ( !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'online', 'front' ) ) )
|
||||
{
|
||||
return "";
|
||||
}
|
||||
@@ -79,12 +88,9 @@ class _whosOnline extends \IPS\Widget\StaticCache
|
||||
{
|
||||
/* Not-anonymous Member */
|
||||
case \IPS\Session\Front::LOGIN_TYPE_MEMBER:
|
||||
if ( $row['member_id'] != \IPS\Member::loggedIn()->member_id ) // We add them manually to make sure they go at the top of the list
|
||||
if ( $row['member_name'] )
|
||||
{
|
||||
if ( $row['member_name'] )
|
||||
{
|
||||
$members[ $row['member_id'] ] = $row;
|
||||
}
|
||||
$members[ $row['member_id'] ] = $row;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -104,23 +110,7 @@ class _whosOnline extends \IPS\Widget\StaticCache
|
||||
{
|
||||
$members = \array_slice( $members, 0, 60 );
|
||||
}
|
||||
|
||||
/* Add ourselves at the top of the list */
|
||||
if( \IPS\Member::loggedIn()->member_id )
|
||||
{
|
||||
if( !\IPS\Member::loggedIn()->isOnlineAnonymously() )
|
||||
{
|
||||
$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
|
||||
) ), $members );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Display */
|
||||
return $this->output( $members, $memberCount, $guests, $anonymous );
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user