X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/159ee0f3d812c9681a00c37f6a2bcaf8a1de83bc..bd940f48a9b1c6fb45aef4860d3f23b8094d5ba4:/widget/reply.php diff --git a/widget/reply.php b/widget/reply.php index 94018c4..edffaa7 100644 --- a/widget/reply.php +++ b/widget/reply.php @@ -9,9 +9,20 @@ $journalcol = [ if ($_POST) { require_once 'upload.inc.php'; try { + $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('

', $result); + } + } $query = $Db->set('comments', [ 'page' => $Page, - 'message' => messagehtml($_POST['reply']), + 'message' => $html, 'author' => $User->login, ]); if (!$query->rowCount()) { @@ -46,6 +57,7 @@ if ($_POST) { 'value' => $updated->$col, ]); } + $Issue = $updated; } } $_POST['reply'] = NULL; @@ -66,7 +78,7 @@ while ($row = $query->fetch()) { printf('%s %s', $rowuser->html, showdate(preg_split('/\D/', $row->created)) ); - printf("
%s
\n", $row->message); + printf("
\n%s
\n", $row->message); if ($changes = json_decode($row->journal)) { print '