title = "Issue #$id"; $Issue = $Db->query( 'SELECT * FROM issues WHERE page = ? AND id = ?', [$Page, $id] )->fetch(); if (!$Issue) throw new Exception('Issuenummer niet gevonden'); $Article->title .= ': '.htmlspecialchars($Issue->subject); print "

{$Article->title}

\n"; $author = $Issue->author ? new User('profile/'.$Issue->author, FALSE) : NULL; printf('

%s%s %s

'."\n", 'Geplaatst', $author ? " door {$author->name}" : '', showdate(preg_split('/\D/', $Issue->created)) ); if ($Issue->assign) { printf('

%s aan %s

'."\n", 'Toegewezen', htmlspecialchars($Issue->assign) ); } if ($Issue->closed) { printf('

%s%s %s

'."\n", 'Opgelost', '', showdate(preg_split('/\D/', $Issue->closed)) ); } print $Issue->body; $Args = "/$id"; # minimal reference print placeholder_include('reply'); return; } if ($_POST) { $html = nl2br(htmlspecialchars($_POST['body'])); $html = empty($html) ? NULL : "

$html

"; $query = $Db->set('issues', [ 'page' => $Page, 'subject' => $_POST['subject'], 'body' => $html, 'author' => $User->login, ]); if (!$query->rowCount()) { throw new Exception('Issue niet opgeslagen.'); } $_POST = []; } $cols = "*, (SELECT count(*) FROM comments WHERE" . " page=i.page||'/'||i.id AND message IS NOT NULL) AS replycount"; $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();