Version 4.7.13
This commit is contained in:
1 parent
fd22d99e69
commit
7124a02564
954 files changed
+29277
-59308
No files matched your search
@@ -20,7 +20,7 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* activeUsers Widget
|
||||
*/
|
||||
class _activeUsers extends \IPS\Widget\StaticCache
|
||||
class _activeUsers extends \IPS\Widget\PermissionCache
|
||||
{
|
||||
/**
|
||||
* @brief Widget Key
|
||||
@@ -79,9 +79,25 @@ class _activeUsers extends \IPS\Widget\StaticCache
|
||||
\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 ) );
|
||||
}
|
||||
|
||||
/* We want to use the user's permissions array which will validate social groups, clubs and groups. But, we need to remove the individual member entry */
|
||||
$member = \IPS\Member::loggedIn() ?: new \IPS\Member;
|
||||
$permissions = $member->permissionArray();
|
||||
|
||||
foreach( $permissions as $key => $entry )
|
||||
{
|
||||
if( mb_substr( $entry, 0, 1 ) === 'm' )
|
||||
{
|
||||
unset( $permissions[ $key ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* We sort to ensure the array is always in the same order */
|
||||
sort( $permissions );
|
||||
|
||||
$theme = $member->skin ?: \IPS\Theme::defaultTheme();
|
||||
$this->cacheKey = "widget_{$this->key}_" . $this->uniqueKey . '_' . md5( $this->url . '_' . json_encode( $configuration ) . "_" . $member->language()->id . "_" . $theme . "_" . $orientation . '-' . (int) \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) );
|
||||
$this->cacheKey = "widget_{$this->key}_" . $this->uniqueKey . '_' . md5( $this->url . '_' . json_encode( $configuration ) . "_" . $member->language()->id . "_" . $theme . "_" . json_encode( $permissions ) . $orientation . '-' . (int) \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'members', 'front' ) ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* @brief communityhive Widget
|
||||
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
|
||||
* @copyright (c) Invision Power Services, Inc.
|
||||
* @license https://www.invisioncommunity.com/legal/standards/
|
||||
* @package Invision Community
|
||||
* @since 21 Aug 2023
|
||||
*/
|
||||
|
||||
namespace IPS\core\widgets;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
use IPS\Settings;
|
||||
|
||||
/**
|
||||
* communityhive Widget
|
||||
*/
|
||||
class _communityhive extends \IPS\Widget
|
||||
{
|
||||
/**
|
||||
* @brief Widget Key
|
||||
*/
|
||||
public $key = 'communityhive';
|
||||
|
||||
/**
|
||||
* @brief App
|
||||
*/
|
||||
public $app = 'core';
|
||||
|
||||
/**
|
||||
* @brief Plugin
|
||||
*/
|
||||
public $plugin = '';
|
||||
|
||||
/**
|
||||
* Initialise this widget
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify widget configuration
|
||||
*
|
||||
* @param null|\IPS\Helpers\Form $form Form object
|
||||
* @return null|\IPS\Helpers\Form
|
||||
*/
|
||||
public function configuration( &$form=null )
|
||||
{
|
||||
$form = parent::configuration( $form );
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ran before saving widget configuration
|
||||
*
|
||||
* @param array $values Values from form
|
||||
* @return array
|
||||
*/
|
||||
public function preConfig( $values )
|
||||
{
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a widget
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
if ( Settings::i()->hive_enabled AND \IPS\core\Hive::showPromotion() )
|
||||
{
|
||||
return $this->output();
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
/**
|
||||
* whosOnline Widget
|
||||
*/
|
||||
class _whosOnline extends \IPS\Widget\StaticCache
|
||||
class _whosOnline extends \IPS\Widget\PermissionCache
|
||||
{
|
||||
/**
|
||||
* @brief Widget Key
|
||||
@@ -59,9 +59,25 @@ class _whosOnline extends \IPS\Widget\StaticCache
|
||||
\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 ) );
|
||||
}
|
||||
|
||||
/* We want to use the user's permissions array which will validate social groups, clubs and groups. But, we need to remove the individual member entry */
|
||||
$member = \IPS\Member::loggedIn() ?: new \IPS\Member;
|
||||
$permissions = $member->permissionArray();
|
||||
|
||||
foreach( $permissions as $key => $entry )
|
||||
{
|
||||
if( mb_substr( $entry, 0, 1 ) === 'm' )
|
||||
{
|
||||
unset( $permissions[ $key ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* We sort to ensure the array is always in the same order */
|
||||
sort( $permissions );
|
||||
|
||||
$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' ) ) );
|
||||
$this->cacheKey = "widget_{$this->key}_" . $this->uniqueKey . '_' . md5( json_encode( $configuration ) . "_" . $member->language()->id . "_" . $theme . "_" . json_encode( $permissions ) . $orientation . '-' . (int) \IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'online', 'front' ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user