nieuws: prepend article header to page title
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 27 Oct 2018 15:38:52 +0000 (17:38 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 27 Oct 2018 15:54:35 +0000 (17:54 +0200)
head.inc.php
nieuws/index.php

index 63621b5032a516273f5b8ca8a3b23c210fb30296..9e0cbd5e031b9b003abf4ef1ad209334bb1107ee 100644 (file)
@@ -2,6 +2,9 @@
 <html lang="nl">
 <head>
        <meta charset="utf-8">
+<?php if (!empty($Place['title'])) { ?>
+       <title><?= htmlspecialchars($Place['title']) ?></title>
+<?php } ?>
        <meta name="viewport" content="width=device-width">
        <!--[if lt IE 9]><script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script><![endif]-->
 <?php if (!empty($Place['image'])) { ?>
index 746baec4869bd6f7be2abe1223fefe78cb1a54bf..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) {