Version 5.0.0 beta 7

This commit is contained in:
Neo committed 2025-12-19 17:18:38 -08:00
1 parent fa2a720105
commit 54d5dcd0a0
156 files changed
+4337 -2995

No files matched your search

+40
View File
@@ -16,12 +16,14 @@ use BadMethodCallException;
use Exception;
use InvalidArgumentException;
use IPS\Api\Webhook;
use IPS\Content\Anonymous;
use IPS\Content\Assignable;
use IPS\Content\Comment;
use IPS\Content\Followable;
use IPS\Content\Hideable;
use IPS\Content\Item;
use IPS\Content\Review;
use IPS\Content\Solvable;
use IPS\core\Approval;
use IPS\core\Reports\Report;
use IPS\Db\Select;
@@ -1954,4 +1956,42 @@ abstract class Content extends ActiveRecord
{
return Bridge::i()->canUnmarkAsSpam( $member, $content );
}
/**
* Get a url from which to load the mini-profile bar.
*
* @return string
*/
public function get_authorMiniProfileUrl() : string
{
$params = [
'app' => 'core',
'module' => 'system',
'controller' => 'ajax',
'do' => 'miniProfile',
'authorId' => $this->author()?->member_id ?? null,
];
if ( !IPS::classUsesTrait( $this, Anonymous::class ) or $this->isAnonymous() )
{
$params['anonymous'] = '1';
}
$item = $this instanceof Comment ? $this->item() : $this;
if ( IPS::classUsesTrait( $item, Solvable::class ) )
{
if ( isset( $this->author_solved_count ) and is_int( $this->author_solved_count ) )
{
$params['solvedCount'] = $this->author_solved_count;
}
else
{
$params['solvedCount'] = 'load';
}
}
$url = Url::internal( '', 'front' )->setQueryString( $params );
return (string) $url;
}
}