%s %s %s',
intval($day), $monthname[intval($month)], $year);
}
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
',
getoutput([1 => ' '.$date.'']),
preg_replace('/\.html$/', '', $url)
);
return preg_replace('{(.*?)
}', $title, $html);
}
function shownews($root, $limit = 5)
{
foreach (array_reverse(glob("$root/*/*.html")) as $url) {
print "";
ob_start();
include $url;
print shownewsarticle($url);
print "\n\n";
if (--$limit <= 0) break;
}
}