3 require_once 'database.inc.php';
4 @list ($id, $title) = explode('/', ltrim($Args, '/'));
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->name}</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 $html = nl2br(htmlspecialchars($_POST['body']));
41 $html = empty($html) ? NULL : "<p>$html</p>";
42 $query = $Db->set('issues', [
44 'subject' => $_POST['subject'],
46 'author' => $User->login,
48 if (!$query->rowCount()) {
49 throw new Exception('Issue niet opgeslagen.');
54 $sql = 'SELECT * FROM issues WHERE page = ?';
55 if (isset($_GET['open'])) {
56 $sql .= ' AND closed IS NULL';
58 $sql .= ' ORDER BY closed IS NOT NULL, updated DESC';
59 $query = $Db->query($sql, [$Page]);
63 while ($row = $query->fetch()) {
64 printf('<li><a href="%s">%s <small class="date">%s</small>%s</a>',
65 "/$Page/{$row->id}/{$row->link}",
66 sprintf($row->closed ? '<strike>%s</strike>' : '%s',
67 htmlspecialchars($row->subject)),
68 showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3)),
69 isset($row->assign) ? ' <em class="right">'.$row->assign.'</em>' : ''
74 $Place['issuelist'] = ob_get_clean();