Vergleich inc/functions_search.php - 1.8.2 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 11Zeile 11
/**
* Build a select box list of forums the current user has permission to search
*

/**
* Build a select box list of forums the current user has permission to search
*

 * @param int The parent forum ID to start at
* @param int The selected forum ID
* @param int Add select boxes at this call or not
* @param int The current depth

 * @param int $pid The parent forum ID to start at
* @param int $selitem The selected forum ID
* @param int $addselect Add select boxes at this call or not
* @param string $depth The current depth

 * @return string The forum select boxes
*/

 * @return string The forum select boxes
*/

function make_searchable_forums($pid="0", $selitem='', $addselect="1", $depth='')

function make_searchable_forums($pid=0, $selitem=0, $addselect=1, $depth='')

{
global $db, $pforumcache, $permissioncache, $mybb, $selecteddone, $forumlist, $forumlistbits, $theme, $templates, $lang, $forumpass;
$pid = (int)$pid;

{
global $db, $pforumcache, $permissioncache, $mybb, $selecteddone, $forumlist, $forumlistbits, $theme, $templates, $lang, $forumpass;
$pid = (int)$pid;

Zeile 56Zeile 56
					}
if($forum['password'] != '')
{

					}
if($forum['password'] != '')
{

						if($mybb->cookies['forumpass'][$forum['fid']] == md5($mybb->user['uid'].$forum['password']))

						if($mybb->cookies['forumpass'][$forum['fid']] === md5($mybb->user['uid'].$forum['password']))

						{
$pwverified = 1;
}

						{
$pwverified = 1;
}

Zeile 88Zeile 88
/**
* Build a comma separated list of the forums this user cannot search
*

/**
* Build a comma separated list of the forums this user cannot search
*

 * @param int The parent ID to build from
* @param int First rotation or not (leave at default)
* @return return a CSV list of forums the user cannot search

 * @param int $pid The parent ID to build from
* @param int $first First rotation or not (leave at default)
* @return string return a CSV list of forums the user cannot search

 */

 */

function get_unsearchable_forums($pid="0", $first=1)

function get_unsearchable_forums($pid=0, $first=1)

{
global $db, $forum_cache, $permissioncache, $mybb, $unsearchableforums, $unsearchable, $templates, $forumpass;


{
global $db, $forum_cache, $permissioncache, $mybb, $unsearchableforums, $unsearchable, $templates, $forumpass;


Zeile 125Zeile 125
		$pwverified = 1;
if($forum['password'] != '')
{

		$pwverified = 1;
if($forum['password'] != '')
{

			if($mybb->cookies['forumpass'][$forum['fid']] != md5($mybb->user['uid'].$forum['password']))

			if($mybb->cookies['forumpass'][$forum['fid']] !== md5($mybb->user['uid'].$forum['password']))

			{
$pwverified = 0;
}

			{
$pwverified = 0;
}

Zeile 173Zeile 173
/**
* Build a array list of the forums this user cannot search due to password protection
*

/**
* Build a array list of the forums this user cannot search due to password protection
*

 * @param int the fids to check (leave null to check all forums)
* @return return a array list of password protected forums the user cannot search

 * @param array $fids the fids to check (leave blank to check all forums)
* @return array return a array list of password protected forums the user cannot search

 */
function get_password_protected_forums($fids=array())
{

 */
function get_password_protected_forums($fids=array())
{

Zeile 207Zeile 207
			continue;
}


			continue;
}


		if(md5($mybb->user['uid'].$forum_cache[$fid]['password']) != $mybb->cookies['forumpass'][$fid])

		if(md5($mybb->user['uid'].$forum_cache[$fid]['password']) !== $mybb->cookies['forumpass'][$fid])

		{
$pass_fids[] = $fid;
$child_list = get_child_list($fid);

		{
$pass_fids[] = $fid;
$child_list = get_child_list($fid);

Zeile 224Zeile 224
/**
* Clean search keywords and make them safe for querying
*

/**
* Clean search keywords and make them safe for querying
*

 * @param string The keywords to be cleaned

 * @param string $keywords The keywords to be cleaned

 * @return string The cleaned keywords
*/
function clean_keywords($keywords)

 * @return string The cleaned keywords
*/
function clean_keywords($keywords)

Zeile 254Zeile 254
/**
* Clean search keywords for fulltext searching, making them safe for querying
*

/**
* Clean search keywords for fulltext searching, making them safe for querying
*

 * @param string The keywords to be cleaned
* @return string The cleaned keywords

 * @param string $keywords The keywords to be cleaned
* @return string|bool The cleaned keywords or false on failure

 */
function clean_keywords_ft($keywords)
{

 */
function clean_keywords_ft($keywords)
{

Zeile 310Zeile 310
					if($last_char == '+' || $last_char == '-' || $last_char == '<' || $last_char == '>' || $last_char == '~')
{
$phrase_operator = $last_char;

					if($last_char == '+' || $last_char == '-' || $last_char == '<' || $last_char == '>' || $last_char == '~')
{
$phrase_operator = $last_char;

					}

					}

				}
foreach($split_words as $word)
{

				}
foreach($split_words as $word)
{

Zeile 327Zeile 327
								$last = substr($last, 1);
}
$words[$depth][] = $last;

								$last = substr($last, 1);
}
$words[$depth][] = $last;

						}
}

						}
}

					elseif($word == "and")
{
$boolean[$depth] = "+";

					elseif($word == "and")
{
$boolean[$depth] = "+";

Zeile 345Zeile 345
						{
$words[$depth-1][] = $boolean[$depth-1].'('.implode(' ', $words[$depth]).')';
--$depth;

						{
$words[$depth-1][] = $boolean[$depth-1].'('.implode(' ', $words[$depth]).')';
--$depth;

						}
}

						}
}

					// Valid operators for opening braces
elseif($word == '+(' || $word == '-(' || $word == '<(' || $word == '>(' || $word == '~(' || $word == '(')
{

					// Valid operators for opening braces
elseif($word == '+(' || $word == '-(' || $word == '<(' || $word == '>(' || $word == '~(' || $word == '(')
{

Zeile 401Zeile 401

$keywords = implode(' ', $words[0]);
return $keywords;


$keywords = implode(' ', $words[0]);
return $keywords;

}

}


/* Database engine specific search functions */

/**
* Perform a thread and post search under MySQL or MySQLi
*


/* Database engine specific search functions */

/**
* Perform a thread and post search under MySQL or MySQLi
*

 * @param array Array of search data

 * @param array $search Array of search data

 * @return array Array of search data with results mixed in
*/
function privatemessage_perform_search_mysql($search)

 * @return array Array of search data with results mixed in
*/
function privatemessage_perform_search_mysql($search)

Zeile 434Zeile 434
	{
// Complex search
$keywords = " {$keywords} ";

	{
// Complex search
$keywords = " {$keywords} ";

 

switch($db->type)
{
case 'mysql':
case 'mysqli':
$sfield = 'subject';
$mfield = 'message';
break;
default:
$sfield = 'LOWER(subject)';
$mfield = 'LOWER(message)';
break;
}


		if(preg_match("#\s(and|or)\s#", $keywords))
{
$string = "AND";

		if(preg_match("#\s(and|or)\s#", $keywords))
{
$string = "AND";

Zeile 457Zeile 471
			{
// If we're not in a double quoted section
if(!$inquote)

			{
// If we're not in a double quoted section
if(!$inquote)

				{

				{

					// Expand out based on search operators (and, or)
$matches = preg_split("#\s{1,}(and|or)\s{1,}#", $phrase, -1, PREG_SPLIT_DELIM_CAPTURE);
$count_matches = count($matches);

					// Expand out based on search operators (and, or)
$matches = preg_split("#\s{1,}(and|or)\s{1,}#", $phrase, -1, PREG_SPLIT_DELIM_CAPTURE);
$count_matches = count($matches);

Zeile 466Zeile 480
					{
$word = trim($matches[$i]);
if(empty($word))

					{
$word = trim($matches[$i]);
if(empty($word))

						{

						{

							continue;
}
// If this word is a search operator set the boolean

							continue;
}
// If this word is a search operator set the boolean

Zeile 475Zeile 489
							if($i <= 1)
{
if($search['subject'] && $search['message'] && $subject_lookin == " AND (")

							if($i <= 1)
{
if($search['subject'] && $search['message'] && $subject_lookin == " AND (")

								{

								{

									// We're looking for anything, check for a subject lookin
continue;
}

									// We're looking for anything, check for a subject lookin
continue;
}

Zeile 503Zeile 517
								$lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);
}

								$lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);
}

 


							// Add terms to search query
if($search['subject'] == 1)

							// Add terms to search query
if($search['subject'] == 1)

							{
$subject_lookin .= " $boolean LOWER(subject) LIKE '%{$word}%'";
}

							{
$subject_lookin .= " $boolean {$sfield} LIKE '%{$word}%'";
}

							if($search['message'] == 1)
{

							if($search['message'] == 1)
{

								$message_lookin .= " $boolean LOWER(message) LIKE '%{$word}%'";

								$message_lookin .= " $boolean {$mfield} LIKE '%{$word}%'";

							}
$boolean = 'AND';
}

							}
$boolean = 'AND';
}

					}

					}

				}
// In the middle of a quote (phrase)
else

				}
// In the middle of a quote (phrase)
else

Zeile 526Zeile 541
						error($lang->error_minsearchlength);
}
// Add phrase to search query

						error($lang->error_minsearchlength);
}
// Add phrase to search query

					$subject_lookin .= " $boolean LOWER(subject) LIKE '%{$phrase}%'";

					$subject_lookin .= " $boolean {$sfield} LIKE '%{$phrase}%'";

					if($search['message'] == 1)
{

					if($search['message'] == 1)
{

						$message_lookin .= " $boolean LOWER(message) LIKE '%{$phrase}%'";

						$message_lookin .= " $boolean {$mfield} LIKE '%{$phrase}%'";

					}
$boolean = 'AND';
}

					}
$boolean = 'AND';
}

Zeile 549Zeile 564
				elseif(!$search['subject'] && $search['message'] && $message_lookin == " {$string} (")
{
// Just in a message?

				elseif(!$search['subject'] && $search['message'] && $message_lookin == " {$string} (")
{
// Just in a message?

					$error = true;
}

if($error == true)

					$error = true;
}

if($error == true)

				{
// There are no search keywords to look for
$lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);

				{
// There are no search keywords to look for
$lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);

Zeile 560Zeile 575
				}

$inquote = !$inquote;

				}

