X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/882347cba815e99ba8e7ad28d077420aa986e7c5..d634e557c4fbdb23d054be46377da7cafb68d7f4:/nieuws/index.php?ds=inline diff --git a/nieuws/index.php b/nieuws/index.php index cc2a8bf..6ea68dc 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -1,28 +1,32 @@ 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 and $User->admin) { - print ''."\n"; +if ($User->admin("edit {$Page->handler}")) { + $Page->raw = ''."\n" . $Page->raw; } if ($page and !is_numeric($page)) { - $edit = $User && $User->admin ? htmlspecialchars(@$_GET['edit']) : NULL; - $article = new ArchiveArticle("$Page$Args.html"); - $Place['title'] = $edit ?: $article->title; - if ($article->file) { - $Place['description'] = $article->teaser; + $Page->meta['og:type'] = 'article'; + $edit = $User->admin("edit {$Page->link}") ? htmlspecialchars(@$_GET['edit']) : NULL; + if ($edit) { + $Page->title = $edit; + } + if ($Page->dateparts) { + $Page->place[1] = ' '.showdate($Page->dateparts).''; } - $Place[1] = ' '.$article->date.''; - print preg_replace('{(?<=