2 if (!function_exists('shownews')) {
3 function shownews($input, $limit = 1000, $abbr = FALSE)
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)
23 print '<p>' . $article->teaser;
24 if ($article->story != "<p>{$article->teaser}</p>\n\n") {
25 print ' <small class="footer">(Meer op de site)</small>';
30 print $article->story;
33 print "</article>\n\n";
35 if (--$limit <= 0) break;
40 function printtoc($input, $class = FALSE)
42 if (!is_array($input)) $input = glob("$input/*.html");
44 if ($class) printf(' class="%s"', $class);
46 foreach (array_reverse($input) as $page) {
47 $article = new ArchiveArticle($page);
48 $html = $article->safetitle;
49 $dateparts = $article->dateparts;
51 $dateparts[0] = NULL; # omit year
53 $html .= sprintf(' <small class="date">%s</small>', showdate($dateparts));
54 if ($class == 'gallery' and $article->img) {
55 $html = "<div>$html</div>";
56 $html = sprintf('<img src="/%s" />', $article->thumb(200)) . $html;
58 $html = sprintf('<a href="/%s">%s</a>', $article->link, $html);
59 print "<li><article>$html</article></li>\n";
65 $articles = $Page->place[0] ?? 'nieuws';
66 if (strpos($articles, '/') === FALSE) {
67 if (@$Page->place['view'] === 'toc') {
69 foreach (array_reverse(glob("$articles/2???")) as $page) {
70 $year = basename($page, '.html');
71 printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
72 printtoc($page, 'gallery');
80 if (@$Page->place['view'] === 'toc') {
85 shownews($articles, @$Page->place['n'] ?: 5, !empty($Page->place['teaser']));
86 $Page->raw = ob_get_clean();
87 print $Page->render();