$inquote = !$inquote;

			}

			}


if($search['subject'] == 1)
{


if($search['subject'] == 1)
{

Zeile 570Zeile 585
			if($search['message'] == 1)
{
$message_lookin .= ")";

			if($search['message'] == 1)
{
$message_lookin .= ")";

			}


			}


			$searchsql .= "{$subject_lookin} {$message_lookin}";
}
else

			$searchsql .= "{$subject_lookin} {$message_lookin}";
}
else

Zeile 586Zeile 601
			// If we're looking in both, then find matches in either the subject or the message
if($search['subject'] == 1 && $search['message'] == 1)
{

			// If we're looking in both, then find matches in either the subject or the message
if($search['subject'] == 1 && $search['message'] == 1)
{

				$searchsql .= " AND (LOWER(subject) LIKE '%{$keywords}%' OR LOWER(message) LIKE '%{$keywords}%')";

				$searchsql .= " AND ({$sfield} LIKE '%{$keywords}%' OR {$mfield} LIKE '%{$keywords}%')";

			}
else
{
if($search['subject'] == 1)
{

			}
else
{
if($search['subject'] == 1)
{

					$searchsql .= " AND LOWER(subject) LIKE '%{$keywords}%'";

					$searchsql .= " AND {$sfield} LIKE '%{$keywords}%'";

				}

if($search['message'] == 1)
{

				}

if($search['message'] == 1)
{

					$searchsql .= " AND LOWER(message) LIKE '%{$keywords}%'";

					$searchsql .= " AND {$mfield} LIKE '%{$keywords}%'";

				}
}
}

				}
}
}

