nieuws: prepend article header to page title
[minimedit.git] / nieuws / index.php
index 18f44660d24312bf194fdeea9db70752d8070e96..d56758e55d7ca3c57f4dc2a4dbbe57e82486373a 100644 (file)
@@ -11,6 +11,7 @@ if (!empty($User['admin'])) {
 if ($page and !is_numeric($page)) {
        $edit = !empty($User['admin']) ? htmlspecialchars(@$_GET['edit']) : NULL;
        $article = new ArchiveArticle("$Page$Args.html");
+       $Place['title'] = $article->title;
        $Place[1] = ' <small class="date">'.$article->date.'</small>';
        print preg_replace('{(?<=<h2>)(.*?)(?=</h2>)}', ($edit ?: '\1').' [[1]]', ob_get_clean());
        if ($article->file and $article->image) {
@@ -31,9 +32,11 @@ if ($page and !is_numeric($page)) {
                                ucfirst($tagname)
                        );
                }
-               printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
-                       implode("\n\t", $taglist)
-               );
+               if ($taglist) {
+                       printf('<p class="tags"><strong>Tags:</strong> %s</p>'."\n",
+                               implode("\n\t", $taglist)
+                       );
+               }
        }
        if ($replyform) {
                print placeholder_include('nieuws/replies');