|
@@ -3,13 +3,14 @@
|
|
|
<title>LibreX - Settings</title>
|
|
|
</head>
|
|
|
<body>
|
|
|
- <div class="settings-container">
|
|
|
+ <div class="misc-container">
|
|
|
<h1>Settings</h1>
|
|
|
<form method="post" enctype="multipart/form-data" autocomplete="off">
|
|
|
+ <div>
|
|
|
<label for="theme">Theme:</label>
|
|
|
<select name="theme">
|
|
|
<?php
|
|
|
-
|
|
|
+
|
|
|
$themes = "<option value=\"dark\">Dark</option>
|
|
|
<option value=\"light\">Light</option>
|
|
|
<option value=\"auto\">Auto</option>
|
|
@@ -18,7 +19,7 @@
|
|
|
<option value=\"discord\">Discord</option>";
|
|
|
|
|
|
if (isset($_COOKIE["theme"]))
|
|
|
- {
|
|
|
+ {
|
|
|
$cookie_theme = $_COOKIE["theme"];
|
|
|
$themes = str_replace($cookie_theme . "\"", $cookie_theme . "\" selected", $themes);
|
|
|
}
|
|
@@ -26,36 +27,43 @@
|
|
|
echo $themes;
|
|
|
?>
|
|
|
</select>
|
|
|
- <br><br>
|
|
|
+ </div>
|
|
|
<h2>Privacy friendly frontends</h2>
|
|
|
- <p>Replace popular sites with privacy friendly frontends</p>
|
|
|
+ <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:
|
|
|
<div class="instances-container">
|
|
|
- <a for="invidious" href="https://docs.invidious.io/Invidious-Instances/" target="_blank">Invidious</a>
|
|
|
- <input type="text" name="invidious" placeholder="e.g.: https://yewtu.be" value=
|
|
|
- <?php echo isset($_COOKIE["invidious"]) ? $_COOKIE["invidious"] : "\"\""; ?>
|
|
|
- >
|
|
|
-
|
|
|
- <br><br>
|
|
|
- <a for="bibliogram" href="https://git.sr.ht/~cadence/bibliogram-docs/tree/master/docs/Instances.md" target="_blank">Bibliogram</a>
|
|
|
- <input type="text" name="bibliogram" value=
|
|
|
- <?php echo isset($_COOKIE["bibliogram"]) ? $_COOKIE["bibliogram"] : "\"\""; ?>
|
|
|
- >
|
|
|
-
|
|
|
- <br><br>
|
|
|
- <a for="nitter" href="https://github.com/zedeus/nitter/wiki/Instances" target="_blank">Nitter</a>
|
|
|
- <input type="text" name="nitter" value=
|
|
|
- <?php echo isset($_COOKIE["nitter"]) ? $_COOKIE["nitter"] : "\"\""; ?>
|
|
|
- >
|
|
|
-
|
|
|
- <br><br>
|
|
|
- <a for="libreddit" href=" https://github.com/spikecodes/libreddit" target="_blank">Libreddit</a>
|
|
|
- <input type="text" name="libreddit" value=
|
|
|
- <?php echo isset($_COOKIE["libreddit"]) ? $_COOKIE["libreddit"] : "\"\""; ?>
|
|
|
- >
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <a for="invidious" href="https://docs.invidious.io/Invidious-Instances/" target="_blank">Invidious</a>
|
|
|
+ <input type="text" name="invidious" placeholder="Replace YouTube" value=
|
|
|
+ <?php echo isset($_COOKIE["invidious"]) ? $_COOKIE["invidious"] : "\"\""; ?>
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <a for="bibliogram" href="https://git.sr.ht/~cadence/bibliogram-docs/tree/master/docs/Instances.md" target="_blank">Bibliogram</a>
|
|
|
+ <input type="text" name="bibliogram" placeholder="Replace Instagram" value=
|
|
|
+ <?php echo isset($_COOKIE["bibliogram"]) ? $_COOKIE["bibliogram"] : "\"\""; ?>
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <a for="nitter" href="https://github.com/zedeus/nitter/wiki/Instances" target="_blank">Nitter</a>
|
|
|
+ <input type="text" name="nitter" placeholder="Replace Twitter" value=
|
|
|
+ <?php echo isset($_COOKIE["nitter"]) ? $_COOKIE["nitter"] : "\"\""; ?>
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <a for="libreddit" href="https://github.com/spikecodes/libreddit" target="_blank">Libreddit</a>
|
|
|
+ <input type="text" name="libreddit" placeholder="Replace Reddit" value=
|
|
|
+ <?php echo isset($_COOKIE["libreddit"]) ? $_COOKIE["libreddit"] : "\"\""; ?>
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <button type="submit" name="save" value="1">Save</button>
|
|
|
+ <button type="submit" name="reset" value="1">Reset</button>
|
|
|
</div>
|
|
|
- <br>
|
|
|
- <button type="submit" name="save" value="1">Save</button>
|
|
|
- <button type="submit" name="reset" value="1">Reset</button>
|
|
|
</form>
|
|
|
|
|
|
|
|
@@ -74,6 +82,7 @@
|
|
|
if (!empty($_REQUEST["libreddit"]))
|
|
|
setcookie("libreddit", $_REQUEST["libreddit"]);
|
|
|
|
|
|
+
|
|
|
setcookie("theme", $_REQUEST["theme"]);
|
|
|
|
|
|
header("Location: /settings.php");
|
|
@@ -81,13 +90,13 @@
|
|
|
}
|
|
|
else if (isset($_REQUEST["reset"]))
|
|
|
{
|
|
|
- if (isset($_SERVER['HTTP_COOKIE'])) {
|
|
|
- $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
|
|
|
+ if (isset($_SERVER["HTTP_COOKIE"])) {
|
|
|
+ $cookies = explode(";", $_SERVER["HTTP_COOKIE"]);
|
|
|
foreach($cookies as $cookie) {
|
|
|
- $parts = explode('=', $cookie);
|
|
|
+ $parts = explode("=", $cookie);
|
|
|
$name = trim($parts[0]);
|
|
|
- setcookie($name, '', time()-1000);
|
|
|
- setcookie($name, '', time()-1000, '/');
|
|
|
+ setcookie($name, "", time()-1000);
|
|
|
+ setcookie($name, "", time()-1000, "/");
|
|
|
}
|
|
|
|
|
|
header("Location: /settings.php");
|
|
@@ -97,4 +106,4 @@
|
|
|
?>
|
|
|
</div>
|
|
|
|
|
|
-<?php require "misc/footer.php"; ?>
|
|
|
+<?php require "misc/footer.php"; ?>
|