Zeile 608Zeile 623
		$userids = array();
$search['sender'] = my_strtolower($search['sender']);


		$userids = array();
$search['sender'] = my_strtolower($search['sender']);


		$query = $db->simple_select("users", "uid", "LOWER(username) LIKE '%".$db->escape_string_like($search['sender'])."%'");











		switch($db->type)
{
case 'mysql':
case 'mysqli':
$field = 'username';
break;
default:
$field = 'LOWER(username)';
break;
}
$query = $db->simple_select("users", "uid", "{$field} LIKE '%".$db->escape_string_like($search['sender'])."%'");

		while($user = $db->fetch_array($query))
{
$userids[] = $user['uid'];

		while($user = $db->fetch_array($query))
{
$userids[] = $user['uid'];

Zeile 628Zeile 653
	if(!is_array($search['folder']))
{
$search['folder'] = array($search['folder']);

	if(!is_array($search['folder']))
{
$search['folder'] = array($search['folder']);

	}


	}


	if(!empty($search['folder']))
{
$folderids = array();

	if(!empty($search['folder']))
{
$folderids = array();

Zeile 637Zeile 662
		$search['folder'] = array_map("intval", $search['folder']);

$folderids = implode(',', $search['folder']);

		$search['folder'] = array_map("intval", $search['folder']);

$folderids = implode(',', $search['folder']);





		if($folderids)
{
$searchsql .= " AND folder IN (".$folderids.")";

		if($folderids)
{
$searchsql .= " AND folder IN (".$folderids.")";

Zeile 648Zeile 673
	{
$searchsql .= " AND (";
if($search['status']['new'])

	{
$searchsql .= " AND (";
if($search['status']['new'])

		{

		{

			$statussql[] = " status='0' ";
}
if($search['status']['replied'])

			$statussql[] = " status='0' ";
}
if($search['status']['replied'])

Zeile 694Zeile 719
/**
* Perform a help document search under MySQL or MySQLi
*

/**
* Perform a help document search under MySQL or MySQLi
*

 * @param array Array of search data

 * @param array $search Array of search data

 * @return array Array of search data with results mixed in
*/
function helpdocument_perform_search_mysql($search)

 * @return array Array of search data with results mixed in
*/
function helpdocument_perform_search_mysql($search)

Zeile 703Zeile 728

$keywords = clean_keywords($search['keywords']);
if(!$keywords && !$search['sender'])


$keywords = clean_keywords($search['keywords']);
if(!$keywords && !$search['sender'])

	{

	{

		error($lang->error_nosearchterms);

		error($lang->error_nosearchterms);

	}

	}


if($mybb->settings['minsearchword'] < 1)
{


if($mybb->settings['minsearchword'] < 1)
{

Zeile 718Zeile 743

if($keywords)
{


if($keywords)
{

 
		switch($db->type)
{
case 'mysql':
case 'mysqli':
$nfield = 'name';
$dfield = 'document';
break;
default:
$nfield = 'LOWER(name)';
$dfield = 'LOWER(document)';
break;
}


		// Complex search
$keywords = " {$keywords} ";
if(preg_match("#\s(and|or)\s#", $keywords))

		// Complex search
$keywords = " {$keywords} ";
if(preg_match("#\s(and|or)\s#", $keywords))

Zeile 753Zeile 791
						if(empty($word))
{
continue;

						if(empty($word))
{
continue;

						}

						}

						// If this word is a search operator set the boolean
if($i % 2 && ($word == "and" || $word == "or"))
{

						// If this word is a search operator set the boolean
if($i % 2 && ($word == "and" || $word == "or"))
{

Zeile 791Zeile 829
							// Add terms to search query
if($search['name'] == 1)
{

							// Add terms to search query
if($search['name'] == 1)
{

								$name_lookin .= " $boolean LOWER(name) LIKE '%{$word}%'";

								$name_lookin .= " $boolean {$nfield} LIKE '%{$word}%'";

							}
if($search['document'] == 1)
{

							}
if($search['document'] == 1)
{

								$document_lookin .= " $boolean LOWER(document) LIKE '%{$word}%'";

								$document_lookin .= " $boolean {$dfield} LIKE '%{$word}%'";

							}
}
}

							}
}
}

Zeile 810Zeile 848
						error($lang->error_minsearchlength);
}
// Add phrase to search query

						error($lang->error_minsearchlength);
}
// Add phrase to search query

					$name_lookin .= " $boolean LOWER(name) LIKE '%{$phrase}%'";

					$name_lookin .= " $boolean {$nfield} LIKE '%{$phrase}%'";

					if($search['document'] == 1)
{

					if($search['document'] == 1)
{

						$document_lookin .= " $boolean LOWER(document) LIKE '%{$phrase}%'";

						$document_lookin .= " $boolean {$dfield} LIKE '%{$phrase}%'";

					}
}


					}
}


Zeile 848Zeile 886
			if($search['name'] == 1)
{
$name_lookin .= ")";

			if($search['name'] == 1)
{
$name_lookin .= ")";

			}

if($search['document'] == 1)
{
$document_lookin .= ")";
}

			}

if($search['document'] == 1)
{
$document_lookin .= ")";
}


$searchsql .= "{$name_lookin} {$document_lookin}";
}


$searchsql .= "{$name_lookin} {$document_lookin}";
}

Zeile 869Zeile 907
			// If we're looking in both, then find matches in either the name or the document
if($search['name'] == 1 && $search['document'] == 1)
{

			// If we're looking in both, then find matches in either the name or the document
if($search['name'] == 1 && $search['document'] == 1)
{

				$searchsql .= " AND (LOWER(name) LIKE '%{$keywords}%' OR LOWER(document) LIKE '%{$keywords}%')";

				$searchsql .= " AND ({$nfield} LIKE '%{$keywords}%' OR {$dfield} LIKE '%{$keywords}%')";

			}
else
{
if($search['name'] == 1)
{

			}
else
{
if($search['name'] == 1)
{

					$searchsql .= " AND LOWER(name) LIKE '%{$keywords}%'";

					$searchsql .= " AND {$nfield} LIKE '%{$keywords}%'";

				}

if($search['document'] == 1)
{

				}

if($search['document'] == 1)
{

					$searchsql .= " AND LOWER(document) LIKE '%{$keywords}%'";

					$searchsql .= " AND {$dfield} LIKE '%{$keywords}%'";

				}
}

				}
}

		}

		}

	}

// Run the search

	}

