X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/bae682c87abd4a43231496979963a6bbb66ecc4e..d634e557c4fbdb23d054be46377da7cafb68d7f4:/nieuws/index.php diff --git a/nieuws/index.php b/nieuws/index.php index 7397357..6ea68dc 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -1,45 +1,58 @@ handler == 'melding' && $User->login; +@list ($year, $page) = explode('/', trim($Page->path, '/')); -$replyform = $Page == 'melding' && !empty($User); -@list ($year, $page) = explode('/', trim($Args, '/')); +if (!$User) { + if ($Page->path) return; + return (new PageSearch($Page->link))->files(); +} + +if ($User->admin("edit {$Page->handler}")) { + $Page->raw = ''."\n" . $Page->raw; +} if ($page and !is_numeric($page)) { - $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL; - $article = new ArchiveArticle("$Page$Args.html"); - $Place[1] = ' '.$article->date.''; - print preg_replace('{(?<=
Tags: %s
\n", - implode("\n\t", $taglist) - ); + if ($taglist) { + printf(' '."\n", + implode("\n\t", $taglist) + ); + } } if ($replyform) { - print placeholder_include('nieuws/replies'); + print $Page->widget('reply'); } - return 1; + return; } if ($year) { - ob_clean(); - $match = $Page; + $match = $Page->handler; $title = "Nieuws"; if (is_numeric($year) and $year > 999) { $match .= "/$year"; @@ -53,16 +66,12 @@ if ($year) { $match .= "/19??"; $title .= " vóór 2000"; } - elseif (file_exists("$Page/.tags/$year")) { + elseif (file_exists("{$Page->handler}/.tags/$year")) { $match .= "/.tags/$year"; $title .= " met $year"; } print "