Version 4.7.13

This commit is contained in:
Neo committed 2025-12-19 16:14:56 -08:00
1 parent fd22d99e69
commit 7124a02564
954 files changed
+29277 -59308

No files matched your search

+20 -4
View File
@@ -153,11 +153,11 @@ trait Statistics
if ( $name )
{
$subQuery = \IPS\Db::i()->select( 'core_members.member_id', 'core_members', \IPS\Db::i()->like( 'core_members.name', $name ) );
$where[] = [ $commentClass::$databaseTable . '.' . $commentClass::$databaseColumnMap['author'] . ' IN(?)', $subQuery ];
$where[] = [ $commentClass::$databaseTable . '.' . $commentClass::$databasePrefix . $commentClass::$databaseColumnMap['author'] . ' IN(?)', $subQuery ];
}
$members = iterator_to_array( \IPS\Db::i()->select(
$commentClass::$databaseColumnMap['author'],
$commentClass::$databasePrefix . $commentClass::$databaseColumnMap['author'],
$commentClass::$databaseTable,
$where,
NULL,
@@ -232,7 +232,7 @@ trait Statistics
$return = array();
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', $commentClass::$databaseTable, array( \IPS\Db::i()->in( $commentIdField, $postIds ) ), "FIND_IN_SET( {$commentIdField}, '" . implode( ",", $postIds ) . "' )", array( 0, $count ) ), $commentClass ) as $comment )
{
if ( $comment->canView() and $comment->mapped('item') == $this->$idField )
if ( $comment->canView() and $comment->mapped('item') == $this->$idField and isset( $counts[ $comment->$commentIdField ] ) )
{
$return[] = array( 'comment' => $comment, 'count' => $counts[ $comment->$commentIdField ] );
}
@@ -402,7 +402,18 @@ trait Statistics
protected function _getVisibleWhere()
{
$commentClass = static::$commentClass;
$idField = static::$databaseColumnId;
$lookFor = 'IPS\cms\Records\CommentTopicSync';
if ( mb_substr( $commentClass, 0, mb_strlen( $lookFor ) ) === $lookFor )
{
$idField = 'record_topicid';
}
else
{
$idField = static::$databaseColumnId;
}
$commentItemField = $commentClass::$databasePrefix . $commentClass::$databaseColumnMap['item'];
$where = array();
@@ -417,6 +428,11 @@ trait Statistics
$where[] = array( "{$hiddenColumn} = 0" );
}
if ( $commentClass::commentWhere() !== NULL )
{
$where[] = $commentClass::commentWhere();
}
$where[] = array( $commentItemField . '=?', $this->$idField );
return $where;