\n";
foreach (array_reverse($input) as $filename) {
$article = new ArchiveArticle($filename);
print '';
if ($article->thumb) {
$imgattr = ' class="left"';
if (preg_match('{ (\s alt="[^"]+") }x', $article->img, $img)) {
$imgattr .= $img[0]; # preserve alt value
}
printf('', $article->thumb, $imgattr);
}
print '';
printf(
'
',
$article->link, $article->title, showdate($article->dateparts)
);
print $article->story;
print '
';
print "\n\n";
if (--$limit <= 0) break;
}
print "\n";
}
function printtoc($input, $class = FALSE)
{
if (!is_array($input)) $input = glob("$input/*.html");
print '
';
foreach (array_reverse($input) as $page) {
$article = new ArchiveArticle($page);
$html = $article->safetitle;
$dateparts = $article->dateparts;
if ($class) {
$dateparts[0] = NULL; # omit year
}
$html .= sprintf(' %s', showdate($dateparts));
if ($class == 'gallery' and $article->img) {
$html = "$html
";
$html = sprintf('', $article->thumb(200)) . $html;
}
$html = sprintf('%s', $article->link, $html);
print "- $html
\n";
}
print "
\n";
}
}
$articles = $Page->place[0] ?? 'nieuws';
if (strpos($articles, '/') === FALSE) {
if (@$Page->place['view'] === 'toc') {
print "\n";
foreach (array_reverse(glob("$articles/2???")) as $page) {
$year = basename($page, '.html');
printf('
'."\n", $page, $year);
printtoc($page, 'gallery');
}
print "
\n";
return;
}
$articles .= '/????';
}
if (@$Page->place['view'] === 'toc') {
printtoc($articles);
return;
}
ob_start();
shownews($articles, @$Page->place['n'] ?: 5);
$Page->raw = ob_get_clean();
print $Page->render();