phpBB

Code Changes

File: phpbb/search/base.php

  Unmodified   Added   Modified   Removed
Line 133Line 133
	{
global $cache, $config, $db, $user;


	{
global $cache, $config, $db, $user;


		$length = min(sizeof($id_ary), $config['search_block_size']);

		$length = min(count($id_ary), $config['search_block_size']);


// nothing to cache so exit
if (!$length)


// nothing to cache so exit
if (!$length)

Line 148Line 148
		if (!($store = $cache->get('_search_results_' . $search_key)))
{
// add the current keywords to the recent searches in the cache which are listed on the search page

		if (!($store = $cache->get('_search_results_' . $search_key)))
{
// add the current keywords to the recent searches in the cache which are listed on the search page

			if (!empty($keywords) || sizeof($author_ary))

			if (!empty($keywords) || count($author_ary))

			{
$sql = 'SELECT search_time
FROM ' . SEARCH_RESULTS_TABLE . '

			{
$sql = 'SELECT search_time
FROM ' . SEARCH_RESULTS_TABLE . '

Line 201Line 201
			$store += $store_ids;

// if the cache is too big

			$store += $store_ids;

// if the cache is too big

			if (sizeof($store) - 2 > 20 * $config['search_block_size'])

			if (count($store) - 2 > 20 * $config['search_block_size'])

			{
// remove everything in front of two blocks in front of the current start index
for ($i = 0, $n = $id_range[0] - 2 * $config['search_block_size']; $i < $n; $i++)

			{
// remove everything in front of two blocks in front of the current start index
for ($i = 0, $n = $id_range[0] - 2 * $config['search_block_size']; $i < $n; $i++)

Line 243Line 243
		global $db, $cache, $config;

// clear all searches that searched for the specified words

		global $db, $cache, $config;

// clear all searches that searched for the specified words

		if (sizeof($words))

		if (count($words))

		{
$sql_where = '';
foreach ($words as $word)

		{
$sql_where = '';
foreach ($words as $word)

Line 264Line 264
		}

// clear all searches that searched for the specified authors

		}

// clear all searches that searched for the specified authors

		if (is_array($authors) && sizeof($authors))

		if (is_array($authors) && count($authors))

		{
$sql_where = '';
foreach ($authors as $author)

		{
$sql_where = '';
foreach ($authors as $author)