+++ /dev/null
-<?php
-global $User;
-require_once 'database.inc.php';
-
-print '<h3>Reacties</h3>'."\n";
-
-if ($_POST) {
- try {
- $html = nl2br(htmlspecialchars($_POST['reply']));
- $html = "<p>$html</p>";
- $query = $Db->insert('comments', [
- 'page' => $Page,
- 'message' => $html,
- 'author' => $User->login,
- ]);
- if (!$query->rowCount()) {
- throw new Exception('Fout bij opslaan');
- }
- $_POST['reply'] = NULL;
- }
- catch (Exception $e) {
- print '<p class=warn>Antwoord niet opgeslagen.</p>'."\n\n";
- }
-}
-
-$query = $Db->query('SELECT * FROM comments WHERE page = ? ORDER BY created', [$Page]);
-
-print '<ul class="replies">';
-
-while ($row = $query->fetch(PDO::FETCH_OBJ)) {
- $rowuser = new User("profile/{$row->author}");
- print '<li>';
- printf('<strong>%s</strong> <small class=date>%s</small>',
- $rowuser->html, showdate(preg_split('/\D/', $row->created))
- );
- printf("<blockquote>%s</blockquote>\n", $row->message);
- print "</li>\n";
-}
-
-print '<li>';
-print '<form method="post" action="">';
-printf('<textarea id="%s" name="%1$s" cols=60 rows=3 placeholder="%s">%s</textarea>'."\n",
- 'reply',
- "Bericht van {$User->login}",
- ''
-);
-print '<input type="submit" value="Plaatsen" />'."\n";
-print "</form></li>\n";
-
-print "</ul>\n\n";