// Run the search

Zeile 892Zeile 930
	while($help = $db->fetch_array($query))
{
$helpdocs[$help['hid']] = $help['hid'];

	while($help = $db->fetch_array($query))
{
$helpdocs[$help['hid']] = $help['hid'];

	}

	}


if(count($helpdocs) < 1)
{


if(count($helpdocs) < 1)
{

Zeile 908Zeile 946
/**
* Perform a thread and post search under MySQL or MySQLi
*

/**
* Perform a thread and post search under MySQL or MySQLi
*

 * @param array Array of search data

 * @param array $search Array of search data

 * @return array Array of search data with results mixed in
*/
function perform_search_mysql($search)

 * @return array Array of search data with results mixed in
*/
function perform_search_mysql($search)

Zeile 919Zeile 957
	if(!$keywords && !$search['author'])
{
error($lang->error_nosearchterms);

	if(!$keywords && !$search['author'])
{
error($lang->error_nosearchterms);

	}


	}


	if($mybb->settings['minsearchword'] < 1)

	if($mybb->settings['minsearchword'] < 1)

	{

	{

		$mybb->settings['minsearchword'] = 3;
}

		$mybb->settings['minsearchword'] = 3;
}





	$subject_lookin = $message_lookin = '';
if($keywords)
{

	$subject_lookin = $message_lookin = '';
if($keywords)
{

 
		switch($db->type)
{
case 'mysql':
case 'mysqli':
$tfield = 't.subject';
$pfield = 'p.message';
break;
default:
$tfield = 'LOWER(t.subject)';
$pfield = 'LOWER(p.message)';
break;
}


		// Complex search
$keywords = " {$keywords} ";
if(preg_match("#\s(and|or)\s#", $keywords))

		// Complex search
$keywords = " {$keywords} ";
if(preg_match("#\s(and|or)\s#", $keywords))

Zeile 978Zeile 1029
								error($lang->error_minsearchlength);
}
// Add terms to search query

								error($lang->error_minsearchlength);
}
// Add terms to search query

							$subject_lookin .= " $boolean LOWER(t.subject) LIKE '%{$word}%'";

							$subject_lookin .= " $boolean {$tfield} LIKE '%{$word}%'";

							if($search['postthread'] == 1)
{

							if($search['postthread'] == 1)
{

								$message_lookin .= " $boolean LOWER(p.message) LIKE '%{$word}%'";

								$message_lookin .= " $boolean {$pfield} LIKE '%{$word}%'";

							}
$boolean = 'AND';
}

							}
$boolean = 'AND';
}

