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 $filename => $sorted) {
30 $article = new ArchiveArticle($filename);
31 printf('<li><a href="%s">%s</a>', $article->link, $article->name);
32 if ($article->image) {
33 printf("\n\t".'<img class="right" src="/%s" />', $article->thumb('100x100'));
35 if ($article->teaser) {
36 printf("\n\t<blockquote>%s</blockquote>",
37 preg_replace('/\n(.*)/s', ' <small>\1</small>', $article->teaser)