2 if (!function_exists('shownews')) {
3 function shownews($input, $limit = 1000)
5 if (!is_array($input)) $input = glob("$input/*.html");
6 foreach (array_reverse($input) as $filename) {
7 $article = new ArchiveArticle($filename);
8 print '<article class="left">';
10 $imgattr = ' class="left"';
11 if (preg_match('{ (\s alt="[^"]+") }x', $article->img, $img)) {
12 $imgattr .= $img[0]; # preserve alt value
14 printf('<img src="/%s"%s />', $article->thumb, $imgattr);
18 '<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
19 $article->link, $article->title, $article->date
21 print $article->story;
23 print "</article>\n\n";
25 if (--$limit <= 0) break;
29 function printtoc($input, $class = FALSE)
31 if (!is_array($input)) $input = glob("$input/*.html");
33 if ($class) printf(' class="%s"', $class);
35 foreach (array_reverse($input) as $page) {
36 $article = new ArchiveArticle($page);
37 $html = $article->safetitle;
38 $dateparts = $article->dateparts;
40 $dateparts[0] = NULL; # omit year
42 $html .= sprintf(' <small class="date">%s</small>', showdate($dateparts));
43 if ($class == 'gallery' and $article->img) {
44 $html = "<div>$html</div>";
45 $html = sprintf('<img src="%s" />', $article->thumb(200)) . $html;
47 $html = sprintf('<a href="/%s">%s</a>', $article->link, $html);
48 print "<li><article>$html</article></li>\n";
54 $articles = (ltrim($Args, '/') ?: 'nieuws');
55 if (strpos($articles, '/') === FALSE) {
56 if (@$Place['view'] === 'toc') {
57 foreach (array_reverse(glob("$articles/2???")) as $page) {
58 $year = basename($page, '.html');
59 printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
60 printtoc($page, 'gallery');
67 if (@$Place['view'] === 'toc') {
72 shownews($articles, @$Place['n'] ?: 5);