Version 3.2.3
This commit is contained in:
1 parent
ae5c01cc78
commit
78706903a2
2641 files changed
+228363
-201264
No files matched your search
@@ -2,18 +2,18 @@
|
||||
/**
|
||||
* <pre>
|
||||
* Invision Power Services
|
||||
* IP.Board v3.1.4
|
||||
* IP.Board v3.2.3
|
||||
* Global Search
|
||||
* Last Updated: $Date: 2010-02-22 17:06:11 +0000 (Mon, 22 Feb 2010) $
|
||||
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 2011) $
|
||||
* </pre>
|
||||
*
|
||||
* @author $Author: matt $
|
||||
* @author $Author: ips_terabyte $
|
||||
* @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 Core
|
||||
* @link http://www.invisionpower.com
|
||||
* @version $Rev: 5859 $
|
||||
* @link http://hatynka.in
|
||||
* @version $Rev: 8644 $
|
||||
*/
|
||||
|
||||
if ( ! defined( 'IN_IPB' ) )
|
||||
@@ -53,7 +53,7 @@ class search_engine
|
||||
*
|
||||
* @access public
|
||||
* @param object ipsRegistry $registry
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function __construct( ipsRegistry $registry )
|
||||
{
|
||||
@@ -95,13 +95,14 @@ class search_engine
|
||||
*/
|
||||
public function viewNewContent()
|
||||
{
|
||||
$app = IPSSearchRegistry::get('in.search_app');
|
||||
$lastActive = IPSLib::fetchHighestNumber( array( intval( $this->memberData['_cache']['gb_mark__' . $app] ), intval( $this->memberData['last_visit'] ) ) );
|
||||
$app = IPSSearchRegistry::get('in.search_app');
|
||||
$seconds = IPSSearchRegistry::get('in.period_in_seconds');
|
||||
|
||||
IPSSearchRegistry::set('in.search_sort_by' , 'date' );
|
||||
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
|
||||
|
||||
$this->setDateRange( $lastActive, time() );
|
||||
/* Set time stamp */
|
||||
$this->setDateRange( intval( time() - $seconds ), time() );
|
||||
|
||||
/* Force title search only */
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly', true);
|
||||
@@ -120,10 +121,9 @@ class search_engine
|
||||
{
|
||||
$app = IPSSearchRegistry::get('in.search_app');
|
||||
|
||||
IPSSearchRegistry::set('in.search_sort_by' , 'date' );
|
||||
IPSSearchRegistry::set('in.search_sort_order', 'desc' );
|
||||
//IPSSearchRegistry::set('in.search_sort_by' , 'date' );
|
||||
//IPSSearchRegistry::set('in.search_sort_order', 'desc' );
|
||||
IPSSearchRegistry::set('opt.searchTitleOnly', IPSSearchRegistry::get('in.view_by_title') );
|
||||
IPSSearchRegistry::set('display.onlyTitles' , IPSSearchRegistry::get('in.view_by_title') );
|
||||
IPSSearchRegistry::set('opt.noPostPreview' , IPSSearchRegistry::get('in.view_by_title') );
|
||||
|
||||
/* Set the member_id */
|
||||
@@ -140,23 +140,6 @@ class search_engine
|
||||
return $this->search();
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform the search
|
||||
* Populates $this->_count and $this->_results
|
||||
*
|
||||
* @access public
|
||||
* @return nothin'
|
||||
*/
|
||||
public function viewActiveContent()
|
||||
{
|
||||
$seconds = IPSSearchRegistry::get('in.period_in_seconds');
|
||||
|
||||
/* Set time stamp */
|
||||
$this->setDateRange( time() - $seconds, time() );
|
||||
|
||||
return $this->search();
|
||||
}
|
||||
|
||||
/**
|
||||
* Can handle boolean searching
|
||||
*
|
||||
@@ -178,7 +161,7 @@ class search_engine
|
||||
public function formatSearchTerm( $search_term )
|
||||
{
|
||||
$isBoolean = $this->isBoolean();
|
||||
$andor = isset( $this->request['andor_type'] ) ? $this->request['andor_type'] : $this->settings['s_andor_type'];
|
||||
$andor = !empty( $this->request['andor_type'] ) ? $this->request['andor_type'] : $this->settings['s_andor_type'];
|
||||
$removedTerms = array();
|
||||
|
||||
/* Fix up some sanitized HTML */
|
||||
@@ -196,23 +179,23 @@ class search_engine
|
||||
$search_term = IPSText::mbstrtolower( $search_term );
|
||||
|
||||
/* Check for disallowed search terms */
|
||||
while( preg_match_all( "/(?:^|\s+)(img|quote|code|html|javascript|a href|color|span|div|border|style)(?:\s+|$)/", $search_term, $removed_search_terms ) )
|
||||
while( preg_match_all( '/(?:^|\s+)(img|quote|code|html|javascript|a href|color|span|div|border|style)(?:\s+|$)/', $search_term, $removed_search_terms ) )
|
||||
{
|
||||
$removedTerms[] = $removed_search_terms[0][0];
|
||||
$search_term = preg_replace( "/(^|\s+)(?:img|quote|code|html|javascript|a href|color|span|div|border|style)(\s+|$)/", str_replace( " ", " ", "$1$2" ), $search_term );
|
||||
$search_term = preg_replace( '/(^|\s+)(?:img|quote|code|html|javascript|a href|color|span|div|border|style)(\s+|$)/', str_replace( " ", " ", "$1$2" ), $search_term );
|
||||
}
|
||||
|
||||
/* Remove some formatting */
|
||||
//$search_term = str_replace( array( '|', '\\', '/' ), '', $search_term );
|
||||
// | is an OR operator for sphinx - don't want to block globally
|
||||
$search_term = str_replace( array( '\\', '/' ), '', $search_term );
|
||||
|
||||
|
||||
/* got some bullean to do? */
|
||||
if ( $isBoolean AND strstr( $search_term, ' ' ) AND ! strstr( $search_term, '"' ) )
|
||||
{
|
||||
if ( $andor == 'and' )
|
||||
{
|
||||
$search_term = '+' . preg_replace( "/\s+(?!-|~)/", " +", $search_term );
|
||||
$search_term = '+' . preg_replace( '/\s+(?!-|~)/', " +", $search_term );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +208,7 @@ class search_engine
|
||||
* @access public
|
||||
* @param int $begin Start timestamp
|
||||
* @param int [$end] End timestamp
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function setDateRange( $begin, $end=0 )
|
||||
{
|
||||
@@ -241,7 +224,7 @@ class search_engine
|
||||
* @param string $operator Operation to perform for this condition, ex: =, <>, IN, NOT IN
|
||||
* @param mixed $value Value to check with
|
||||
* @param string $comp Comparison type
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function setCondition( $column, $operator, $value, $comp='AND' )
|
||||
{
|
||||
@@ -272,7 +255,7 @@ class search_engine
|
||||
* @access public
|
||||
* @param string $column sql table column for this condition
|
||||
* @return string column
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function remapColumn( $column )
|
||||
{
|
||||
@@ -286,7 +269,7 @@ class search_engine
|
||||
* @param array $conditions Array of conditions, each element has 3 keys: column, operator, value, see the setCondition function for information on each
|
||||
* @param string $inner_comp Comparison operator to use inside the chain
|
||||
* @param string $outer_comp Comparison operator to use outside the chain
|
||||
* @return void
|
||||
* @return @e void
|
||||
*/
|
||||
public function setMultiConditions( $conditions, $inner_comp='OR', $outer_comp='AND' )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user