2 include_once 'nieuws.inc.php';
4 if (!function_exists('shownews')) {
5 function shownews($input, $limit = 1000)
7 if (!is_array($input)) $input = glob("$input/*.html");
8 foreach (array_reverse($input) as $filename) {
9 $article = new ArchiveArticle($filename);
10 print '<article class="left">';
11 if ($article->thumb) {
12 $imgattr = ' class="left"';
13 if (preg_match('{ (\s alt="[^"]+") }x', $article->img, $img)) {
14 $imgattr .= $img[0]; # preserve alt value
16 printf('<img src="/%s"%s />', $article->thumb, $imgattr);
20 '<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
21 $article->link, $article->title, $article->date
25 print "</article>\n\n";
27 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 = (ltrim($Args, '/') ?: 'nieuws');
57 if (strpos($articles, '/') === FALSE) {
58 if (@$Place['view'] === 'toc') {
59 foreach (array_reverse(glob("$articles/2???")) as $page) {
60 $year = basename($page, '.html');
61 printf('<h3><a href="/%s">%s</a></h3>'."\n", $page, $year);
62 printtoc($page, 'gallery');
69 if (@$Place['view'] === 'toc') {
74 shownews($articles, @$Place['n'] ?: 5);