From d81173a488e314f3cdc6cb3b979939cad31dc0be Mon Sep 17 00:00:00 2001
From: root "; // skip a row if new category
//echo " "; // skip a row if new category
echo ' '; // display the category as its the first row with this new category
@@ -158,26 +158,21 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) {
$data[6]=preg_replace("/[^a-zA-Z0-9:\/.\ -]/", "", $data[6]);
$data[7]=preg_replace("/[^a-zA-Z0-9:\/.\ -]/", "", $data[7]);
- 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++;
for ($c=0; $c < $num; $c++) { // iterate over each row
- // if the row is the first one (name url status score) only display (Name Status Score):
- // display the contents of a csv row
if ( $c == "1" ){
- if ($oldcatname != $data[1]){
+ if (strtolower($oldcatname) != strtolower($data[1])){
echo '' . $data[1] . ' | '; // display the category as its the first row with this new category
$oldcatname=$data[1];
}
}
}
- }
}
}
echo 'Display All Links |' . $data[1] . '
" . $resultcount . " Result(s) found.
"; } } diff --git a/www/index.php b/www/index.php index 8f738d3..2412089 100644 --- a/www/index.php +++ b/www/index.php @@ -84,9 +84,8 @@ require("header.php"); // 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 'Search query must be between '.$min_length . " and ".$max_length . " characters.
"; - // TODO list the available categories + else { // if query length is less than minimum or more than maximum + echo 'Search query must be between ' . $min_length . " and " . $max_length . " characters.
"; } ?>