2 if (!function_exists('shownews')) {
3 function shownews($input, $limit = 1000)
5 if (!is_array($input)) $input = glob("$input/*.html");
7 foreach (array_reverse($input) as $filename) {
8 $article = new ArchiveArticle($filename);
9 print '<article class="left">';
10 if ($article->thumb) {
11 $imgattr = ' class="left"';
12 if (preg_match('{ (\s alt="[^"]+") }x', $article->img, $img)) {
13 $imgattr .= $img[0]; # preserve alt value
15 printf('<img src="/%s"%s />', $article->thumb, $imgattr);
19 '<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
20 $article->link, $article->title, showdate($article->dateparts)
22 print $article->story;
24 print "</article>\n\n";
26 if (--$limit <= 0) break;
31 function printtoc($input, $class = FALSE)
33 if (!is_array($input)) $input = glob("$input/*.html");
35 if ($class) printf(' class="%s"', $class);
37 foreach (array_reverse($input) as $page) {
38 $article = new ArchiveArticle($page);
39 $html = $article->safetitle;
40 $dateparts = $article->dateparts;
42 $dateparts[0] = NULL; # omit year
44 $html .= sprintf(' <small class="date">%s</small>', showdate($dateparts));
45 if ($class == 'gallery' and $article->img) {
46 $html = "<div>$html</div>";
47 $html = sprintf('<img src="/%s" />', $article->thumb(200)) . $html;
49 $html = sprintf('<a href="/%s">%s</a>', $article->link, $html);
50 print "<li><article>$html</article></li>\n";
56 $articles = $Page->place[0] ?? 'nieuws';
57 if (strpos($articles, '/') === FALSE) {
58 if (@$Page->place['view'] === 'toc') {
60 foreach (array_reverse(glob("$articles/2???")) as $page) {
61 $year = basename($page, '.html');
62 printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
63 printtoc($page, 'gallery');
71 if (@$Page->place['view'] === 'toc') {
76 shownews($articles, @$Page->place['n'] ?: 5);
77 $Page->raw = ob_get_clean();
78 print $Page->render();