Zeile 997Zeile 1048
						error($lang->error_minsearchlength);
}
// Add phrase to search query

						error($lang->error_minsearchlength);
}
// Add phrase to search query

					$subject_lookin .= " $boolean LOWER(t.subject) LIKE '%{$phrase}%'";

					$subject_lookin .= " $boolean {$tfield} LIKE '%{$phrase}%'";

					if($search['postthread'] == 1)
{

					if($search['postthread'] == 1)
{

						$message_lookin .= " $boolean LOWER(p.message) LIKE '%{$phrase}%'";

						$message_lookin .= " $boolean {$pfield} LIKE '%{$phrase}%'";

					}
$boolean = 'AND';
}

					}
$boolean = 'AND';
}

Zeile 1025Zeile 1076
				$lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);
}

				$lang->error_minsearchlength = $lang->sprintf($lang->error_minsearchlength, $mybb->settings['minsearchword']);
error($lang->error_minsearchlength);
}

			$subject_lookin = " AND LOWER(t.subject) LIKE '%{$keywords}%'";

			$subject_lookin = " AND {$tfield} LIKE '%{$keywords}%'";

			if($search['postthread'] == 1)
{

			if($search['postthread'] == 1)
{

				$message_lookin = " AND LOWER(p.message) LIKE '%{$keywords}%'";

				$message_lookin = " AND {$pfield} LIKE '%{$keywords}%'";

			}
}
}

			}
}
}

