Version 4.7.0

This commit is contained in:
Neo committed 2025-12-19 16:00:35 -08:00
1 parent 517a5e1f70
commit 8ba7d43898
1933 files changed
+65613 -11332

No files matched your search

+13 -5
View File
@@ -87,6 +87,15 @@ trait Statistics
if ( $reload )
{
$items = iterator_to_array( \IPS\Db::i()->select( 'map_item_id, map_member_id', 'core_item_member_map', array(array('map_class=?', $contentItemClass), array(\IPS\Db::i()->in( 'map_item_id', $inSet ) ) ) ) );
$itemIds = [];
if ( \count( $items ) )
{
foreach ( $items as $row )
{
$itemIds[] = $row['map_item_id'];
}
}
if ( $itemIds )
{
@@ -223,7 +232,6 @@ trait Statistics
$commentClass = $contentItemClass::$commentClass;
$commentItemField = $commentClass::$databasePrefix . $commentClass::$databaseColumnMap['item'];
$authorColumn = $commentClass::$databasePrefix . $commentClass::$databaseColumnMap['author'];
$dateColumn = $commentClass::$databasePrefix . $commentClass::$databaseColumnMap['date'];
$where = array();
$deleteWhere = array( array( \IPS\Db::i()->in( 'map_item_id', $inSet ) ) );
@@ -258,9 +266,9 @@ trait Statistics
$itemWhere[] = array( \IPS\Db::i()->in( $hiddenColumn, array( 0, 2 ) ) ); # We want approved comments but also comments hidden because the item is hidden
}
$itemWhere[] = array( \IPS\Db::i()->in( $contentItemClass::$databaseColumnId, $inSet ) );
$itemWhere[] = array( \IPS\Db::i()->in( $contentItemClass::$databasePrefix . $contentItemClass::$databaseColumnId, $inSet ) );
$insertFromSelect = \IPS\Db::i()->select( "'" . str_replace( '\\', '\\\\', $contentItemClass ) . "', `{$contentItemClass::$databaseColumnId}`, `{$itemAuthorColumn}`, `{$itemDateColumn}`" , $contentItemClass::$databaseTable, $itemWhere );
$insertFromSelect = \IPS\Db::i()->select( "'" . str_replace( '\\', '\\\\', $contentItemClass ) . "', `{$contentItemClass::$databasePrefix}{$contentItemClass::$databaseColumnId}`, `{$itemAuthorColumn}`, `{$itemDateColumn}`" , $contentItemClass::$databaseTable, $itemWhere );
\IPS\Db::i()->replace( 'core_item_member_map', $insertFromSelect, TRUE );
}
@@ -283,8 +291,8 @@ trait Statistics
$where[] = array(\IPS\Db::i()->in( $commentItemField, $inSet ));
$insertFromSelect = \IPS\Db::i()->select( "'" . str_replace( '\\', '\\\\', $contentItemClass ) . "', `{$commentItemField}`, `{$authorColumn}`, `{$dateColumn}`", $commentClass::$databaseTable, $where, $dateColumn . ' ASC' );
\IPS\Db::i()->replace( 'core_item_member_map', $insertFromSelect, TRUE );
$insertFromSelect = \IPS\Db::i()->select( "DISTINCT `{$authorColumn}`, `{$commentItemField}`, UNIX_TIMESTAMP(), '" . str_replace( '\\', '\\\\', $contentItemClass ) . "'", $commentClass::$databaseTable, $where );
\IPS\Db::i()->replace( 'core_item_member_map', [ 'map_member_id, map_item_id, map_latest_date, map_class', $insertFromSelect ], TRUE );
}
}