2022-04-21 05:02:32 -04:00
|
|
|
<?php
|
|
|
|
$config = require "config.php";
|
2023-01-01 10:43:21 -03:00
|
|
|
|
|
|
|
|
2022-05-15 04:34:46 -04:00
|
|
|
if (isset($_REQUEST["save"]) || isset($_REQUEST["reset"]))
|
|
|
|
{
|
2023-01-01 10:43:21 -03:00
|
|
|
if (isset($_SERVER["HTTP_COOKIE"]))
|
2022-05-15 04:34:46 -04:00
|
|
|
{
|
|
|
|
$cookies = explode(";", $_SERVER["HTTP_COOKIE"]);
|
2023-01-01 10:43:21 -03:00
|
|
|
foreach($cookies as $cookie)
|
2022-05-15 04:34:46 -04:00
|
|
|
{
|
|
|
|
$parts = explode("=", $cookie);
|
|
|
|
$name = trim($parts[0]);
|
|
|
|
setcookie($name, "", time() - 1000);
|
|
|
|
}
|
|
|
|
}
|
2023-01-01 10:43:21 -03:00
|
|
|
|
|
|
|
}
|
2022-09-16 05:23:57 -03:00
|
|
|
|
2022-03-24 07:28:12 -03:00
|
|
|
if (isset($_REQUEST["save"]))
|
|
|
|
{
|
2022-09-16 05:23:57 -03:00
|
|
|
foreach($_POST as $key=>$value){
|
|
|
|
if (!empty($value))
|
|
|
|
{
|
|
|
|
setcookie($key, $value, time() + (86400 * 90), '/');
|
2023-02-16 08:35:04 -03:00
|
|
|
$_COOKIE[$key] = $value;
|
2022-09-16 05:23:57 -03:00
|
|
|
}
|
|
|
|
}
|
2022-03-24 07:28:12 -03:00
|
|
|
}
|
2023-01-01 10:43:21 -03:00
|
|
|
|
2022-05-15 04:34:46 -04:00
|
|
|
if (isset($_REQUEST["save"]) || isset($_REQUEST["reset"]))
|
2022-03-24 07:28:12 -03:00
|
|
|
{
|
2023-02-05 05:55:28 -03:00
|
|
|
header("Location: ./");
|
2022-05-15 04:34:46 -04:00
|
|
|
die();
|
2022-03-24 07:28:12 -03:00
|
|
|
}
|
2023-01-01 10:43:21 -03:00
|
|
|
|
2022-05-15 04:34:46 -04:00
|
|
|
require "misc/header.php";
|
|
|
|
?>
|
2022-03-09 09:18:24 -03:00
|
|
|
|
|
|
|
<title>LibreX - Settings</title>
|
|
|
|
</head>
|
2022-03-10 07:18:07 -03:00
|
|
|
<body>
|
2022-03-15 07:37:21 -03:00
|
|
|
<div class="misc-container">
|
2022-03-10 07:18:07 -03:00
|
|
|
<h1>Settings</h1>
|
|
|
|
<form method="post" enctype="multipart/form-data" autocomplete="off">
|
2022-03-15 07:37:21 -03:00
|
|
|
<div>
|
2022-03-10 07:18:07 -03:00
|
|
|
<label for="theme">Theme:</label>
|
|
|
|
<select name="theme">
|
|
|
|
<?php
|
2022-03-12 04:37:25 -03:00
|
|
|
$themes = "<option value=\"dark\">Dark</option>
|
2022-09-25 04:29:39 -03:00
|
|
|
<option value=\"darker\">Darker</option>
|
2022-09-03 20:33:51 -04:00
|
|
|
<option value=\"amoled\">AMOLED</option>
|
2022-03-10 07:18:07 -03:00
|
|
|
<option value=\"light\">Light</option>
|
2022-03-12 04:37:25 -03:00
|
|
|
<option value=\"auto\">Auto</option>
|
2023-01-01 10:43:21 -03:00
|
|
|
<option value=\"dracula\">Dracula</option>
|
2022-03-10 07:18:07 -03:00
|
|
|
<option value=\"nord\">Nord</option>
|
|
|
|
<option value=\"night_owl\">Night Owl</option>
|
2022-09-03 20:33:51 -04:00
|
|
|
<option value=\"discord\">Discord</option>
|
2022-09-25 04:29:39 -03:00
|
|
|
<option value=\"google\">Google Dark</option>
|
|
|
|
<option value=\"startpage\">Startpage Dark</option>
|
|
|
|
<option value=\"gruvbox\">Gruvbox</option>
|
2022-09-03 20:33:51 -04:00
|
|
|
<option value=\"github_night\">GitHub Night</option>";
|
2022-03-09 09:18:24 -03:00
|
|
|
|
2022-03-10 07:18:07 -03:00
|
|
|
if (isset($_COOKIE["theme"]))
|
2022-03-15 07:37:21 -03:00
|
|
|
{
|
2022-03-10 07:18:07 -03:00
|
|
|
$cookie_theme = $_COOKIE["theme"];
|
|
|
|
$themes = str_replace($cookie_theme . "\"", $cookie_theme . "\" selected", $themes);
|
|
|
|
}
|
2022-03-09 09:18:24 -03:00
|
|
|
|
2022-03-10 07:18:07 -03:00
|
|
|
echo $themes;
|
|
|
|
?>
|
|
|
|
</select>
|
2022-03-24 07:28:12 -03:00
|
|
|
</div>
|
|
|
|
<div>
|
2022-05-11 14:08:16 -04:00
|
|
|
<label>Disable special queries (e.g.: currency conversion)</label>
|
|
|
|
<input type="checkbox" name="disable_special" <?php echo isset($_COOKIE["disable_special"]) ? "checked" : ""; ?> >
|
2022-03-24 07:28:12 -03:00
|
|
|
</div>
|
2022-03-10 07:18:07 -03:00
|
|
|
<h2>Privacy friendly frontends</h2>
|
2022-03-24 07:28:12 -03:00
|
|
|
<p>For an example if you want to view YouTube without getting spied on, click on "Invidious", find the instance that is most suitable for you then paste it in (correct format: https://example.com)</p>
|
2023-01-13 05:31:48 -03:00
|
|
|
<div class="settings-textbox-container">
|
2022-12-05 09:09:39 -03:00
|
|
|
<?php
|
2022-05-21 18:53:39 -04:00
|
|
|
|
2022-12-05 09:09:39 -03:00
|
|
|
$frontends = array(
|
|
|
|
"invidious" => array("https://docs.invidious.io/instances/", "YouTube"),
|
2023-01-13 08:26:59 -03:00
|
|
|
"bibliogram" => array("https://git.sr.ht/~cadence/bibliogram-docs/tree/master/docs/Instances.md", "Instagram"),
|
2023-01-13 08:15:22 -03:00
|
|
|
"rimgo" => array("https://codeberg.org/video-prize-ranch/rimgo#instances", "Imgur"),
|
|
|
|
"scribe" => array("https://git.sr.ht/~edwardloveall/scribe/tree/main/docs/instances.md", "Medium"),
|
|
|
|
"gothub" => array("https://codeberg.org/gothub/gothub/wiki/Instances", "GitHub"),
|
|
|
|
"librarian" => array("https://codeberg.org/librarian/librarian#clearnet", "Odysee"),
|
2022-12-05 09:09:39 -03:00
|
|
|
"nitter" => array("https://github.com/zedeus/nitter/wiki/Instances", "Twitter"),
|
|
|
|
"libreddit" => array("https://github.com/spikecodes/libreddit", "Reddit"),
|
|
|
|
"proxitok" => array("https://github.com/pablouser1/ProxiTok/wiki/Public-instances", "TikTok"),
|
2023-01-16 22:51:45 -03:00
|
|
|
"wikiless" => array("https://github.com/Metastem/wikiless#instances", "Wikipedia"),
|
2022-12-05 09:09:39 -03:00
|
|
|
"quetre" => array("https://github.com/zyachel/quetre", "Quora"),
|
2022-12-28 07:45:09 -03:00
|
|
|
"libremdb" => array("https://github.com/zyachel/libremdb", "IMDb"),
|
2023-01-16 11:44:42 -03:00
|
|
|
"breezewiki" => array("https://gitdab.com/cadence/breezewiki", "Fandom"),
|
|
|
|
"anonymousoverflow" => array("https://github.com/httpjamesm/AnonymousOverflow#clearnet-instances", "StackOverflow")
|
2022-12-05 09:09:39 -03:00
|
|
|
);
|
2023-01-01 10:43:21 -03:00
|
|
|
|
2022-12-05 09:09:39 -03:00
|
|
|
foreach($frontends as $frontend => $info)
|
|
|
|
{
|
|
|
|
echo "<div>";
|
|
|
|
echo "<a for=\"$frontend\" href=\"" . $info[0] . "\" target=\"_blank\">" . ucfirst($frontend) . "</a>";
|
|
|
|
echo "<input type=\"text\" name=\"$frontend\" placeholder=\"Replace " . $info[1] . "\" value=";
|
2023-01-13 05:31:48 -03:00
|
|
|
echo isset($_COOKIE["$frontend"]) ? htmlspecialchars($_COOKIE["$frontend"]) : json_decode(json_encode($config), true)[$frontend];
|
2022-12-05 09:09:39 -03:00
|
|
|
echo ">";
|
|
|
|
echo "</div>";
|
|
|
|
}
|
|
|
|
?>
|
2022-03-15 07:37:21 -03:00
|
|
|
</div>
|
2022-09-16 05:23:57 -03:00
|
|
|
<div>
|
|
|
|
<label>Disable frontends</label>
|
|
|
|
<input type="checkbox" name="disable_frontends" <?php echo isset($_COOKIE["disable_frontends"]) ? "checked" : ""; ?> >
|
|
|
|
</div>
|
2023-01-13 05:31:48 -03:00
|
|
|
<h2>Google settings</h2>
|
|
|
|
<div class="settings-textbox-container">
|
|
|
|
<div>
|
|
|
|
<span>Google language</span>
|
|
|
|
<?php
|
|
|
|
echo "<input type=\"text\" name=\"google_language\" placeholder=\"E.g.: de\" value=\"";
|
|
|
|
echo isset($_COOKIE["google_language"]) ? htmlspecialchars($_COOKIE["google_language"]) : $config->google_language;
|
|
|
|
?>">
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<label>Safe search</label>
|
|
|
|
<input type="checkbox" name="safe_search" <?php echo isset($_COOKIE["safe_search"]) ? "checked" : ""; ?> >
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-03-15 07:37:21 -03:00
|
|
|
<div>
|
|
|
|
<button type="submit" name="save" value="1">Save</button>
|
|
|
|
<button type="submit" name="reset" value="1">Reset</button>
|
2022-03-10 07:18:07 -03:00
|
|
|
</div>
|
2022-03-24 07:28:12 -03:00
|
|
|
</form>
|
2022-03-10 07:18:07 -03:00
|
|
|
</div>
|
2022-03-09 09:18:24 -03:00
|
|
|
|
2022-05-11 14:08:16 -04:00
|
|
|
<?php require "misc/footer.php"; ?>
|