added optional sensitive search

This commit is contained in:
root 2025-01-23 13:19:31 +01:00
parent bdde1d4f44
commit 99e101f9cf
2 changed files with 20 additions and 9 deletions

View file

@ -1,5 +1,5 @@
<?php <?php
function DisplayCSVNEW($csvfile, $query) { function DisplayCSVNEW($csvfile, $query, $sensitive) {
$resultcount=0; $resultcount=0;
$row = 1; $row = 1;
echo "<center><table>\n\n"; //begin html table formatting echo "<center><table>\n\n"; //begin html table formatting
@ -16,6 +16,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) {
if ( $row == "2") { if ( $row == "2") {
echo "<tr><td>Category</td> <td>Name</td> <td>Score</td> <td></td></tr>"; echo "<tr><td>Category</td> <td>Name</td> <td>Score</td> <td></td></tr>";
//echo "<tr><td>Category</td> <td>Name</td> <td>Sensitive</td> <td>Score</td> <td></td></tr>"; //OPTIONAL: if you want to display the sensitive column
}else{ }else{
if (str_contains(strtolower($data[3]), strtolower($query)) or str_contains(strtolower($data[2]), strtolower($query)) or str_contains(strtolower($data[1]), strtolower($query))) { if (str_contains(strtolower($data[3]), strtolower($query)) or str_contains(strtolower($data[2]), strtolower($query)) or str_contains(strtolower($data[1]), strtolower($query))) {
$resultcount++; $resultcount++;
@ -31,6 +32,10 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) {
$urllink = $data[3]; $urllink = $data[3];
} }
//if ((($sensitive == 1) and ($data[4] == "✔️")) or (($sensitive == 0) and ($data[4] != "✔️")) ){
// ONLY display links if (sensitive equals to 1 and sensitiveCOLUMN equals to V) OR (sensitive equals to 0 and sensitiveCOLUMN is NOT equal to V)
if (($data[4] != "✔️") or (($sensitive == 1) and ($data[4] == "✔️"))){
if ($oldcatname != $data[1]){ if ($oldcatname != $data[1]){
echo "<td><tr></tr><tr></tr><tr></tr></td>"; // skip a row if new category echo "<td><tr></tr><tr></tr><tr></tr></td>"; // skip a row if new category
@ -46,6 +51,7 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) {
//echo $data[3] . '"> '; // display the link //echo $data[3] . '"> '; // display the link
echo $urllink . '"> '; // display the link echo $urllink . '"> '; // display the link
echo $data[2] . " </a></td><td>"; // display the link title and close the a href and first cell, open the second cell echo $data[2] . " </a></td><td>"; // display the link title and close the a href and first cell, open the second cell
///echo $data[4] . " </td><td>"; // OPTIONAL: display the sensitive column
echo $data[7] . " </td><td>"; // display the status and close the second cell, open the third cell echo $data[7] . " </td><td>"; // display the status and close the second cell, open the third cell
echo $data[6] . " </td> \n"; // display the score and close the third cell echo $data[6] . " </td> \n"; // display the score and close the third cell
} }
@ -54,6 +60,7 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) {
} }
} }
} }
}
echo "</tr>"; // end html table row echo "</tr>"; // end html table row
} }
echo "\n</table></center>"; echo "\n</table></center>";
@ -211,7 +218,6 @@ echo "<center><table>\n\n";
<!--<p><a href="index.php">Darknet Onion Webring</a> - <a href="nonkycservices.php">Non-KYC Services</a> - <a href="sensitive.php">Sensitive Darknet Websites</a> - <a href="moneronodes.php">Monero Nodes</a> - <a href="nowhere.php">Nowhere Infrastructure</a> </p>-->
</br> </br>

View file

@ -14,19 +14,24 @@
<?php <?php
require("header.php"); require("header.php");
$sensitive=0;
?> ?>
<form action="index.php" method="GET"> <form action="index.php" method="GET">
<input type="text" name="query" /> <input type="text" name="query" />
<input type="submit" value="Search" /> <input type="submit" value="Search" /> </br>
<input type="checkbox" name="sensitive" value="1"></br> <p>Sensitive Search: <input type="checkbox" name="sensitive" value="1"></p></br>
</form> </form>
<?php <?php
$sensitive = $_GET['sensitive'] $sensitive = $_GET['sensitive'];
echo "sensitive= " . $sensitive; if ($sensitive == 1){
//echo "<p>Sensitive ON " . $sensitive . "</p>";
$sensitive=1;
}else{
$sensitive=0;
//echo "<p>Sensitive OFF " . $sensitive . "</p>";
}
$query = $_GET['query']; $query = $_GET['query'];
// gets value sent over search form // gets value sent over search form
@ -51,10 +56,10 @@ $sensitive=0;
//echo $unverifiedcsvpath; //echo $unverifiedcsvpath;
echo "<h3><u>Verified Links:</u></h3>"; echo "<h3><u>Verified Links:</u></h3>";
echo nl2br("\n"); echo nl2br("\n");
DisplayCSVNEW($verifiedcsvpath,$query); DisplayCSVNEW($verifiedcsvpath,$query,$sensitive);
echo "</br></br></br><h3><u>Unverified Links:</u></h3>"; echo "</br></br></br><h3><u>Unverified Links:</u></h3>";
echo nl2br("\n"); echo nl2br("\n");
DisplayCSVNEW($unverifiedcsvpath,$query); DisplayCSVNEW($unverifiedcsvpath,$query,$sensitive);
// display the results of verified.csv // display the results of verified.csv
// only display the results of verified.csv that matches with the search term // only display the results of verified.csv that matches with the search term
// display the results of unverified.csv // display the results of unverified.csv