Version 5.0.0 release
This commit is contained in:
1 parent
90e8c7e903
commit
a3a4a9ccbd
651 files changed
+7275
-9481
No files matched your search
@@ -73,6 +73,7 @@ use OutOfRangeException;
|
||||
use RuntimeException;
|
||||
use SplObserver;
|
||||
use SplSubject;
|
||||
use function array_reverse;
|
||||
use function array_slice;
|
||||
use function count;
|
||||
use function defined;
|
||||
@@ -1654,22 +1655,33 @@ class Topic extends Item implements Embeddable,
|
||||
$minMax = ( $orderDirection === 'asc' ) ? 'MIN' : 'MAX';
|
||||
/* Do some mojo to get the lowest comment and highest comment for archived topics */
|
||||
$row = ArchivedPost::db()->select( "{$minMax}( CONCAT( archive_content_date, '.', archive_id) ) as pid", 'forums_archive_posts', array( [ 'archive_topic_id=?', $this->tid, ArchivedPost::db()->in( 'archive_queued', [0,2] ) ] ) )->first();
|
||||
$pid = (int) explode( '.', $row )[1];
|
||||
|
||||
if( is_array( $extraWhereClause ) or is_null( $extraWhereClause ) )
|
||||
if ( ! $row )
|
||||
{
|
||||
$extraWhereClause[] = [ 'archive_id=?', $pid ];
|
||||
$comments[ $_hash ] = [];
|
||||
}
|
||||
else if ( is_string( $extraWhereClause ) )
|
||||
else
|
||||
{
|
||||
$extraWhereClause = [
|
||||
[ $extraWhereClause ],
|
||||
[ 'archive_id=?', $pid ]
|
||||
];
|
||||
}
|
||||
$pid = (int)explode( '.', $row )[1];
|
||||
|
||||
$data = $this->_comments( $class, 1, 0, ( isset( $class::$databaseColumnMap[$order] ) ? ( $class::$databasePrefix . $class::$databaseColumnMap[$order] ) : $order ) . ' ' . $orderDirection, $member, $includeHiddenComments, $cutoff, $canViewWarn, $extraWhereClause, $includeDeleted );
|
||||
$comments[ $_hash ] = is_array( $data ) ? array_reverse( $data, true ) : $data;
|
||||
if ( is_array( $extraWhereClause ) or is_null( $extraWhereClause ) )
|
||||
{
|
||||
$extraWhereClause[] = ['archive_id=?', $pid];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( is_string( $extraWhereClause ) )
|
||||
{
|
||||
$extraWhereClause = [
|
||||
[$extraWhereClause],
|
||||
['archive_id=?', $pid]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$data = $this->_comments( $class, 1, 0, ( isset( $class::$databaseColumnMap[$order] ) ? ( $class::$databasePrefix . $class::$databaseColumnMap[$order] ) : $order ) . ' ' . $orderDirection, $member, $includeHiddenComments, $cutoff, $canViewWarn, $extraWhereClause, $includeDeleted );
|
||||
$comments[$_hash] = is_array( $data ) ? array_reverse( $data, true ) : $data;
|
||||
}
|
||||
|
||||
$alreadyDone = true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user