mirror of
https://github.com/hnhx/librex.git
synced 2025-01-10 03:37:25 -03:00
Merge pull request #170 from juniorbotelho/feat/wikipedia-language-settings
add wikipedia language option in /settings route
This commit is contained in:
commit
9a7d9eb084
3 changed files with 17 additions and 3 deletions
|
@ -55,7 +55,7 @@
|
|||
$url = "https://check.torproject.org/torbulkexitlist";
|
||||
break;
|
||||
case 7:
|
||||
$wikipedia_language = $config->wikipedia_language;
|
||||
$wikipedia_language = isset($_COOKIE["wikipedia_language"]) ? trim(htmlspecialchars($_COOKIE["wikipedia_language"])) : $config->wikipedia_language;
|
||||
$url = "https://$wikipedia_language.wikipedia.org/w/api.php?format=json&action=query&prop=extracts%7Cpageimages&exintro&explaintext&redirects=1&pithumbsize=500&titles=$query_encoded";
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
if (!array_key_exists("missing", $first_page))
|
||||
{
|
||||
$description = substr($first_page["extract"], 0, 250) . "...";
|
||||
|
||||
$wikipedia_language = $config->wikipedia_language;
|
||||
|
||||
$wikipedia_language = isset($_COOKIE["wikipedia_language"]) ? trim(htmlspecialchars($_COOKIE["wikipedia_language"])) : $config->wikipedia_language;
|
||||
|
||||
$source = check_for_privacy_frontend("https://$wikipedia_language.wikipedia.org/wiki/$query");
|
||||
$response = array(
|
||||
|
|
14
settings.php
14
settings.php
|
@ -77,6 +77,7 @@
|
|||
<label>Disable special queries (e.g.: currency conversion)</label>
|
||||
<input type="checkbox" name="disable_special" <?php echo isset($_COOKIE["disable_special"]) ? "checked" : ""; ?> >
|
||||
</div>
|
||||
|
||||
<h2>Privacy friendly frontends</h2>
|
||||
<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>
|
||||
<div class="settings-textbox-container">
|
||||
|
@ -96,6 +97,7 @@
|
|||
<label>Disable frontends</label>
|
||||
<input type="checkbox" name="disable_frontends" <?php echo isset($_COOKIE["disable_frontends"]) ? "checked" : ""; ?> >
|
||||
</div>
|
||||
|
||||
<h2>Google settings</h2>
|
||||
<div class="settings-textbox-container">
|
||||
<div>
|
||||
|
@ -117,6 +119,18 @@
|
|||
<input type="checkbox" name="safe_search" <?php echo isset($_COOKIE["safe_search"]) ? "checked" : ""; ?> >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Wikipedia settings</h2>
|
||||
<div class="settings-textbox-container">
|
||||
<div>
|
||||
<span>Results language</span>
|
||||
<?php
|
||||
echo "<input type=\"text\" name=\"wikipedia_language\" placeholder=\"E.g.: en\" value=\"";
|
||||
echo isset($_COOKIE["wikipedia_language"]) ? htmlspecialchars($_COOKIE["wikipedia_language"]) : $config->wikipedia_language;
|
||||
?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit" name="save" value="1">Save</button>
|
||||
<button type="submit" name="reset" value="1">Reset</button>
|
||||
|
|
Loading…
Reference in a new issue