}
}
-function printtoc($input)
+function printtoc($input, $class = FALSE)
{
if (!is_array($input)) $input = glob("$input/*.html");
- print '<ul>';
+ print '<ul';
+ if ($class) printf(' class="%s"', $class);
+ print '>';
foreach (array_reverse($input) as $page) {
$article = new ArchiveArticle($page);
$html = $article->safetitle;
- $html .= sprintf(' <small class="date">%s</small>', $article->date);
+ $dateparts = $article->dateparts;
+ if ($class) {
+ $dateparts[1] = NULL; # omit year
+ }
+ $html .= sprintf(' <small class="date">%s</small>', showdate($dateparts));
+ if ($class == 'gallery' and $article->img) {
+ $html = "<div>$html</div>";
+ $html = sprintf('<img src="%s" />', $article->thumb(200)) . $html;
+ }
$html = sprintf('<a href="/%s">%s</a>', $article->link, $html);
print "<li><article>$html</article></li>\n";
}