X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/e6d26c20628195fde6f3edfb31e5db8d31551adf..234326791b1e8177eb475bffc5956d7086cfac4e:/nieuws/index.php diff --git a/nieuws/index.php b/nieuws/index.php index 18f4466..23cfe4f 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -1,22 +1,23 @@ admin) { print ''."\n"; } if ($page and !is_numeric($page)) { - $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL; - $article = new ArchiveArticle("$Page$Args.html"); - $Place[1] = ' '.$article->date.''; + $edit = $User && $User->admin ? htmlspecialchars(@$_GET['edit']) : NULL; + $Place['title'] = $edit ?: $Article->title; + if ($Article->file) { + $Place['description'] = $Article->teaser; + } + $Place[1] = ' '.$Article->date.''; print preg_replace('{(?<=

)(.*?)(?=

)}', ($edit ?: '\1').' [[1]]', ob_get_clean()); - if ($article->file and $article->image) { - $Place['image'] = "https://lijtweg.nl/".$article->thumb('600x'); + if ($Article->file and $Article->image) { + $Place['image'] = "/".$Article->thumb('600x'); } - if (!empty($User['admin'])) { + if ($User and $User->admin) { $taglist = []; foreach (glob("$Page/.tags/*") as $tagpath) { $tagname = pathinfo($tagpath, PATHINFO_BASENAME); @@ -31,9 +32,11 @@ if ($page and !is_numeric($page)) { ucfirst($tagname) ); } - printf('

Tags: %s

'."\n", - implode("\n\t", $taglist) - ); + if ($taglist) { + printf('

Tags: %s

'."\n", + implode("\n\t", $taglist) + ); + } } if ($replyform) { print placeholder_include('nieuws/replies');