Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+15 -14
View File
@@ -2,9 +2,9 @@
/**
* @brief Stats Widget
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @package IPS Community Suite
* @since 21 Nov 2013
* @version SVN_VERSION_NUMBER
*/
@@ -88,12 +88,16 @@ class _stats extends \IPS\Widget\StaticCache
{
$stats = array();
$mostOnline = json_decode( \IPS\Settings::i()->most_online, TRUE );
/* fetch only successful registered members ; if this needs to be changed, please review the other areas where we have the name<>? AND email<>? condition */
$where = array( 'name<>? AND email<>?', '', '' );
/* Member count */
$stats['member_count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_members', array( 'name<>? AND email<>?', '', '' ) )->first();
$stats['member_count'] = \IPS\Db::i()->select( 'COUNT(*)', 'core_members', $where )->first();
/* Most online */
$count = \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() ) )->first();
$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);
if( $count > $mostOnline['count'] )
{
$mostOnline = array( 'count' => $count, 'time' => time() );
@@ -104,7 +108,7 @@ class _stats extends \IPS\Widget\StaticCache
/* Last Registered Member */
$exclude = array();
$where = array( 'name IS NOT NULL AND name != \'\' AND temp_ban != -1' );
$where = array( array( "name IS NOT NULL AND name != '' AND temp_ban != -1 AND email != ''" ) );
foreach( \IPS\Member\Group::groups() as $id => $group )
{
if ( $group->g_hide_online_list )
@@ -114,17 +118,14 @@ class _stats extends \IPS\Widget\StaticCache
}
if ( count( $exclude ) )
{
$where[] = '( ! ( ' . \IPS\Db::i()->in( 'member_group_id', $exclude ) . ' ) )';
$where[] = array( '( ! ( ' . \IPS\Db::i()->in( 'member_group_id', $exclude ) . ' ) )' );
}
$where[] = '( ! ' . \IPS\Db::i()->bitwiseWhere( \IPS\Member::$bitOptions['members_bitoptions'], 'bw_is_spammer' ) . ' )';
$where[] = 'core_validating.new_reg IS NULL';
$where[] = array( '( ! ' . \IPS\Db::i()->bitwiseWhere( \IPS\Member::$bitOptions['members_bitoptions'], 'bw_is_spammer' ) . ' )' );
$where[] = array( 'member_id NOT IN(?)', \IPS\Db::i()->select( 'member_id', 'core_validating', array( 'new_reg=1' ) ) );
try
{
$stats['last_registered'] = \IPS\Member::constructFromData(
\IPS\Db::i()->select( 'core_members.*, core_validating.new_reg', 'core_members', array( implode( ' AND ', $where ) ), 'core_members.member_id DESC', array( 0, 1 ) )->join(
'core_validating',
"core_validating.member_id=core_members.member_id"
)->first() );
$stats['last_registered'] = \IPS\Member::constructFromData( \IPS\Db::i()->select( 'core_members.*', 'core_members', $where, 'core_members.member_id DESC', array( 0, 1 ) )->first() );
}
catch( \UnderflowException $ex )
{