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

@@ -110,23 +110,26 @@ class _AnswerMarkedBest extends \IPS\core\Achievements\Actions\AbstractAchieveme
/**
* Get the labels for the people this action might give awards to
*
* @param array|NULL $filters Current filter values
*
* @return array
*/
public function awardOptions(): array
public function awardOptions( ?array $filters ): array
{
return [
'subject' => 'achievement_filter_AnswerMarkedBest_poster',
'other' => 'achievement_filter_AnswerMarkedBest_asker'
];
}
/**
* Get the "other" people we need to award =stuff to
*
* @param mixed $extra Any additional information about what is happening (e.g. if a post is being made: the post object)
* @param mixed $extra Any additional information about what is happening (e.g. if a post is being made: the post object)
* @param array|NULL $filters Current filter values
* @return array
*/
public function awardOther( $extra = NULL ): array
public function awardOther( $extra = NULL, ?array $filters = NULL ): array
{
return [ $extra->item()->author() ];
}
@@ -45,6 +45,37 @@ class _Forums
{
return NULL;
}
/**
* Can whatever is posted in this editor be moderated?
* If this returns TRUE, we must ensure the content is ran through word, link and image filters
*
* @param \IPS\Member $member The member
* @param \IPS\Helpers\Form\Editor $field The editor field
* @return bool
*/
public function canBeModerated( $member, $field )
{
/* Creating/editing a forum */
if ( preg_match( '/^forums\-(?:forum|rules|permerror)\-\d+$/', $field->options['autoSaveKey'] ) or preg_match( '/^forums\-new\-(?:forum|rules|permerror)\d+$/', $field->options['autoSaveKey'] ) )
{
return FALSE;
}
/* Creating/editing a topic/post */
elseif ( preg_match( '/^(?:newContentItem|contentEdit|editComment|reply)\-forums\/forums\-\d+/', $field->options['autoSaveKey'] ) )
{
return TRUE;
}
/* Unknown */
else
{
if ( \IPS\IN_DEV )
{
throw new \RuntimeException( 'Unknown canBeModerated: ' . $field->options['autoSaveKey'] );
}
return FALSE;
}
}
/**
* Permission check for attachments
@@ -46,16 +46,24 @@ class _DeleteLegacyPosts
*/
public function run( $data, $offset )
{
$select = \IPS\Db::i()->select( '*', 'forums_posts', 'queued > 2', 'pid ASC', array( 0, \IPS\REBUILD_NORMAL ) );
$select = \IPS\Db::i()->select( '*', 'forums_posts', 'queued > 2', NULL, array( 0, \IPS\REBUILD_NORMAL ) );
if ( !\count( $select ) )
{
throw new \IPS\Task\Queue\OutOfRangeException;
}
$done = 0;
foreach( new \IPS\Patterns\ActiveRecordIterator( $select, 'IPS\forums\Topic\Post' ) as $post )
foreach( $select as $post )
{
$post->logDelete( FALSE );
try
{
\IPS\forums\Topic\Post::constructFromData( $post )->logDelete( FALSE );
}
catch( \Exception $e )
{
\IPS\Db::i()->update( 'forums_posts', [ 'queued' => '-1' ], [ 'pid=?', $post['pid'] ] );
}
$done++;
}