Version 5.0.0 beta 10

This commit is contained in:
Neo committed 2025-12-19 17:53:48 -08:00
1 parent 56979f8ee8
commit 264eeb97e0
325 files changed
+6442 -1849

No files matched your search

@@ -16,6 +16,7 @@ use IPS\Content;
use IPS\Content\Comment;
use IPS\Content\Item;
use IPS\Content\Reaction;
use IPS\Content\ReadMarkers;
use IPS\DateTime;
use IPS\Db;
use IPS\Extensions\NotificationsAbstract;
@@ -113,7 +114,7 @@ class MyStuff extends NotificationsAbstract
'url' => $comment instanceof Item ? $item->url() : $comment->url('find'),
'content' => $comment->truncated(),
'author' => $comment->author(),
'unread' => (bool) ( $item->unread() ),
'unread' => ( IPS::classUsesTrait( $item, ReadMarkers::class ) and $item->unread() ),
);
}
@@ -209,7 +210,7 @@ class MyStuff extends NotificationsAbstract
'url' => $comment instanceof Item ? $item->url() : $comment->url('find'),
'content' => $comment->truncated(),
'author' => $comment->author(),
'unread' => (bool) ( $item->unread() ),
'unread' => ( IPS::classUsesTrait( $item, ReadMarkers::class ) and $item->unread() ),
);
}
@@ -497,7 +498,7 @@ class MyStuff extends NotificationsAbstract
'url' => $comment instanceof Item ? $item->url() : $comment->url('find'),
'content' => $comment->truncated(),
'author' => $comment->author(),
'unread' => (bool) ( $item->unread() ),
'unread' => ( IPS::classUsesTrait( $item, ReadMarkers::class ) and $item->unread() ),
);
}
@@ -571,7 +572,7 @@ class MyStuff extends NotificationsAbstract
/* Unread? */
$unread = false;
if ( $item->timeLastRead() instanceof DateTime )
if ( IPS::classUsesTrait( $item, ReadMarkers::class ) and $item->timeLastRead() instanceof DateTime )
{
$unread = ( $item->timeLastRead()->getTimestamp() < $notification->updated_time->getTimestamp() );
}
@@ -654,7 +655,7 @@ class MyStuff extends NotificationsAbstract
/* Unread? */
$unread = false;
if ( $item->timeLastRead() instanceof DateTime )
if ( IPS::classUsesTrait( $item, ReadMarkers::class ) and $item->timeLastRead() instanceof DateTime )
{
$unread = ( $item->timeLastRead()->getTimestamp() < $notification->updated_time->getTimestamp() );
}
@@ -738,7 +739,7 @@ class MyStuff extends NotificationsAbstract
'url' => $comment instanceof Item ? $item->url() : $comment->url('find'),
'content' => $comment->truncated(),
'author' => $comment->author(),
'unread' => (bool) ( $item->unread() ),
'unread' => ( IPS::classUsesTrait( $item, ReadMarkers::class ) and $item->unread() ),
);
}
@@ -84,6 +84,10 @@ class Editor extends ProfileStepsAbstract
public function completed( ProfileStep $step, Member $member = NULL ): bool
{
$memberId = $member ? $member->member_id : Member::loggedIn()->member_id;
if( !$memberId )
{
return false;
}
return (bool) Db::i()->select( 'count(*)', 'core_profile_completion', array( 'member_id=? and step_id=?', $memberId, $step->id ) )->first();
}
@@ -608,7 +608,7 @@ class Photo extends ProfileStepsAbstract
{
$photo = $member->coverPhoto();
$form->add( new Upload( 'complete_profile_cover_photo', NULL, $step->required, array( 'allowStockPhotos' => TRUE, 'image' => TRUE, 'minimize' => TRUE, 'maxFileSize' => ( $photo->maxSize and $photo->maxSize != -1 ) ? $photo->maxSize / 1024 : NULL, 'storageExtension' => 'core_Profile' ) ) );
$form->add( new Upload( 'complete_profile_cover_photo', $photo->file, $step->required, array( 'allowStockPhotos' => TRUE, 'image' => TRUE, 'minimize' => TRUE, 'maxFileSize' => ( $photo->maxSize and $photo->maxSize != -1 ) ? $photo->maxSize / 1024 : NULL, 'storageExtension' => 'core_Profile' ) ) );
}
}
@@ -115,6 +115,11 @@ class ProfileFields extends ProfileStepsAbstract
public function completed( ProfileStep $step, Member $member = NULL ): bool
{
$member = $member ?: Member::loggedIn();
if( !$member->member_id )
{
return false;
}
if ( ! $member->group['g_edit_profile'] )
{
@@ -245,21 +250,25 @@ class ProfileFields extends ProfileStepsAbstract
$profileFields = array();
foreach( ProfileStep::loadAll() AS $step )
{
try
$values = [];
if( $member->member_id )
{
$values = Db::i()->select( '*', 'core_pfields_content', array( 'member_id = ?', $member->member_id ) )->first();
foreach( $values as $k => $v )
try
{
if( $k == 'member_id' )
{
continue;
}
$values = Db::i()->select( '*', 'core_pfields_content', array( 'member_id = ?', $member->member_id ) )->first();
$profileFields[ 'core_p' . $k ] = $v;
foreach( $values as $k => $v )
{
if( $k == 'member_id' )
{
continue;
}
$profileFields[ 'core_p' . $k ] = $v;
}
}
catch( UnderflowException $e ){}
}
catch( UnderflowException $e ){}
if ( $step->completion_act === 'profile_fields' AND ! $step->completed( $member ) )
{