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

@@ -65,6 +65,7 @@ use function intval;
use function is_array;
use function is_int;
use function method_exists;
use function strrpos;
use function strtoupper;
use function substr;
use function trim;
@@ -1914,11 +1915,21 @@ class support extends Controller
{
foreach( $listeners as $class )
{
if( !class_exists( $class ) )
{
continue;
}
foreach( get_class_methods( $class ) as $method )
{
if( substr( $method, 0, 2 ) == 'on' and !in_array( $method, $events ) )
if( substr( $method, 0, 2 ) == 'on' )
{
$events[] = $method;
$parentClass = get_parent_class( $class );
$method = substr( $parentClass, strrpos( $parentClass, '\\' ) + 1 ) . ': ' . $method;
if( !in_array( $method, $events ) )
{
$events[] = $method;
}
}
}
}
@@ -67,6 +67,33 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
*/
class ajax extends Controller
{
/**
* Load the mini profile on demand
*
* @return void
*/
public function miniProfile(): void
{
/* Load the item */
try
{
$author = Member::load( Request::i()->authorId );
$anonymous = (bool) Request::i()->anonymous ?? false;
$solvedCount = is_numeric( Request::i()->solvedCount ) ? (int) Request::i()->solvedCount : null;
if ( $author->member_id and Request::i()->solvedCount === 'load' )
{
$solvedCount = Db::i()->select( "COUNT(*)", "core_solved_index", ["member_id=?", $author->member_id] )->first() ?: null;
}
/* return the json */
Output::i()->json( [ 'html' => \IPS\Theme::i()->getTemplate( "global", "core" )->miniProfile( $author, $anonymous, $solvedCount ) ] );
}
catch ( OutOfRangeException $e )
{
Output::i()->json( [ 'error' => 'not_found', 'errorMessage' => Member::loggedIn()->language()->addToStack( 'author_stats_cannot_load' ) ], 404 );
}
}
/**
* Find Member
*