3 $search = new RecursiveCallbackFilterIterator(
4 new RecursiveDirectoryIterator(ltrim($Args, '/') ?: '.'),
6 if ($current->getFilename()[0] === '.') {
7 # skip hidden files and directories
10 if ($current->isLink()) {
11 # ignore symlinks, original contents only
14 return $current->isDir()
15 || preg_match('/\.html$/', $current->getFilename());
19 # order alphabetically by link
20 $dir = iterator_to_array(new RecursiveIteratorIterator($search));
21 array_walk($dir, function (&$row, $name) {
22 # prepare values for sorting (directory index first)
23 $row = preg_replace('{/index\.html$}', '', $name);
27 # list article details
28 print '<ul class="replies">'."\n";
29 foreach ($dir as $Args => $sorted) {
31 include 'linkref.php';