From: Mischa POSLAWSKY Date: Mon, 3 Sep 2018 20:58:19 +0000 (+0200) Subject: nieuws: toc view option to show headlines in placeholder X-Git-Tag: v3.7~6 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/df00ab2b9618c2ae1038c643b01b05d443368ee9 nieuws: toc view option to show headlines in placeholder Allows overview features to be specified by static templates, so pages can be dynamically customised. Track default html with all options enabled as before on melding. --- diff --git a/nieuws.php b/nieuws.php index 7127a54..2b0151d 100644 --- a/nieuws.php +++ b/nieuws.php @@ -2,8 +2,21 @@ include_once 'nieuws.inc.php'; $articles = (ltrim($Args, '/') ?: 'nieuws'); if (strpos($articles, '/') === FALSE) { + if (@$Place['view'] === 'toc') { + foreach (array_reverse(glob("$articles/2???")) as $page) { + $year = basename($page, '.html'); + printf('

%s

'."\n", $page, $year); + printtoc($page); + } + return; + } $articles .= '/????'; } + +if (@$Place['view'] === 'toc') { + printtoc($articles); + return; +} ob_start(); shownews($articles, @$Place['n'] ?: 5); print getoutput(); diff --git a/nieuws/index.html b/nieuws/index.html new file mode 100644 index 0000000..513237f --- /dev/null +++ b/nieuws/index.html @@ -0,0 +1,16 @@ + + +
+

Nieuwsarchief

+[[nieuws view=toc]] + +

Eerder

+[[nieuws view=toc nieuws/19??]] + +

Melding rapporteren

+[[contact subject=melding]] + +
+

+
+
diff --git a/nieuws/index.php b/nieuws/index.php index 468de28..b54d5bd 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -40,42 +40,6 @@ if ($year) { return 1; } -$html = ob_get_clean(); -printf(''."\n", - "/$Page/feed", - ' rel="alternate" title="Atom feed van nieuwsberichten" type="application/atom+xml"' -); -print $html; - -print '
'."\n\n"; - -foreach (array_reverse(glob("$Page/2???")) as $page) { - $year = basename($page, '.html'); - printf('

%s

'."\n", $page, $year); - printtoc($page); -} - -if ($pages = glob("$Page/19??/*.html")) { - printf('

%s

'."\n", "$Page/19", 'Eerder'); - printtoc($pages); -} - -print "
\n\n"; - -if ($replyform) { - print "

Melding rapporteren

\n"; - $_REQUEST['subject'] = 'melding'; - require 'contact.php'; -?> -
-

- - -

-
-'."\n"; }