X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/c824b14c0f6fb372ca4e72fe244b3aade6c29541..084f4a795fb5874eecd7b17b3999f716432ad41c:/issue/index.php diff --git a/issue/index.php b/issue/index.php index 2c50624..10efc5e 100644 --- a/issue/index.php +++ b/issue/index.php @@ -14,9 +14,15 @@ if ($id) { $Article->title .= ': '.htmlspecialchars($row->subject); print "

{$Article->title}

\n"; print $row->body; + printf('

%s%s %s

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

%s %s

'."\n", - 'Opgelost', showdate(preg_split('/\D/', $row->closed)) + printf('

%s%s %s

'."\n", + 'Opgelost', '', + showdate(preg_split('/\D/', $row->closed)) ); } $Args = "/$id"; # minimal reference @@ -27,7 +33,7 @@ if ($id) { if ($_POST) { $html = nl2br(htmlspecialchars($_POST['body'])); $html = empty($html) ? NULL : "

$html

"; - $query = $Db->insert('issues', [ + $query = $Db->set('issues', [ 'page' => $Page, 'subject' => $_POST['subject'], 'body' => $html, @@ -39,7 +45,12 @@ if ($_POST) { $_POST = []; } -$query = $Db->query('SELECT * FROM issues ORDER BY updated DESC'); +$sql = 'SELECT * FROM issues'; +if (isset($_GET['open'])) { + $sql .= ' WHERE closed IS NULL'; +} +$sql .= ' ORDER BY closed IS NOT NULL, updated DESC'; +$query = $Db->query($sql); ob_start(); print '