+
+function printtoc($input)
+{
+ if (!is_array($input)) $input = glob("$input/*.html");
+ print '<ul>';
+ foreach (array_reverse($input) as $page) {
+ $title = fgets(fopen($page, 'r'));
+ $title = strip_tags($title);
+ $linkurl = preg_replace('/\.html$/', '', $page);
+ printf('<li><a href="/%s">%s <small class="date">%s</small></a></li>',
+ $linkurl, $title, shownewsdate($linkurl));
+ }
+ print "</ul>\n";
+}