From: Mischa POSLAWSKY Date: Mon, 24 Jun 2019 14:56:41 +0000 (+0200) Subject: page: header metadata from article object X-Git-Tag: v4.0~18 X-Git-Url: http://git.shiar.nl/minimedit.git/commitdiff_plain/76e9012a55abbbe190c2c97d25a17ec87426e687 page: header metadata from article object --- diff --git a/foto/index.php b/foto/index.php index f438cb9..358ef94 100644 --- a/foto/index.php +++ b/foto/index.php @@ -19,7 +19,7 @@ if ($User and $User->admin) { $nav = explode('/', $rootdir); $nav[0] = "Foto's"; # override of root 'foto' $title = array_pop($nav); -$Place['title'] = implode(' ', $nav) . ': ' . $title; +$Article->title = implode(' ', $nav) . ': ' . $title; $link = ''; print "

"; @@ -79,7 +79,7 @@ if ($imgs = glob("$rootdir/*.jpg")) { foreach ($imgs as $img) { if ($img == "$rootdir/index.jpg") { # cover image of current album - $Place['image'] = "/thumb/640x/$img"; + $Article->image = "/$img"; continue; } if (!is_link($img)) continue; diff --git a/head.inc.php b/head.inc.php index 1e57e66..68ec4ca 100644 --- a/head.inc.php +++ b/head.inc.php @@ -2,16 +2,16 @@ - - <?= htmlspecialchars($Place['title']) ?> +title) { ?> + <?= htmlspecialchars($Article->safetitle) ?> - - +image) { ?> + diff --git a/login/emulate/index.php b/login/emulate/index.php index 9d76ebb..f7b59bc 100644 --- a/login/emulate/index.php +++ b/login/emulate/index.php @@ -12,7 +12,7 @@ catch (Exception $e) { $Place['login/name'] = $user->name ?: 'bewoner'; $Place['user'] = $user->login; -$Place['title'] = "Login {$user->login}"; +$Article->title = "Login {$user->login}"; if ( $password = trim(@file_get_contents("{$user->dir}/.passwd")) ) { if (substr($password, 0, 1) == '$') { $password = NULL; // hashed diff --git a/login/index.php b/login/index.php index 978709e..fc721b1 100644 --- a/login/index.php +++ b/login/index.php @@ -39,13 +39,13 @@ if (empty($User)) { ob_clean(); require_once 'login/form.inc.php'; $Place['warn'] = $message; - $Place['title'] = 'Inloggen'; + $Article->title = 'Inloggen'; if (isset($_REQUEST['goto'])) { $target = ltrim($_REQUEST['goto'], '/'); $target = new ArchiveArticle("$target.html"); if ($target->file) { if ($target->title) { - $Place['title'] .= ' voor ' . $target->title; + $Article->title .= ' voor ' . $target->title; } } } diff --git a/nieuws/index.php b/nieuws/index.php index 23cfe4f..18416b3 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -8,15 +8,14 @@ if ($User and $User->admin) { if ($page and !is_numeric($page)) { $edit = $User && $User->admin ? htmlspecialchars(@$_GET['edit']) : NULL; - $Place['title'] = $edit ?: $Article->title; + if ($edit) { + $Article->title = $edit; + } 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'] = "/".$Article->thumb('600x'); - } if ($User and $User->admin) { $taglist = []; foreach (glob("$Page/.tags/*") as $tagpath) {