Searchforplanet.org/index.php

118 lines
4.6 KiB
PHP
Raw Permalink Normal View History

2020-12-19 09:43:44 +01:00
<?php
if (strpos($_SERVER['REQUEST_URI'], 'index.php') !== false) {
$newLink = str_replace('/index.php','', $_SERVER['REQUEST_URI']);
header('Location: '.$newLink);
}
$searchsite = ['https://www.ecosia.org/search?q=',
'https://search.lilo.org/?q=',
'https://www.givero.com/search?q=',
'https://elliotforwater.com/Search?q=',
'https://search.givewater.com/serp?q=',
'https://www.ekoru.org/?q='
];
2020-12-19 09:43:44 +01:00
2020-12-19 14:41:10 +01:00
$q = $_GET['q'];
if (isset($q)) {
goSearch($q, $searchsite);
}
2020-12-23 09:15:12 +01:00
if (isset($_GET['theme']) && $_GET['theme'] == 'dark') {
$csstheme = "logicodev-dark.min.css";
$labeltheme = "Light";
$linktheme = "/";
} else {
$csstheme = "logicodev.min.css";
$labeltheme = "Dark";
$linktheme = "/?theme=dark";
}
2020-12-19 09:43:44 +01:00
?>
<!DOCTYPE html>
<head>
<!--
Template cloned by Searx: https://github.com/searx/searx
-->
<meta charset="UTF-8" />
<meta property="og:title" content="Search for Planet">
2020-12-19 14:41:10 +01:00
<meta property="og:description" content="Redirect searches to Ethical Search Engines">
<meta property="og:type" content="website">
<meta property="og:url" content="https://www.searchforplanet.org">
<meta property="og:image" content="icon-big-128.png">
<meta name="description" content="Redirect searches to Ethical Search Engines" />
<meta name="keywords" content="search, search engine, ethical search, ethical" />
<meta name="referrer" content="no-referrer">
<meta name="viewport" content="width=device-width, initial-scale=1 , maximum-scale=1.0, user-scalable=1" />
<title>SearchforPlanet.org</title>
<link rel="stylesheet" href="bootstrap.min.css" type="text/css" />
2020-12-23 09:15:12 +01:00
<link rel="stylesheet" href="<?=$csstheme;?>" type="text/css" />
<link rel="stylesheet" href="leaflet.min.css" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="search" href="opensearch.xml" type="application/opensearchdescription+xml" title="Search For Planet" />
</head>
<body>
<div class="searx-navbar">
<span class="instance pull-left"><a href="https://gitea.it/selectallfromdual/Searchforplanet.org/wiki/What-is" target="_blank">What is</a></span>
<span class="pull-right"><a href="<?=$linktheme;?>"><?=$labeltheme;?></a><a href="https://gitea.it/selectallfromdual/Searchforplanet.org/wiki/Privacy-policy" target="_blank">Privacy</a><a href="https://gitea.it/selectallfromdual/Searchforplanet.org/wiki/News" target="_blank">News</a></span>
</div>
<div class="container">
<div class="container-fluid">
<div class="row">
<div class="text-center col-sm-12 col-md-12">
<h1 class="text-hide center-block" id="main-logo">
<img class="center-block img-responsive" src="LOGO.webp" alt="SearchforPlanet.org"/>
SearchforPlanet.org
</h1>
<p class="text-muted">Redirect searches to Ethical Search Engines</p>
2020-12-19 09:43:44 +01:00
</div>
</div>
<div class="row">
<div class="text-center col-sm-12 col-md-12">
<form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="search_form" role="search">
<div class="input-group col-md-8 col-md-offset-2">
<input type="search" name="q" class="form-control input-lg autofocus" id="q" placeholder="Search here..." aria-label="Search here..." autocomplete="off" value="" accesskey="s">
<span class="input-group-btn">
<button type="submit" name="submit" class="btn btn-default input-lg" aria-label="Cerca"><span class="hide_if_nojs"><img src="search-icon.png"></span></button>
</span>
</div>
2020-12-19 09:43:44 +01:00
</form> </div>
</div>
</div>
</div>
<div class="footer">
<div class="container">
<p class="text-muted">
<small>By using this service you accept the <a href="https://gitea.it/selectallfromdual/Searchforplanet.org/wiki/Terms" target="_blank">Terms</a><br>
<a href="https://gitea.it/selectallfromdual/Searchforplanet.org" target="_blank">source code</a> | <a href="https://gitea.it/selectallfromdual/Searchforplanet.org/issues" target="_blank">issue tracker</a> | <a href="https://liberapay.com/searchforplanet" target="_blank">support us</a> | <a href="https://gitea.it/selectallfromdual/Searchforplanet.org/wiki/Welcome-page" target="_blank">wiki</a></small>
</p>
</div>
</div>
</body>
</html>
2020-12-19 09:43:44 +01:00
<?php
if(isset($_POST['submit'])) {
$q = $_POST['q'];
2020-12-19 14:41:10 +01:00
goSearch($q, $searchsite);
}
function goSearch($q, $searchsite) {
$q = urlencode($q);
2020-12-19 09:43:44 +01:00
$idx = rand(1,sizeof($searchsite))-1;
$query = $searchsite[$idx].$q;
2020-12-19 09:43:44 +01:00
header('Location: '.$query);
}
?>