From: Mischa POSLAWSKY Date: Mon, 3 Sep 2018 19:18:57 +0000 (+0200) Subject: nieuws: placeholder include for user replies X-Git-Tag: v3.7~11 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/1a9bcec664787509cfa7ac83a2570e7090add55a nieuws: placeholder include for user replies Same results from reusable nieuws/replies include. --- diff --git a/nieuws/index.php b/nieuws/index.php index 678c3db..cdb3892 100644 --- a/nieuws/index.php +++ b/nieuws/index.php @@ -12,55 +12,9 @@ if ($page and !is_numeric($page)) { if ($article->image) { $Place['image'] = "https://lijtweg.nl/".$article->thumb('600x'); } - if ($replyform) { - print '

Reacties

'."\n"; - $pagelink = $Page.$Args; - - if ($_POST) { - try { - @mkdir($pagelink); - $target = $pagelink.'/'.date('YmdHis').':'.$User['name'].'.txt'; - $written = file_put_contents($target, $_POST['reply']); - if ($written === FALSE) { - throw new Exception('Fout bij opslaan'); - } - $_POST['reply'] = NULL; - } - catch (Exception $e) { - print '

Antwoord niet opgeslagen.

'."\n\n"; - } - } - - print '\n\n"; + include 'nieuws/replies.php'; } - return 1; } diff --git a/nieuws/replies.php b/nieuws/replies.php new file mode 100644 index 0000000..b6285b1 --- /dev/null +++ b/nieuws/replies.php @@ -0,0 +1,48 @@ +Reacties'."\n"; +$pagelink = $Page.$Args; + +if ($_POST) { + try { + @mkdir($pagelink); + $target = $pagelink.'/'.date('YmdHis').':'.$User['name'].'.txt'; + $written = file_put_contents($target, $_POST['reply']); + if ($written === FALSE) { + throw new Exception('Fout bij opslaan'); + } + $_POST['reply'] = NULL; + } + catch (Exception $e) { + print '

Antwoord niet opgeslagen.

'."\n\n"; + } +} + +print '\n\n";