mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-05-16 20:26:58 +00:00
82 lines
2.5 KiB
PHP
82 lines
2.5 KiB
PHP
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<body>
|
|
<head>
|
|
<title>Darknet Lantern</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="stylesheet" type="text/css" href="style.css">
|
|
<link rel="icon" href="/img/logo-favicon.png">
|
|
</head>
|
|
<center >
|
|
|
|
|
|
|
|
<?php
|
|
require("header.php");
|
|
$min_length = 1;
|
|
$max_length = 32;
|
|
$instance= $_SERVER['SERVER_NAME'];
|
|
$participantpath="participants/" . $instance . '/';
|
|
$verifiedcsvpath="participants/" . $instance . '/verified.csv';
|
|
$unverifiedcsvpath="participants/" . $instance . '/unverified.csv';
|
|
|
|
// check if the verified and unverified csv files have links in them or not:
|
|
$lines_uv = count(file($unverifiedcsvpath));
|
|
$lines_v = count(file($verifiedcsvpath));
|
|
//echo "<p>CSV LINES: " . $lines_uv . " " . $lines_v . "</p>";
|
|
|
|
?>
|
|
|
|
|
|
|
|
<?php
|
|
$sensitive = '1';
|
|
$query = '.';
|
|
// gets value sent over search form
|
|
|
|
|
|
if(strlen($query) >= $min_length and strlen($query) <= $max_length){ // if query length is more or equal minimum length then
|
|
|
|
$query = htmlspecialchars($query);
|
|
// removes the risky characters
|
|
// there needs to be regex checking, only allow [a-zA-Z0-9.:/]
|
|
$query=preg_replace("/[^a-zA-Z0-9:\/.\ ]/", "", $query);
|
|
|
|
|
|
//echo "<p>Search results for " . $query . " :</p>";
|
|
echo nl2br("\n");
|
|
echo nl2br("\n");
|
|
//echo $verifiedcsvpath;
|
|
//echo nl2br("\n");
|
|
//echo $unverifiedcsvpath;
|
|
if ($lines_v >= 2){
|
|
echo '<div class="verified"><h3>Verified Links</h3></br></div>';
|
|
echo nl2br("\n");
|
|
DisplayCSVNEW($verifiedcsvpath,$query,$sensitive);
|
|
}else{
|
|
echo "<p>Your verified.csv file is empty, check the documentation to know how to add links into it.</p>";
|
|
}
|
|
if ($lines_uv >= 2){
|
|
echo '</br></br></br><div class="unverified"><h3>Unverified Links</h3></br></div>';
|
|
echo nl2br("\n");
|
|
DisplayCSVNEW($unverifiedcsvpath,$query,$sensitive);
|
|
}else{
|
|
echo "<p>Your unverified.csv file is empty, please check the documentation to know how to add links into it.</p>";
|
|
}
|
|
// display the results of verified.csv
|
|
// only display the results of verified.csv that matches with the search term
|
|
// display the results of unverified.csv
|
|
// only display the results of unverified.csv that matches with the search term
|
|
|
|
}
|
|
else{ // if query length is less than minimum or more than maximum
|
|
echo '</br></br><img src="img/logo-large.png"><p>Search query must be between '.$min_length . " and ".$max_length . " characters.</p>";
|
|
// TODO list the available categories
|
|
}
|
|
?>
|
|
<?php
|
|
require("footer.php");
|
|
?>
|
|
|
|
|