Zeile 1040Zeile 1091
		$search['author'] = my_strtolower($search['author']);
if($search['matchusername'])
{

		$search['author'] = my_strtolower($search['author']);
if($search['matchusername'])
{

			$query = $db->simple_select("users", "uid", "LOWER(username)='".$db->escape_string($search['author'])."'");


			$user = get_user_by_username($search['author']);
$userids[] = $user['uid'];

		}
else
{

		}
else
{

			$query = $db->simple_select("users", "uid", "LOWER(username) LIKE '%".$db->escape_string_like($search['author'])."%'");















			switch($db->type)
{
case 'mysql':
case 'mysqli':
$field = 'username';
break;
default:
$field = 'LOWER(username)';
break;
}
$query = $db->simple_select("users", "uid", "{$field} LIKE '%".$db->escape_string_like($search['author'])."%'");
while($user = $db->fetch_array($query))
{
$userids[] = $user['uid'];
}

		}


		}


		while($user = $db->fetch_array($query))
{
$userids[] = $user['uid'];
}

 
		if(count($userids) < 1)
{
error($lang->error_nosearchresults);

		if(count($userids) < 1)
{
error($lang->error_nosearchresults);

Zeile 1082Zeile 1144

$thread_replycut = '';
if($search['numreplies'] != '' && $search['findthreadst'])


$thread_replycut = '';
if($search['numreplies'] != '' && $search['findthreadst'])

	{

	{

		if((int)$search['findthreadst'] == 1)
{
$thread_replycut = " AND t.replies >= '".(int)$search['numreplies']."'";

		if((int)$search['findthreadst'] == 1)
{
$thread_replycut = " AND t.replies >= '".(int)$search['numreplies']."'";

Zeile 1096Zeile 1158
	$thread_prefixcut = '';
$prefixlist = array();
if($search['threadprefix'] && $search['threadprefix'][0] != 'any')

	$thread_prefixcut = '';
$prefixlist = array();
if($search['threadprefix'] && $search['threadprefix'][0] != 'any')

	{

	{

		foreach($search['threadprefix'] as $threadprefix)
{
$threadprefix = (int)$threadprefix;
$prefixlist[] = $threadprefix;
}

		foreach($search['threadprefix'] as $threadprefix)
{
$threadprefix = (int)$threadprefix;
$prefixlist[] = $threadprefix;
}

	}

	}

	if(count($prefixlist) == 1)

	if(count($prefixlist) == 1)

	{

	{

		$thread_prefixcut .= " AND t.prefix='$threadprefix' ";
}
else
{
if(count($prefixlist) > 1)

		$thread_prefixcut .= " AND t.prefix='$threadprefix' ";
}
else
{
if(count($prefixlist) > 1)

		{

		{

			$thread_prefixcut = " AND t.prefix IN (".implode(',', $prefixlist).")";
}
}

			$thread_prefixcut = " AND t.prefix IN (".implode(',', $prefixlist).")";
}
}

Zeile 1154Zeile 1216
					if($can_search == 0)
{
// We can't search this forum...

					if($can_search == 0)
{
// We can't search this forum...

						continue;
}
}


						continue;
}
}


 				switch($db->type)
{
case "pgsql":

 				switch($db->type)
{
case "pgsql":

Zeile 1358Zeile 1420
/**
* Perform a thread and post search under MySQL or MySQLi using boolean fulltext capabilities
*

/**
* Perform a thread and post search under MySQL or MySQLi using boolean fulltext capabilities
*

 * @param array Array of search data

 * @param array $search Array of search data

 * @return array Array of search data with results mixed in
*/
function perform_search_mysql_ft($search)

 * @return array Array of search data with results mixed in
*/
function perform_search_mysql_ft($search)

Zeile 1443Zeile 1505
		$search['author'] = my_strtolower($search['author']);
if($search['matchusername'])
{

		$search['author'] = my_strtolower($search['author']);
if($search['matchusername'])
{

			$query = $db->simple_select("users", "uid", "LOWER(username)='".$db->escape_string($search['author'])."'");


			$user = get_user_by_username($search['author']);
$userids[] = $user['uid'];

		}
else
{

		}
else
{

			$query = $db->simple_select("users", "uid", "LOWER(username) LIKE '%".$db->escape_string_like($search['author'])."%'");
}










			switch($db->type)
{
case 'mysql':
case 'mysqli':
$field = 'username';
break;
default:
$field = 'LOWER(username)';
break;
}
$query = $db->simple_select("users", "uid", "{$field} LIKE '%".$db->escape_string_like($search['author'])."%'");





		while($user = $db->fetch_array($query))
{
$userids[] = $user['uid'];


			while($user = $db->fetch_array($query))
{
$userids[] = $user['uid'];
}

		}

if(count($userids) < 1)

		}

if(count($userids) < 1)