Version 4.1.19

This commit is contained in:
Neo committed 2025-12-19 05:38:56 -08:00
1 parent 28bd025b35
commit 2bd5025018
2674 files changed
+233518 -77766

No files matched your search

+49 -4
View File
@@ -2,10 +2,10 @@
/**
* @brief Post Model
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - SVN_YYYY Invision Power Services, Inc.
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Social Suite
* @subpackage Board
* @package IPS Community Suite
* @subpackage Content
* @since 8 Jan 2014
* @version SVN_VERSION_NUMBER
*/
@@ -103,6 +103,11 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\ReportCenter
*/
public static $hideLogKey = 'ccs-records';
/**
* @brief Store generated search index titles for efficiency
*/
protected static $searchIndexTitles = array();
/**
* Return custom where for SQL delete
*
@@ -113,7 +118,45 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\ReportCenter
{
return array( array( static::$databasePrefix . static::$databaseColumnMap['item'] . '=?', $id ), array( static::$databasePrefix . 'database_id=?', static::$customDatabaseId ) );
}
/**
* Get HTML for search result display
*
* @param array $indexData Data from the search index
* @param array $authorData Basic data about the author. Only includes columns returned by \IPS\Member::columnsForPhoto()
* @param array $itemData Basic data about the item. Only includes columns returned by item::basicDataColumns()
* @param array|NULL $containerData Basic data about the container. Only includes columns returned by container::basicDataColumns()
* @param array $reputationData Array of people who have given reputation and the reputation they gave
* @param int|NULL $reviewRating If this is a review, the rating
* @param bool $iPostedIn If the user has posted in the item
* @param string $view 'expanded' or 'condensed'
* @param bool $asItem Displaying results as items?
* @param bool $canIgnoreComments Can ignore comments in the result stream? Activity stream can, but search results cannot.
* @param array $template Optional custom template
* @return string
*/
public static function searchResult( array $indexData, array $authorData, array $itemData, array $containerData = NULL, array $reputationData, $reviewRating, $iPostedIn, $view, $asItem, $canIgnoreComments=FALSE, $template=NULL )
{
/* Ensure that the comment title is formatted correctly */
try
{
$databases = \IPS\cms\Databases::databases();
if ( ! isset( static::$searchIndexTitles[ $itemData['primary_id_field'] ] ) )
{
$fields = '\IPS\cms\Fields' . static::$customDatabaseId;
$titleField = $databases[ static::$customDatabaseId ]->field_title;
static::$searchIndexTitles[ $itemData['primary_id_field'] ] = $fields::load( $databases[ static::$customDatabaseId ]->field_title )->displayValue( $itemData['field_' . $databases[ static::$customDatabaseId ]->field_title ] );
}
$itemData['field_' . $databases[ static::$customDatabaseId ]->field_title ] = static::$searchIndexTitles[ $itemData['primary_id_field'] ];
}
catch ( \Exception $ex ) { }
return parent::searchResult( $indexData, $authorData, $itemData, $containerData, $reputationData, $reviewRating, $iPostedIn, $view, $asItem, $canIgnoreComments, $template );
}
/**
* Do stuff after creating (abstracted as comments and reviews need to do different things)
*
@@ -164,7 +207,7 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\ReportCenter
* @param string|NULL $action Action
* @return \IPS\Http\Url
*/
public function url( $action=NULL )
public function url( $action='find' )
{
$url = parent::url( $action );
@@ -172,6 +215,8 @@ class _Comment extends \IPS\Content\Comment implements \IPS\Content\ReportCenter
{
$url = $url->setQueryString( 'd', static::$customDatabaseId );
}
$url = $url->setQueryString( 'tab', 'comments' );
return $url;
}