Version 4.7.23

This commit is contained in:
Neo committed 2025-12-19 16:21:27 -08:00
1 parent 7124a02564
commit 25ddeb65d6
1791 files changed
+76990 -44452

No files matched your search

+60 -2
View File
@@ -143,8 +143,66 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\EditHistory,
if( $item->album_id )
{
\IPS\gallery\Album::load( $item->album_id )->setLastComment();
\IPS\gallery\Album::load( $item->album_id )->save();
$album = $item->directContainer();
$album->setLastComment( $this, $item );
/* We need to increment the counters here because the parent method will increment
the category but not the album */
if ( !$item->hidden() and ! $item->approvedButHidden() and !$item->isFutureDate() )
{
$album->_comments = ( $album->_comments + 1 );
}
elseif ( !$item->approvedButHidden() AND $this->hidden() == 1 )
{
$album->_unapprovedComments = ( $album->_unapprovedComments >= 0 ) ? ( $album->_unapprovedComments + 1 ) : 0;
}
$album->save();
}
}
/**
* Syncing to run when hiding
*
* @param \IPS\Member|NULL|FALSE $member The member doing the action (NULL for currently logged in member, FALSE for no member)
* @return void
*/
public function onHide( $member )
{
parent::onHide( $member );
$item = $this->item();
if( $item->album_id )
{
$album = $item->directContainer();
$album->setLastComment();
$album->_comments = ( $album->_comments - 1 );
$album->save();
}
}
/**
* Syncing to run when unhiding
*
* @param bool $approving If true, is being approved for the first time
* @param \IPS\Member|NULL|FALSE $member The member doing the action (NULL for currently logged in member, FALSE for no member)
* @return void
*/
public function onUnhide( $approving, $member )
{
parent::onUnhide( $approving, $member );
$item = $this->item();
if( $item->album_id )
{
$album = $item->directContainer();
$album->setLastComment( $this );
$album->_comments = ( $album->_comments + 1 );
if( $approving )
{
$album->_unapprovedComments = ( $album->_unapprovedComments > 0 ) ? ( $album->_unapprovedComments - 1 ) : 0;
}
$album->save();
}
}