From 5637b6bc9e9ca99779fd6483318f33a6fe38152d Mon Sep 17 00:00:00 2001 From: Philip Wittamore Date: Sat, 8 Nov 2025 17:52:58 +0100 Subject: update --- search.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 search.php (limited to 'search.php') diff --git a/search.php b/search.php new file mode 100644 index 0000000..dc09366 --- /dev/null +++ b/search.php @@ -0,0 +1,43 @@ +setFlags(RecursiveDirectoryIterator::SKIP_DOTS); + $iter = new RecursiveIteratorIterator($dir); + + $i=0; + + echo "+".str_repeat("-", 65)."+\n\n"; + foreach ($iter as $phlogdir) { + $path=$phlogdir->getPathname(); + if (str_contains($path, "/gophermap") || + ($path=="/srv/gopher/phlog/rss.xml") || + ($path=="/srv/gopher/phlog/search.php")) + continue; + $content = strtolower(file_get_contents($path)); + $path=str_replace("/srv/gopher", "", $path); + if (strpos($content, $string) !== false) { + $i++; + $title = preg_split('#\r?\n#', $content, 2)[0]; + $dt=substr($path, 12, 10); + echo "0".$dt." ".ucfirst($title)."\t".$path."\t"."spike.nagatha.fr\t70\n"; + } + } + + if ($i == 0) echo "No match"; +}else{ + echo "Empty search string\n\n"; + echo "1Return to Phlo\t/phlog\tspike.nagatha.fr\t70\n"; +} + +?> + -- cgit v1.2.3