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); print "

{$Article->title}

\n"; print "
\n"; print '
Geplaatst
'; printf('
%s
'."\n", showdate(preg_split('/\D/', $Issue->created))); if ($Issue->author and $author = new User('profile/'.$Issue->author, FALSE)) { printf('
%s
'."\n", $author->html); } if ($Issue->assign) { print '
Toegewezen aan
'; printf('
%s
'."\n", htmlspecialchars($Issue->assign)); } if ($Issue->closed) { print '
Opgelost
'; printf('
%s
'."\n", showdate(preg_split('/\D/', $Issue->closed))); } print "
\n\n"; print '
'; print $Issue->body; print $replies; print "
\n"; return; } if ($_POST) { require_once 'upload.inc.php'; $query = $Db->set('issues', [ 'page' => $Page, 'subject' => $_POST['subject'], 'body' => messagehtml($_POST['body']), 'author' => $User->login, ]); if (!$query->rowCount()) { throw new Exception('Issue niet opgeslagen.'); } $_POST = []; } $subsql = "SELECT count(*) FROM comments WHERE page=i.page||'/'||i.id"; $cols = "*, ($subsql AND message IS NOT NULL) AS replycount"; $cols .= ", ($subsql AND message ~ 'img') AS imagecount"; $sql = "SELECT $cols FROM issues i WHERE page = ?"; if (isset($_GET['open'])) { $sql .= ' AND closed IS NULL'; } $sql .= ' ORDER BY closed IS NOT NULL, updated DESC'; $query = $Db->query($sql, [$Page]); if ($id == 'feed') { require 'issue/feed.inc.php'; } ob_start(); print '\n"; $Place['issuelist'] = ob_get_clean();