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

@@ -1,20 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Config file
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
* Last Updated: $Date: 2011-04-13 23:15:13 -0400 (Wed, 13 Apr 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: 8333 $
*/
if ( ! defined( 'IN_IPB' ) )
{
@@ -23,13 +24,10 @@ if ( ! defined( 'IN_IPB' ) )
}
/* Can search with this app */
$CONFIG['can_search'] = 1;
$CONFIG['can_search'] = 1;
/* Can view new content with this app */
$CONFIG['can_viewNewContent'] = 0;
/* Can fetch active content with this app */
$CONFIG['can_activeContent'] = 0;
$CONFIG['can_viewNewContent'] = 0;
/* Can fetch user generated content */
$CONFIG['can_userContent'] = 0;
$CONFIG['can_userContent'] = 0;
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>
@@ -2,18 +2,18 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Basic Forum Search
* Last Updated: $Date: 2010-02-23 12:38:11 +0000 (Tue, 23 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 Forums
* @link http://www.invisionpower.com
* @version $Rev: 5861 $
* @link http://hatynka.in
* @version $Rev: 8644 $
*/
if ( ! defined( 'IN_IPB' ) )
@@ -26,6 +26,9 @@ class search_engine_core extends search_engine
{
/**
* Constructor
*
* @param object ipsRegistry reference
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
@@ -39,78 +42,50 @@ class search_engine_core extends search_engine
*
* So if we had 1000 replies, and we are on page 2 of 25 per page, we'd return 25 items offset by 25
*
* @access public
* @return array
*/
public function search()
{
/* INIT */
$count = 0;
$results = array();
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
$search_term = IPSSearchRegistry::get('in.clean_search_term');
$content_title_only = IPSSearchRegistry::get('opt.searchTitleOnly');
$post_search_only = IPSSearchRegistry::get('opt.onlySearchPosts');
$order_dir = ( $sort_order == 'asc' ) ? 'asc' : 'desc';
$sortKey = '';
$sortType = '';
$rows = array();
$got = 0;
if ( IPSSearchRegistry::get('opt.noPostPreview') OR IPSSearchRegistry::get('display.onlyTitles') )
{
$group_by = 'h.id';
}
/* INIT */
$sort_by = IPSSearchRegistry::get('in.search_sort_by');
$sort_order = IPSSearchRegistry::get('in.search_sort_order');
$search_term = IPSSearchRegistry::get('in.clean_search_term');
$sortKey = '';
$rows = array();
/* Sorting */
switch( $sort_by )
{
default:
case 'date':
$sortKey = ( $content_title_only ) ? 'id' : 'id';
$sortType = 'numerical';
$sortKey = 'id';
break;
case 'title':
$sortKey = 'title';
$sortType = 'string';
break;
}
/* Query the count */
$count = $this->DB->buildAndFetch( array('select' => 'COUNT(*) as total_results',
'from' => array( 'faq' => 'h' ),
'where' => $this->_buildWhereStatement( $search_term, $content_title_only ),
'group' => $group_by,
'add_join' => array( array( 'from' => array( 'permission_index' => 'i' ),
'where' => "i.perm_type='help' AND i.perm_type_id=1",
'type' => 'left' ) ) ) );
'from' => 'faq',
'where' => $this->_buildWhereStatement( $search_term ),
) );
/* Fetch data */
$this->DB->build( array( 'select' => 'h.*',
'from' => array( 'faq' => 'h' ),
'where' => $this->_buildWhereStatement( $search_term, $content_title_only ),
'group' => $group_by,
$this->DB->build( array( 'select' => '*',
'from' => 'faq',
'where' => $this->_buildWhereStatement( $search_term ),
'order' => $sortKey . ' ' . $sort_order,
'limit' => array( IPSSearchRegistry::get('in.start'), IPSSearchRegistry::get('opt.search_per_page') ),
'add_join' => array( array( 'from' => array( 'permission_index' => 'i' ),
'where' => "i.perm_type='help' AND i.perm_type_id=1",
'type' => 'left' ) ) ) );
) );
$this->DB->execute();
/* Sort */
/* Get results */
while ( $_row = $this->DB->fetch() )
{
$rows[ $got ] = $_row;
$got++;
$rows[] = $_row;
}
/* Return it */
@@ -120,25 +95,30 @@ class search_engine_core extends search_engine
/**
* Builds the where portion of a search string
*
* @access private
* @param string $search_term The string to use in the search
* @param bool $content_title_only Search only title records
* @return string
**/
private function _buildWhereStatement( $search_term, $content_title_only=false )
*/
protected function _buildWhereStatement( $search_term )
{
/* INI */
$where_clause = array();
if( $search_term )
{
if( $content_title_only )
switch( IPSSearchRegistry::get('opt.searchType') )
{
$where_clause[] = "h.title LIKE '%{$search_term}%'";
}
else
{
$where_clause[] = "(h.title LIKE '%{$search_term}%' OR h.text LIKE '%{$search_term}%' OR h.description LIKE '%{$search_term}%')";
case 'both':
default:
$where_clause[] = "(title LIKE '%{$search_term}%' OR text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')";
break;
case 'titles':
$where_clause[] = "title LIKE '%{$search_term}%'";
break;
case 'content':
$where_clause[] = "(text LIKE '%{$search_term}%' OR description LIKE '%{$search_term}%')";
break;
}
}
@@ -154,9 +134,6 @@ class search_engine_core extends search_engine
$where_clause[] = '( ' . implode( ' OR ', $this->whereConditions['OR'] ) . ' )';
}
/* Permissions */
$where_clause[] = $this->DB->buildRegexp( "i.perm_view", $this->member->perm_id_array );
/* Build and return the string */
return implode( " AND ", $where_clause );
}
@@ -164,10 +141,9 @@ class search_engine_core extends search_engine
/**
* Remap standard columns (Apps can override )
*
* @access public
* @param string $column sql table column for this condition
* @return string column
* @return void
* @return @e void
*/
public function remapColumn( $column )
{
@@ -182,26 +158,17 @@ class search_engine_core extends search_engine
/**
* Returns an array used in the searchplugin's setCondition method
*
* @access public
* @param array $data Array of forums to view
* @return array Array with column, operator, and value keys, for use in the setCondition call
**/
*/
public function buildFilterSQL( $data )
{
/* INIT */
$return = array();
/* Set up some defaults */
IPSSearchRegistry::set( 'opt.noPostPreview' , false );
IPSSearchRegistry::set( 'opt.onlySearchPosts', false );
return array();
}
/**
* Can handle boolean searching
*
* @access public
* @return boolean
*/
public function isBoolean()
@@ -1,20 +1,21 @@
<?php
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Returns HTML for the form (optional class, not required)
* Last Updated: $Date: 2010-02-19 01:29:54 +0000 (Fri, 19 Feb 2010) $
* Last Updated: $Date: 2011-05-05 07:03:47 -0400 (Thu, 05 May 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: 8644 $
*/
if ( ! defined( 'IN_IPB' ) )
{
@@ -27,6 +28,7 @@ class search_form_core
/**
* Construct
*
* @return @e void
*/
public function __construct()
{
@@ -45,8 +47,6 @@ class search_form_core
/**
* Return sort drop down
*
*
* @access public
* @return array
*/
public function fetchSortDropDown()
@@ -1,20 +1,21 @@
<?php
/**
* <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-05-05 07:03:47 -0400 (Thu, 05 May 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: 8644 $
*/
if ( ! defined( 'IN_IPB' ) )
{
@@ -26,6 +27,9 @@ class search_format_core extends search_format
{
/**
* Constructor
*
* @param object ipsRegistry
* @return @e void
*/
public function __construct( ipsRegistry $registry )
{
@@ -35,7 +39,6 @@ class search_format_core extends search_format
/**
* Parse search results
*
* @access private
* @param array $r Search result
* @return array $html Blocks of HTML
*/
@@ -47,20 +50,18 @@ class search_format_core 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 )
{
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $data, IPSSearchRegistry::get('display.onlyTitles') ), 0 );
return array( ipsRegistry::getClass( 'output' )->getTemplate( 'search' )->helpSearchResult( $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 )
@@ -80,7 +81,7 @@ class search_format_core extends search_format
*
* @param array $r
* @return array
**/
*/
public function genericizeResults( $r )
{
$r['app'] = 'core';
@@ -92,5 +93,4 @@ class search_format_core extends search_format
return $r;
}
}
@@ -5,6 +5,6 @@
<hr>
You have reached this page in error, please use your back button to return to the forum.
<hr>
<a href="http://www.invisionboard.com/">IP.Board</a>
<a href="http://www.invisionpower.com">IP.Board</a>
</body>
</html>