Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+54
View File
@@ -22,6 +22,29 @@ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
*/
abstract class _Result
{
/**
* Pre-Display logic for search index content
*
* @param bool $createdDate If TRUE, uses $createdDate, otherwise uses $lastUpdatedDate
* @return string
*/
public static function preDisplay( $content )
{
/* We cannot use images (or *anything* other than text) in search results as it messes with the truncation
logic. All HTML (including emoticons) are already stripped before they go into the search index
for this reason, but Emoji (because they're text) won't be. We can't swap the Emoji back out
with one of the alternative Emoji style images though because that re-introduces images, so we
just strip them out (making them behave like emoticons) */
if ( \IPS\Settings::i()->emoji_style == 'twemoji' or \IPS\Settings::i()->emoji_style == 'emojione' )
{
return preg_replace( '/(?:' . \IPS\Text\Parser::EMOJI_REGEX . '|\x{200d})+/u', '', $content );
}
else
{
return $content;
}
}
/**
* @brief Created Date
*/
@@ -68,4 +91,35 @@ abstract class _Result
return 'earlier';
}
}
/**
* Get output for API
*
* @param \IPS\Member|NULL $authorizedMember The member making the API request or NULL for API Key / client_credentials
* @return array
* @apiresponse string title Title of search result
* @apiresponse string content Content of search result
* @apiresponse string class Content class of search result
* @apiresponse int objectId Content ID of search result
* @apiresponse string itemClass Content item class of search result (if search result is of a content item, this will match class)
* @apiresponse int itemId Content item ID of search result (if search result is of a content item, this will match objectId)
* @apiresponse datetime started Datetime search result was submitted
* @apiresponse datetime updated Datetime search result was last updated
* @apiresponse string itemUrl URL to content item
* @apiresponse string objectUrl URL to search result item (if search result is of a content item, this will match itemUrl)
* @apiresponse int reputation Number of reputation points for search result
* @apiresponse int|null comments Number of comments or replies for search result, or NULL if commenting is not supported
* @apiresponse int|null reviews Number of reviews for search result, or NULL if reviewing is not supported
* @apiresponse string container Title of container of search result
* @apiresponse string containerUrl URL to container of search result
* @apiresponse string author Author name of search result
* @apiresponse string|null authorUrl URL to author's profile, or NULL if search result was submitted by a guest
* @apiresponse string authorPhoto URL to author's profile photo
* @apiresponse string authorPhotoThumbnail URL to author's profile photo thumbnail
* @apiresponse array tags Array of tags associated with the search result
*/
public function apiOutput( \IPS\Member $authorizedMember = NULL )
{
/* @note This is only here to populate the AdminCP reference tab - the array of search result entries is built manually */
}
}