-if ($Args) {
- $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
- print shownewsarticle($Args, FALSE, $edit);
- return;
+if (!function_exists('shownews')) {
+function shownews($input, $limit = 1000)
+{
+ if (!is_array($input)) $input = glob("$input/*.html");
+ foreach (array_reverse($input) as $filename) {
+ $article = new ArchiveArticle($filename);
+ print '<article class="left">';
+ if ($article->thumb) {
+ $imgattr = ' class="left"';
+ if (preg_match('{ (\s alt="[^"]+") }x', $article->img, $img)) {
+ $imgattr .= $img[0]; # preserve alt value
+ }
+ printf('<img src="/%s"%s />', $article->thumb, $imgattr);
+ }
+ print '<div>';
+ printf(
+ '<h3><a href="/%s">%s <small class="date">%s</small></a></h3>',
+ $article->link, $article->title, $article->date
+ );
+ print $article->body;
+ print '</div>';
+ print "</article>\n\n";
+
+ if (--$limit <= 0) break;
+ }