X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/a875a31121144d25bd59bb72aa2afd8a5565c853..ead5bed24e07383fbcf783c3b5c70a755dbc1982:/widget/reply.php diff --git a/widget/reply.php b/widget/reply.php index fd01a94..7e0ec1e 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()) { @@ -67,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 '