From 1a9bcec664787509cfa7ac83a2570e7090add55a Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Mon, 3 Sep 2018 21:18:57 +0200 Subject: [PATCH] nieuws: placeholder include for user replies Same results from reusable nieuws/replies include. --- nieuws/index.php | 48 +--------------------------------------------- nieuws/replies.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 47 deletions(-) create mode 100644 nieuws/replies.php 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"; -- 2.30.0