X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/ec5417cab8b5b6227670a13d6a58e6e392fb7971..3b7350299c92ff6de3b7980791657de1f5269e48:/issue/index.php?ds=sidebyside diff --git a/issue/index.php b/issue/index.php index bb556f2..cc17f03 100644 --- a/issue/index.php +++ b/issue/index.php @@ -5,44 +5,48 @@ require_once 'database.inc.php'; if ($id and ctype_digit($id)) { $Article->title = "Issue #$id"; - + $Args = "/$id"; # minimal reference $Issue = $Db->query( 'SELECT * FROM issues WHERE page = ? AND id = ?', [$Page, $id] )->fetch(); if (!$Issue) throw new Exception('Issuenummer niet gevonden'); + $replies = placeholder_include('reply'); # handle updates + $Article->title .= ': '.htmlspecialchars($Issue->subject); + $Article->teaser = $Issue->body; + $Article->body = $replies; # find image + print "
%s%s %s
'."\n", - 'Geplaatst', - $author ? " door {$author->html}" : '', - showdate(preg_split('/\D/', $Issue->created)) - ); + print '\n\n"; + + print '$html
"; + require_once 'upload.inc.php'; $query = $Db->set('issues', [ 'page' => $Page, 'subject' => $_POST['subject'], - 'body' => $html, + 'body' => messagehtml($_POST['body']), 'author' => $User->login, ]); if (!$query->rowCount()) { @@ -51,8 +55,9 @@ if ($_POST) { $_POST = []; } -$cols = "*, (SELECT count(*) FROM comments WHERE" - . " page=i.page||'/'||i.id AND message IS NOT NULL) AS replycount"; +$subsql = "SELECT count(*) FROM comments WHERE page=i.page||'/'||i.id"; +$cols = "*, ($subsql AND message IS NOT NULL) AS replycount"; +$cols .= ", ($subsql AND message ~ ''; while ($row = $query->fetch()) { - printf('