3 require_once 'database.inc.php';
4 @list ($id, $title) = explode('/', ltrim($Args, '/'));
6 if ($id and ctype_digit($id)) {
7 $Article->title = "Issue #$id";
10 'SELECT * FROM issues WHERE page = ? AND id = ?', [$Page, $id]
12 if (!$Issue) throw new Exception('Issuenummer niet gevonden');
14 $Article->title .= ': '.htmlspecialchars($Issue->subject);
15 print "<h2>{$Article->title}</h2>\n";
16 $author = $Issue->author ? new User('profile/'.$Issue->author, FALSE) : NULL;
17 printf('<p><em>%s</em>%s <small class=date>%s</small></p>'."\n",
19 $author ? " door <strong>{$author->html}</strong>" : '',
20 showdate(preg_split('/\D/', $Issue->created))
23 printf('<p><em>%s</em> aan <strong>%s</strong></p>'."\n",
24 'Toegewezen', htmlspecialchars($Issue->assign)
28 printf('<p><em>%s</em>%s <small class=date>%s</small></p>'."\n",
30 showdate(preg_split('/\D/', $Issue->closed))
34 $Args = "/$id"; # minimal reference
35 print placeholder_include('reply');
40 require_once 'upload.inc.php';
41 $query = $Db->set('issues', [
43 'subject' => $_POST['subject'],
44 'body' => messagehtml($_POST['body']),
45 'author' => $User->login,
47 if (!$query->rowCount()) {
48 throw new Exception('Issue niet opgeslagen.');
53 $cols = "*, (SELECT count(*) FROM comments WHERE"
54 . " page=i.page||'/'||i.id AND message IS NOT NULL) AS replycount";
55 $sql = "SELECT $cols FROM issues i WHERE page = ?";
56 if (isset($_GET['open'])) {
57 $sql .= ' AND closed IS NULL';
59 $sql .= ' ORDER BY closed IS NOT NULL, updated DESC';
60 $query = $Db->query($sql, [$Page]);
63 require 'issue/feed.inc.php';
68 while ($row = $query->fetch()) {
69 printf('<li%s><a href="%s">%s <small class="date">%s</small>%s</a>',
70 $row->closed ? ' class="disabled"' : '',
71 "/$Page/{$row->id}/{$row->link}",
72 sprintf($row->closed ? '<s>%s</s>' : '%s',
73 htmlspecialchars($row->subject)),
74 showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3)),
76 $row->replycount ? sprintf('<span class=right>+%d</span>', $row->replycount) : '',
77 isset($row->assign) ? '<em class="right">'.$row->assign.'</em>' : '',
83 $Place['issuelist'] = ob_get_clean();