Version 5.0.0 beta 6

This commit is contained in:
Neo committed 2025-12-19 17:12:27 -08:00
1 parent 57d9db6ce2
commit fa2a720105
115 files changed
+1823 -1147

No files matched your search

+10 -54
View File
@@ -927,60 +927,6 @@ abstract class Comment extends Content
return Theme::i()->getTemplate( static::$commentTemplate[0][0], static::$commentTemplate[0][1], ( isset( static::$commentTemplate[0][2] ) ) ? static::$commentTemplate[0][2] : NULL )->$template( $this->item(), $this );
}
/**
* Users to receive immediate notifications
*
* @param int|array|null $limit LIMIT clause
* @param boolean $countOnly Just return the count
* @return Select|int
*/
public function notificationRecipients( int|array|null $limit=array( 0, 25 ), bool $countOnly=FALSE ): Select|int
{
/* Do we only want the count? */
if( $countOnly )
{
$count = 0;
$count += $this->author()->followersCount( 3, array( 'immediate' ), $this->mapped('date') );
if( IPS::classUsesTrait( $this->item(), 'IPS\Content\Followable' ) )
{
$count += $this->item()->followersCount( 3, array( 'immediate' ), $this->mapped('date') );
}
return $count;
}
$memberFollowers = $this->author()->followers( 3, array( 'immediate' ), $this->mapped('date'), NULL );
if( $memberFollowers !== NULL AND $memberFollowers !== 0 and IPS::classUsesTrait( $this->item(), 'IPS\Content\Followable' ) )
{
$unions = array(
$this->item()->followers( 3, array( 'immediate' ), $this->mapped('date'), NULL ),
$memberFollowers
);
return Db::i()->union( $unions, 'follow_added', $limit );
}
else if( IPS::classUsesTrait( $this->item(), 'IPS\Content\Followable' ) )
{
return $this->item()->followers( static::FOLLOW_PUBLIC + static::FOLLOW_ANONYMOUS, array( 'immediate' ), $this->mapped('date'), $limit, 'follow_added' );
}
else
{
return $memberFollowers;
}
}
/**
* Create Notification
*
* @param string|NULL $extra Additional data
* @return Notification
*/
protected function createNotification( string|null $extra=NULL ): Notification
{
return new Notification( Application::load( 'core' ), 'new_comment', $this->item(), array( $this ) );
}
/**
* Move Comment to another item
@@ -1764,6 +1710,16 @@ abstract class Comment extends Content
{
return NULL;
}
/**
* Custom where conditions used specifically for finding comments
*
* @return array|null
*/
public static function findCommentWhere() : array|null
{
return static::commentWhere();
}
/**
* Is a featured comment?