nieuws: rename nieuws/replies widget to generic reply
[minimedit.git] / widget / nieuws / replies.php
diff --git a/widget/nieuws/replies.php b/widget/nieuws/replies.php
deleted file mode 100644 (file)
index cfa9487..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?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";