Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -2,19 +2,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Formats forum search results
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
* Last Updated: $Date: 2011-06-15 07:22:24 -0400 (Wed, 15 Jun 2011) $
* </pre>
*
* @author $author$
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @subpackage Forums
* @link http://www.invisionpower.com
* @version $Rev: 5855 $
**/
* @link http://hatynka.in
* @version $Rev: 9043 $
*/
if ( ! defined( 'IN_IPB' ) )
{
@@ -35,7 +35,6 @@ class search_format_members extends search_format
/**
* Parse search results
*
* @access private
* @param array $r Search result
* @return array $html Blocks of HTML
*/
@@ -47,35 +46,148 @@ class search_format_members extends search_format
/**
* Formats the forum search result for display
*
* @access public
* @param array $search_row Array of data
* @return mixed Formatted content, ready for display, or array containing a $sub section flag, and content
**/
*/
public function formatContent( $data )
{
$data['misc'] = unserialize( $data['misc'] );
$template = ( IPSSearchRegistry::get('members.searchInKey') AND IPSSearchRegistry::get('members.searchInKey') != 'comments' ) ? 'memberSearchResult' : 'memberCommentsSearchResult';
$data['misc'] = unserialize( $data['misc'] );
$template = IPSSearchRegistry::get('members.searchInKey') == 'comments' ? 'memberCommentsSearchResult' : 'memberSearchResult';
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->$template( $data, IPSSearchRegistry::get('display.onlyTitles') ), 0 );
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->$template( $data, IPSSearchRegistry::get('opt.searchType') == 'titles' ? true : false ), 0 );
}
/**
* Formats / grabs extra data for results
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
*
* @access public
* @return array
*/
public function processResults( $ids )
{
$rows = array();
foreach( $ids as $i => $d )
if ( IPSSearchRegistry::get('members.searchInKey') == 'comments' )
{
$rows[ $i ] = $this->genericizeResults( $d );
return $this->processResultsComments( $ids );
}
else
{
$rows = array();
foreach( $ids as $i => $d )
{
$rows[ $i ] = $this->genericizeResults( $d );
}
return $rows;
}
}
/**
* Formats / grabs extra data for results
* Takes an array of IDS (can be IDs from anything) and returns an array of expanded data.
*
* @param array $ids Ids
* @return array
*/
public function processResultsComments( $ids )
{
/* INIT */
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
$search_term = IPSSearchRegistry::get('in.clean_search_term');
$content_title_only = IPSSearchRegistry::get('opt.searchType') == 'content' ? false : true;
$members = array();
$results = array();
$statusIds = array();
$replyIds = IPSSearchRegistry::get('_internal.replyIds');
$replyData = IPSSearchRegistry::get('_internal.replyData');
$replies = array();
$sortKey = '';
/* Got some? */
if ( count( $ids ) )
{
/* Set vars */
IPSSearch::$ask = 'status_date';
IPSSearch::$aso = strtolower( $sort_order );
IPSSearch::$ast = 'numerical';
/* Get the status updates */
$this->DB->build( array('select' => "s.*",
'from' => array( 'member_status_updates' => 's' ),
'where' => 's.status_id IN( ' . implode( ',', $ids ) . ')',
'add_join' => array_merge( array( array( 'select' => 'm.member_id as owner_id, m.members_display_name as owner_display_name, m.members_seo_name as owner_seo_name',
'from' => array( 'members' => 'm' ),
'where' => 'm.member_id=s.status_member_id',
'type' => 'left' ),
array( 'select' => 'mem.member_id as author_id, mem.members_display_name as author_display_name, mem.members_seo_name as author_seo_name',
'from' => array( 'members' => 'mem' ),
'where' => 'mem.member_id=s.status_author_id',
'type' => 'left' ) ) ) ) );
/* Grab data */
$this->DB->execute();
/* Grab the results */
while( $row = $this->DB->fetch() )
{
$statusIds[ $row['status_id'] ] = $row;
}
/* Sort */
if ( count( $statusIds ) )
{
usort( $statusIds, array("IPSSearch", "usort") );
foreach( $statusIds as $id => $row )
{
/* Do we have any reply data? */
if ( ! empty( $replyData[ $id ] ) )
{
$row = array_merge( $row, $replyData[ $id ] );
}
/* Get author data? */
if ( ! empty( $row['status_author_id'] ) )
{
$members[ $row['status_author_id'] ] = $row['status_author_id'];
}
if ( ! empty( $row['status_member_id'] ) )
{
$members[ $row['status_member_id'] ] = $row['status_member_id'];
}
if ( ! empty( $row['reply_member_id'] ) )
{
$members[ $row['reply_member_id'] ] = $row['reply_member_id'];
}
$results[ $row['status_id'] ] = $row;
}
}
/* Need to load members? */
if ( count( $members ) )
{
$mems = IPSMember::load( $members, 'all' );
foreach( $results as $id => $r )
{
$_status_member = IPSMember::buildDisplayData( $mems[ $r['status_member_id'] ], array( 'reputation' => 0, 'warn' => 0 ) );
$_status_author = IPSMember::buildDisplayData( $mems[ $r['status_author_id'] ], array( 'reputation' => 0, 'warn' => 0 ) );
$results[ $id ]['status_member'] = $_status_member;
$results[ $id ]['status_author'] = $_status_author;
if ( ! empty( $r['reply_member_id'] ) )
{
$results[ $id ]['reply_author'] = IPSMember::buildDisplayData( $mems[ $r['reply_member_id'] ], array( 'reputation' => 0, 'warn' => 0 ) );
}
}
}
}
return $rows;
return $results;
}
/**
@@ -83,38 +195,38 @@ class search_format_members extends search_format
*
* @param array $r
* @return array
**/
*/
public function genericizeResults( $r )
{
if ( IPSSearchRegistry::get('members.searchInKey') AND IPSSearchRegistry::get('members.searchInKey') != 'comments' )
if ( IPSSearchRegistry::get('members.searchInKey') == 'comments' )
{
$r['app'] = 'members';
$r['content'] = $r['signature'] . ' ' . $r['pp_about_me'];
$r['content_title'] = $r['members_display_name'];
$r['updated'] = time();
$r['type_2'] = 'profile_view';
$r['type_id_2'] = $r['member_id'];
$r['misc'] = serialize( array(
'pp_thumb_photo' => $r['pp_thumb_photo'],
'pp_thumb_width' => $r['pp_thumb_width'],
'pp_thumb_height' => $r['pp_thumb_height']
) );
}
else
{
$r['app'] = 'members';
$r['content'] = $r['comment_content'];
$r['content_title'] = $r['member_display_name_owner'];
$r['updated'] = $r['comment_date'];
$r['type_2'] = 'comment_id';
$r['type_id_2'] = $r['comment_id'];
$r['misc'] = serialize( array(
$r['app'] = 'members';
$r['content'] = $r['comment_content'];
$r['content_title'] = $r['member_display_name_owner'];
$r['updated'] = $r['comment_date'];
$r['type_2'] = 'comment_id';
$r['type_id_2'] = $r['comment_id'];
$r['misc'] = serialize( array(
'members_display_name' => $r['members_display_name'],
'pp_thumb_photo' => $r['pp_thumb_photo'],
'pp_thumb_width' => $r['pp_thumb_width'],
'pp_thumb_height' => $r['pp_thumb_height']
) );
}
else
{
$r['app'] = 'members';
$r['content'] = $r['signature'] . ' ' . $r['pp_about_me'];
$r['content_title'] = $r['members_display_name'];
$r['updated'] = time();
$r['type_2'] = 'profile_view';
$r['type_id_2'] = $r['member_id'];
$r['misc'] = serialize( array(
'pp_thumb_photo' => $r['pp_thumb_photo'],
'pp_thumb_width' => $r['pp_thumb_width'],
'pp_thumb_height' => $r['pp_thumb_height']
) );
}
return $r;
}