Version 4.3.0
This commit is contained in:
1 parent
96997ddd8e
commit
fe1acf984a
1349 files changed
+116159
-67711
No files matched your search
@@ -66,11 +66,9 @@ class _stats extends \IPS\Widget\StaticCache
|
||||
if ( \IPS\Member::loggedIn()->isAdmin() and \IPS\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'member_recount_content' ) )
|
||||
{
|
||||
$mostOnline = array( 'count' => $values['stats_most_online'], 'time' => time() );
|
||||
\IPS\Settings::i()->most_online = json_encode( $mostOnline );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => json_encode( $mostOnline ) ), array( 'conf_key=?', 'most_online' ) );
|
||||
\IPS\Settings::i()->changeValues( array( 'most_online' => json_encode( $mostOnline ) ) );
|
||||
|
||||
unset( $values['stats_most_online'] );
|
||||
unset( \IPS\Data\Store::i()->settings );
|
||||
|
||||
\IPS\Widget::deleteCaches( 'stats', 'core' );
|
||||
}
|
||||
@@ -95,13 +93,11 @@ class _stats extends \IPS\Widget\StaticCache
|
||||
$stats['member_count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_members', $where )->first();
|
||||
|
||||
/* Most online */
|
||||
$select = \IPS\Db::i()->select( 'COUNT(*)', 'core_sessions', array( 'login_type<>? and running_time > ?', \IPS\Session\Front::LOGIN_TYPE_SPIDER, \IPS\DateTime::create()->sub( new \DateInterval( 'PT30M' ) )->getTimeStamp() ), NULL, NULL, 'member_id', NULL, \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS );
|
||||
$count = $select->count(TRUE);
|
||||
$count = \IPS\Session\Store::i()->getOnlineUsers( \IPS\Session\Store::ONLINE_GUESTS | \IPS\Session\Store::ONLINE_MEMBERS | \IPS\Session\Store::ONLINE_COUNT_ONLY );
|
||||
if( $count > $mostOnline['count'] )
|
||||
{
|
||||
$mostOnline = array( 'count' => $count, 'time' => time() );
|
||||
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => json_encode( $mostOnline ) ), array( 'conf_key=?', 'most_online' ) );
|
||||
unset( \IPS\Data\Store::i()->settings );
|
||||
\IPS\Settings::i()->changeValues( array( 'most_online' => json_encode( $mostOnline ) ) );
|
||||
}
|
||||
$stats['most_online'] = $mostOnline;
|
||||
|
||||
|
||||
Reference in new issue
Block a user