X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/76e9012a55abbbe190c2c97d25a17ec87426e687..218c239a4dc23c0dbe3878109c2f844d978ec626:/nieuws/index.php diff --git a/nieuws/index.php b/nieuws/index.php index 18416b3..1cbaf94 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -1,24 +1,32 @@ handler == 'melding' && $User->login; +@list ($year, $page) = explode('/', trim($Page->path, '/')); -if ($User and $User->admin) { - print ''."\n"; +if ($Page->api) { + 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 = $User && $User->admin ? htmlspecialchars(@$_GET['edit']) : NULL; + $Page->meta['og:type'] = 'article'; + $edit = $User->admin("edit {$Page->link}") ? htmlspecialchars(@$_GET['edit']) : NULL; if ($edit) { - $Article->title = $edit; + $Page->title = $edit; + } + if ($Page->dateparts) { + $Page->place[1] = ' '.showdate($Page->dateparts).''; } - if ($Article->file) { - $Place['description'] = $Article->teaser; + else { + $Page->place[1] = ''; } - $Place[1] = ' '.$Article->date.''; - print preg_replace('{(?<=