X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/2aeb3486d5598fec6a6b58c37abead5a829678ad..v5.0-26-g38cf6657d2:/widget/reply.php?ds=sidebyside diff --git a/widget/reply.php b/widget/reply.php index 53fe34f..0935567 100644 --- a/widget/reply.php +++ b/widget/reply.php @@ -7,11 +7,21 @@ $journalcol = [ ]; if ($_POST) { + require_once 'upload.inc.php'; try { - $html = nl2br(htmlspecialchars($_POST['reply'])); - $html = "
$html
"; + $html = messagehtml($_POST['reply']); + if ($_FILES and !empty($_FILES['image'])) { + $target = 'data/upload'; + if (!file_exists($target)) { + throw new Exception("er is geen uploadmap aanwezig op $target"); + } + $target .= '/' . $User->login; + if ($result = userupload($_FILES['image'], $target)) { + $html .= sprintf('Antwoord niet opgeslagen: {$e->getMessage()}.
\n\n"; } } $cols = '*, (SELECT json_agg(journal.*) FROM journal WHERE comment_id = comments.id) AS journal'; -$query = $Db->query("SELECT $cols FROM comments WHERE page = ? ORDER BY created", [$Page]); +$query = $Db->query("SELECT $cols FROM comments WHERE page = ? ORDER BY created", [$Page->link]); print '%s\n", $row->message); + printf("
\n%s\n", $row->message); if ($changes = json_decode($row->journal)) { print '
%2$s' : - (!isset($change->value) ? 'verwijderd (
%snaar
%s'), $change->old_value, $change->value ) @@ -92,10 +109,10 @@ while ($row = $query->fetch()) { print "