mirror of
https://github.com/hnhx/librex.git
synced 2025-01-24 17:57:58 -03:00
code cleanup, removed an instance that broke the rules
This commit is contained in:
parent
644f264f0c
commit
d909552dbf
8 changed files with 17 additions and 37 deletions
|
@ -22,7 +22,6 @@
|
||||||
| [search.milivojevic.in.rs](https://search.milivojevic.in.rs/) | [✅](http://librex2xsek6qnh2i4yufuzqjumfdwtw7io7omgmimpzna6llqudqzyd.onion/) | ❌ | 🇳🇱 NL |
|
| [search.milivojevic.in.rs](https://search.milivojevic.in.rs/) | [✅](http://librex2xsek6qnh2i4yufuzqjumfdwtw7io7omgmimpzna6llqudqzyd.onion/) | ❌ | 🇳🇱 NL |
|
||||||
| [librex.nekus.gay](https://librex.nekus.gay/) | [✅](http://5yblccekvswxl4n43bn5eg4pr7c4xygvu5lhhdb6ulzmislvahmhitad.onion/) | ❌ | 🇵🇱 PL |
|
| [librex.nekus.gay](https://librex.nekus.gay/) | [✅](http://5yblccekvswxl4n43bn5eg4pr7c4xygvu5lhhdb6ulzmislvahmhitad.onion/) | ❌ | 🇵🇱 PL |
|
||||||
| [search.davidovski.xyz](https://search.davidovski.xyz/) | ❌ | ❌ | 🇬🇧 UK |
|
| [search.davidovski.xyz](https://search.davidovski.xyz/) | ❌ | ❌ | 🇬🇧 UK |
|
||||||
| [search.funami.tech](https://search.funami.tech/) | ❌ | ❌ | 🇰🇷 KR |
|
|
||||||
| [search.madreyk.xyz](https://search.madreyk.xyz/) | ❌ | ❌ | 🇩🇪 DE |
|
| [search.madreyk.xyz](https://search.madreyk.xyz/) | ❌ | ❌ | 🇩🇪 DE |
|
||||||
| [search.pabloferreiro.es](https://search.pabloferreiro.es/) | ❌ | ❌ | 🇩🇪 DE |
|
| [search.pabloferreiro.es](https://search.pabloferreiro.es/) | ❌ | ❌ | 🇩🇪 DE |
|
||||||
| [buscar.weblibre.org](https://buscar.weblibre.org/) | ❌ | ❌ | 🇨🇱 CL |
|
| [buscar.weblibre.org](https://buscar.weblibre.org/) | ❌ | ❌ | 🇨🇱 CL |
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
// Google results will be in this language
|
// Google results will be in this language
|
||||||
"google_language" => "en",
|
"google_language" => "en",
|
||||||
|
|
||||||
// If you have a local instance you can change this to http://localhost:3000
|
// You can use any Invidious instance here
|
||||||
"invidious_instance_for_video_results" => "https://invidious.namazso.eu",
|
"invidious_instance_for_video_results" => "https://invidious.namazso.eu",
|
||||||
|
|
||||||
"disable_bittorent_search" => false,
|
"disable_bittorent_search" => false,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
$image = $url;
|
$image = $url;
|
||||||
$image_src = request($image);
|
$image_src = request($image);
|
||||||
|
|
||||||
header("Content-Type: image/jpeg");
|
header("Content-Type: image/png");
|
||||||
echo $image_src;
|
echo $image_src;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -48,12 +48,6 @@
|
||||||
"i2p": null,
|
"i2p": null,
|
||||||
"country": "UK"
|
"country": "UK"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"clearnet": "https://search.funami.tech/",
|
|
||||||
"tor": null,
|
|
||||||
"i2p": null,
|
|
||||||
"country": "KR"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"clearnet": "https://search.madreyk.xyz/",
|
"clearnet": "https://search.madreyk.xyz/",
|
||||||
"tor": null,
|
"tor": null,
|
||||||
|
@ -115,10 +109,10 @@
|
||||||
"country": "IN"
|
"country": "IN"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"clearnet": "https://lx.drain.win",
|
"clearnet": "https://lx.drain.win",
|
||||||
"tor": null,
|
"tor": null,
|
||||||
"i2p": null,
|
"i2p": null,
|
||||||
"country": "SG"
|
"country": "SG"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
<link title="LibreX search" type="application/opensearchdescription+xml" href="/opensearch.xml?method=POST" rel="search"/>
|
<link title="LibreX search" type="application/opensearchdescription+xml" href="/opensearch.xml?method=POST" rel="search"/>
|
||||||
<link rel="stylesheet" type="text/css" href="<?php
|
<link rel="stylesheet" type="text/css" href="<?php
|
||||||
echo "static/css/";
|
echo "static/css/";
|
||||||
if (isset($_COOKIE["theme"]) || isset($_REQUEST["theme"]))
|
if (isset($_COOKIE["theme"]))
|
||||||
echo htmlspecialchars((isset($_COOKIE["theme"]) ? $_COOKIE["theme"] : $_REQUEST["theme"]) . ".css");
|
echo htmlspecialchars($_COOKIE["theme"] . ".css");
|
||||||
else
|
else
|
||||||
echo "dark.css";
|
echo "dark.css";
|
||||||
?>"/>
|
?>"/>
|
||||||
|
|
|
@ -21,12 +21,10 @@
|
||||||
{
|
{
|
||||||
$config = require "config.php";
|
$config = require "config.php";
|
||||||
|
|
||||||
if (isset($_COOKIE[$frontend]) || isset($_REQUEST[$frontend]) || !empty($config->$frontend))
|
if (isset($_COOKIE[$frontend]) || !empty($config->$frontend))
|
||||||
{
|
{
|
||||||
if (isset($_COOKIE[$frontend]))
|
if (isset($_COOKIE[$frontend]))
|
||||||
$frontend = $_COOKIE[$frontend];
|
$frontend = $_COOKIE[$frontend];
|
||||||
else if (isset($_REQUEST[$frontend]))
|
|
||||||
$frontend = $_REQUEST[$frontend];
|
|
||||||
else if (!empty($config->$frontend))
|
else if (!empty($config->$frontend))
|
||||||
$frontend = $config->$frontend;
|
$frontend = $config->$frontend;
|
||||||
|
|
||||||
|
@ -140,7 +138,7 @@
|
||||||
|
|
||||||
function check_for_special_search($query)
|
function check_for_special_search($query)
|
||||||
{
|
{
|
||||||
if (isset($_COOKIE["disable_special"]) || isset($_REQUEST["disable_special"]))
|
if (isset($_COOKIE["disable_special"]))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
$query_lower = strtolower($query);
|
$query_lower = strtolower($query);
|
||||||
|
@ -226,13 +224,6 @@
|
||||||
function print_next_page_button($text, $page, $query, $type)
|
function print_next_page_button($text, $page, $query, $type)
|
||||||
{
|
{
|
||||||
echo "<form class=\"page\" action=\"search.php\" target=\"_top\" method=\"get\" autocomplete=\"off\">";
|
echo "<form class=\"page\" action=\"search.php\" target=\"_top\" method=\"get\" autocomplete=\"off\">";
|
||||||
foreach($_REQUEST as $key=>$value)
|
|
||||||
{
|
|
||||||
if ($key != "q" && $key != "p" && $key != "t")
|
|
||||||
{
|
|
||||||
echo "<input type=\"hidden\" name=\"$key\" value=\"$value\"/>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
echo "<input type=\"hidden\" name=\"p\" value=\"" . $page . "\" />";
|
echo "<input type=\"hidden\" name=\"p\" value=\"" . $page . "\" />";
|
||||||
echo "<input type=\"hidden\" name=\"q\" value=\"$query\" />";
|
echo "<input type=\"hidden\" name=\"q\" value=\"$query\" />";
|
||||||
echo "<input type=\"hidden\" name=\"t\" value=\"$type\" />";
|
echo "<input type=\"hidden\" name=\"t\" value=\"$type\" />";
|
||||||
|
|
16
search.php
16
search.php
|
@ -29,14 +29,6 @@
|
||||||
>
|
>
|
||||||
<br>
|
<br>
|
||||||
<?php
|
<?php
|
||||||
foreach($_REQUEST as $key=>$value)
|
|
||||||
{
|
|
||||||
if ($key != "q" && $key != "p" && $key != "t")
|
|
||||||
{
|
|
||||||
echo "<input type=\"hidden\" name=\"" . htmlspecialchars($key) . "\" value=\"" . htmlspecialchars($value) . "\"/>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$type = isset($_REQUEST["t"]) ? (int) $_REQUEST["t"] : 0;
|
$type = isset($_REQUEST["t"]) ? (int) $_REQUEST["t"] : 0;
|
||||||
echo "<button class=\"hide\" name=\"t\" value=\"$type\"/></button>";
|
echo "<button class=\"hide\" name=\"t\" value=\"$type\"/></button>";
|
||||||
?>
|
?>
|
||||||
|
@ -120,10 +112,14 @@
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
$query_parts = explode(" ", $query);
|
||||||
|
$last_word_query = end($query_parts);
|
||||||
|
if (substr($query, 0, 1) == "!" || substr($last_word_query, 0, 1) == "!")
|
||||||
|
check_ddg_bang($query);
|
||||||
require "engines/google/text.php";
|
require "engines/google/text.php";
|
||||||
$results = get_text_results($query_encoded, $page);
|
$results = get_text_results($query, $page);
|
||||||
print_text_results($results);
|
|
||||||
print_elapsed_time($start_time);
|
print_elapsed_time($start_time);
|
||||||
|
print_text_results($results);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
if (isset($_REQUEST["save"]) || isset($_REQUEST["reset"]))
|
if (isset($_REQUEST["save"]) || isset($_REQUEST["reset"]))
|
||||||
{
|
{
|
||||||
header("Location: ./settings.php");
|
header("Location: ./");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue