From 99e101f9cf28e111ddead9808b24c49eef6aa1ce Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Jan 2025 13:19:31 +0100 Subject: [PATCH] added optional sensitive search --- www/header.php | 10 ++++++++-- www/index.php | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/www/header.php b/www/header.php index 720ceb4..d123ad2 100644 --- a/www/header.php +++ b/www/header.php @@ -1,5 +1,5 @@ \n\n"; //begin html table formatting @@ -16,6 +16,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { if ( $row == "2") { echo ""; + //echo ""; //OPTIONAL: if you want to display the sensitive column }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))) { $resultcount++; @@ -31,6 +32,10 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $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]){ echo ""; // 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 $urllink . '"> '; // display the link echo $data[2] . " \n"; // display the score and close the third cell } @@ -54,6 +60,7 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) { } } } + } echo ""; // end html table row } echo "\n
Category Name Score
Category Name Sensitive Score
"; // display the link title and close the a href and first cell, open the second cell + ///echo $data[4] . " "; // OPTIONAL: display the sensitive column echo $data[7] . " "; // display the status and close the second cell, open the third cell echo $data[6] . "
"; @@ -211,7 +218,6 @@ echo "
\n\n"; -
diff --git a/www/index.php b/www/index.php index 675f23d..8a22b86 100644 --- a/www/index.php +++ b/www/index.php @@ -14,19 +14,24 @@ - -
+
+

Sensitive Search:


Sensitive ON " . $sensitive . "

"; + $sensitive=1; + }else{ + $sensitive=0; + //echo "

Sensitive OFF " . $sensitive . "

"; + } $query = $_GET['query']; // gets value sent over search form @@ -51,10 +56,10 @@ $sensitive=0; //echo $unverifiedcsvpath; echo "

Verified Links:

"; echo nl2br("\n"); - DisplayCSVNEW($verifiedcsvpath,$query); + DisplayCSVNEW($verifiedcsvpath,$query,$sensitive); echo "


Unverified Links:

"; echo nl2br("\n"); - DisplayCSVNEW($unverifiedcsvpath,$query); + DisplayCSVNEW($unverifiedcsvpath,$query,$sensitive); // 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