count(explode(" ", $query))) // long queries usually wont return a wiki result thats why this check exists
{
require "engines/special/wikipedia.php";
wikipedia_results($query_lower);
return;
}
}
$page = isset($_REQUEST["p"]) ? (int) $_REQUEST["p"] : 0;
$type = isset($_REQUEST["type"]) ? (int) $_REQUEST["type"] : 0;
$query_encoded = urlencode($query);
switch ($type)
{
case 0:
require "engines/google/text.php";
$results = get_text_results($query_encoded, $page);
if ($page == 0)
check_for_special_search($query);
print_text_results($results);
break;
case 1:
require "engines/google/image.php";
$results = get_image_results($query_encoded);
print_image_results($results);
break;
case 2:
require "engines/google/video.php";
$results = get_video_results($query_encoded, $page);
print_video_results($results);
break;
case 3:
if ($config_disable_bittorent_search)
echo "The host disabled this feature! :C
";
else
{
require "engines/bittorrent/merge.php";
$results = get_merged_torrent_results($query_encoded);
print_merged_torrent_results($results);
break;
}
break;
default:
require "engines/google/text.php";
$results = get_text_results($query_encoded, $page);
print_text_results($results);
break;
}
if ($type == 0 || $type == 2 )
{
echo "";
if ($page != 0)
{
print_next_page_button("<<", 0, $query, $type);
print_next_page_button("<", $page - 10, $query, $type);
}
for ($i=$page / 10; $page / 10 + 10 > $i; $i++)
print_next_page_button($i + 1, $i * 10, $query, $type);
print_next_page_button(">", $page + 10, $query, $type);
echo "
";
}
?>