Version 5.0.0 beta 8

This commit is contained in:
Neo committed 2025-12-19 17:30:12 -08:00
1 parent 54d5dcd0a0
commit 214f649f1d
483 files changed
+35354 -33568

No files matched your search

+18 -15
View File
@@ -82,7 +82,6 @@ use function in_array;
use function intval;
use function is_array;
use function is_subclass_of;
use function strlen;
use function time;
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
@@ -201,13 +200,9 @@ class Controller extends CoverPhotoController
}
/* We also want to update the views if we have a page parameter */
if( IPS::classUsesTrait( $item, 'IPS\Content\ReadMarkers' ) AND isset( Request::i()->page ) AND Request::i()->page )
if( IPS::classUsesTrait( $item, 'IPS\Content\ViewUpdates' ) and isset( $class::$databaseColumnMap['views'] ) AND isset( Request::i()->page ) AND Request::i()->page )
{
$idColumn = $class::$databaseColumnId;
if ( IPS::classUsesTrait( $class, 'IPS\Content\ViewUpdates' ) AND isset( $class::$databaseColumnMap['views'] ) )
{
$item->updateViews();
}
$item->updateViews();
}
return $item;
@@ -303,6 +298,11 @@ class Controller extends CoverPhotoController
{
$item->updateViews();
}
else
{
/* Fire the event for items that don't implement the ViewUpdates trait */
Event::fire( 'onItemView', $item );
}
/* Mark read */
if( IPS::classUsesTrait( $item, 'IPS\Content\ReadMarkers' ) )
@@ -766,12 +766,12 @@ class Controller extends CoverPhotoController
throw new DomainException;
}
/* Get our current tags */
$existingTags = ( $item->prefix() ? array_merge( array( 'prefix' => $item->prefix() ), $item->tags() ) : $item->tags() );
/* If we are simply removing a tag, do it */
if( isset( Request::i()->removeTag ) )
{
/* Get our current tags */
$existingTags = ( $item->prefix() ? array_merge( array( 'prefix' => $item->prefix() ), $item->tags() ) : $item->tags() );
/* Remove the tag from the array. Preserve index since it could be 'prefix' which we need to remember. */
foreach( $existingTags as $index => $tag )
{
@@ -834,6 +834,9 @@ class Controller extends CoverPhotoController
$toReturn['prefix'] = Theme::i()->getTemplate( 'global', 'core' )->tag( $item->prefix(), $item->url(), 'ipsTags__item--prefix' );
}
$newTags = ( $item->prefix() ? array_merge( array( 'prefix' => $item->prefix() ), $item->tags() ) : $item->tags() );
$toReturn['tagsChanged'] = (int) ( $newTags !== $existingTags );
Output::i()->json( $toReturn );
}
else
@@ -906,7 +909,7 @@ class Controller extends CoverPhotoController
/* Stop doing anything if the title wasn't changed */
if( $item->$titleField == $newTitle->value )
{
\IPS\Output::i()->json( $item->$titleField );
Output::i()->json( $item->$titleField );
}
$item->$titleField = $newTitle->value;
@@ -1496,12 +1499,12 @@ class Controller extends CoverPhotoController
/* Has this guest already reported this? */
try
{
$index = Db::i()->select( '*', 'core_rc_index', [ 'class=? and content_id=?', \get_class( $item ), $item->$idColumn ] )->first();
$index = Db::i()->select( '*', 'core_rc_index', [ 'class=? and content_id=?', get_class( $item ), $item->$idColumn ] )->first();
$report = Db::i()->select( '*', 'core_rc_reports', [ 'rid=? and guest_email=?', $index['id'], $values['report_guest_email'] ] )->first();
Output::i()->error( 'report_err_already_reported', '2S136/11', 403, '' );
}
catch( \UnderflowException )
catch( UnderflowException )
{
/* The query failed, so this is a new report */
}
@@ -3434,12 +3437,12 @@ class Controller extends CoverPhotoController
/* Has this guest already reported this? */
try
{
$index = Db::i()->select( '*', 'core_rc_index', [ 'class=? and content_id=?', \get_class( $comment ), $comment->$idColumn ] )->first();
$index = Db::i()->select( '*', 'core_rc_index', [ 'class=? and content_id=?', get_class( $comment ), $comment->$idColumn ] )->first();
$report = Db::i()->select( '*', 'core_rc_reports', [ 'rid=? and guest_email=?', $index['id'], $values['report_guest_email'] ] )->first();
Output::i()->error( 'report_err_already_reported', '2S136/11', 403, '' );
}
catch( \UnderflowException )
catch( UnderflowException )
{
/* The query failed, so this is a new report */
}