', $url, $parts)) return; global $monthname; return implode(' ', array_filter([ intval($parts[3]), $parts[2] > 0 ? $monthname[intval($parts[2])] : '', $parts[1], ])); } function shownewsarticle($url, $link = TRUE, $title = NULL) { $html = ob_get_clean(); $date = shownewsdate($url); ob_start(); print $title ?: '\1'; print '[[1]]'; $title = sprintf( $link ? '

%s

' : '

%s

', getoutput([1 => ' '.$date.'']), preg_replace('/\.html$/', '', $url) ); return preg_replace('{

(.*?)

}', $title, $html); } function shownews($root, $limit = 5) { if (strpos($root, '/') === FALSE) $root .= '/*'; foreach (array_reverse(glob("$root/*.html")) as $url) { print "
"; ob_start(); include $url; print shownewsarticle($url); print "
\n\n"; if (--$limit <= 0) break; } } function printtoc($root) { print '\n"; }