2023-08-22 10:41:02 -07:00
|
|
|
<?php
|
2023-01-13 04:08:12 -08:00
|
|
|
require "misc/header.php";
|
|
|
|
|
|
|
|
require "misc/tools.php";
|
2023-08-21 15:58:09 -07:00
|
|
|
require "misc/search_engine.php";
|
|
|
|
|
2023-08-22 10:41:02 -07:00
|
|
|
$opts = load_opts();
|
|
|
|
|
2023-08-21 15:58:09 -07:00
|
|
|
function print_page_buttons($type, $query, $page) {
|
|
|
|
if ($type > 1)
|
|
|
|
return;
|
|
|
|
echo "<div class=\"next-page-button-wrapper\">";
|
|
|
|
|
|
|
|
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 "</div>";
|
|
|
|
}
|
2023-01-13 04:08:12 -08:00
|
|
|
?>
|
2022-03-04 01:36:31 -08:00
|
|
|
|
2022-09-03 10:45:47 -07:00
|
|
|
<title>
|
|
|
|
<?php
|
2023-08-22 10:41:02 -07:00
|
|
|
echo $opts->query;
|
2023-08-02 07:18:21 -07:00
|
|
|
?> - LibreY</title>
|
2022-02-25 01:42:32 -08:00
|
|
|
</head>
|
2022-02-17 12:14:56 -08:00
|
|
|
<body>
|
2022-07-15 06:50:23 -07:00
|
|
|
<form class="sub-search-container" method="get" autocomplete="off">
|
2023-08-02 07:28:24 -07:00
|
|
|
<h1 class="logomobile"><a class="no-decoration" href="./">Libre<span class="Y">Y</span></a></h1>
|
2022-08-28 11:41:33 -07:00
|
|
|
<input type="text" name="q"
|
2022-02-17 12:14:56 -08:00
|
|
|
<?php
|
2023-08-22 10:41:02 -07:00
|
|
|
if (1 > strlen($opts->query) || strlen($opts->query) > 256)
|
2022-02-17 12:14:56 -08:00
|
|
|
{
|
2022-04-21 02:02:32 -07:00
|
|
|
header("Location: ./");
|
2022-02-17 12:14:56 -08:00
|
|
|
die();
|
2022-08-28 11:41:33 -07:00
|
|
|
}
|
|
|
|
|
2023-08-22 10:41:02 -07:00
|
|
|
echo "value=\"" . htmlspecialchars($opts->query) . "\"";
|
2022-02-17 12:14:56 -08:00
|
|
|
?>
|
|
|
|
>
|
|
|
|
<br>
|
|
|
|
<?php
|
2023-08-22 10:41:02 -07:00
|
|
|
echo "<button class=\"hide\" name=\"t\" value=\"$opts->type\"/></button>";
|
2022-02-17 12:14:56 -08:00
|
|
|
?>
|
2022-05-19 03:46:39 -07:00
|
|
|
<button type="submit" class="hide"></button>
|
2022-02-24 13:29:10 -08:00
|
|
|
<input type="hidden" name="p" value="0">
|
|
|
|
<div class="sub-search-button-wrapper">
|
2023-01-06 11:19:30 -08:00
|
|
|
<?php
|
2023-01-13 00:31:48 -08:00
|
|
|
$categories = array("general", "images", "videos", "torrents", "tor");
|
|
|
|
|
|
|
|
foreach ($categories as $category)
|
|
|
|
{
|
|
|
|
$category_index = array_search($category, $categories);
|
2023-01-13 04:08:12 -08:00
|
|
|
|
2023-08-22 10:41:02 -07:00
|
|
|
if (($opts->disable_bittorent_search && $category_index == 3) ||
|
|
|
|
($opts->disable_hidden_service_search && $category_index ==4))
|
2023-01-13 04:08:12 -08:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2023-08-22 10:41:02 -07:00
|
|
|
echo "<a " . (($category_index == $opts->type) ? "class=\"active\" " : "") . "href=\"./search.php?q=" . urlencode($opts->query) . "&p=0&t=" . $category_index . "\"><img src=\"static/images/" . $category . "_result.png\" alt=\"" . $category . " result\" />" . ucfirst($category) . "</a>";
|
2023-01-13 00:31:48 -08:00
|
|
|
}
|
2023-01-06 11:19:30 -08:00
|
|
|
?>
|
2022-02-17 12:14:56 -08:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
2022-02-20 09:11:15 -08:00
|
|
|
<?php
|
2023-08-22 10:41:02 -07:00
|
|
|
fetch_search_results($opts, true);
|
|
|
|
print_page_buttons($opts->type, $opts->query, $opts->page);
|
2022-02-20 09:11:15 -08:00
|
|
|
?>
|
2022-02-17 12:14:56 -08:00
|
|
|
|
2022-05-15 01:34:46 -07:00
|
|
|
<?php require "misc/footer.php"; ?>
|