From: Mischa POSLAWSKY Date: Thu, 24 Oct 2019 21:53:24 +0000 (+0200) Subject: issue: closed at bottom, option ?open to exclude X-Git-Tag: v4.2~30 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/3e188c002a26457a93ec3844bc6c7db3b0b23b10 issue: closed at bottom, option ?open to exclude --- diff --git a/issue/index.php b/issue/index.php index 6b1c3dc..abd9611 100644 --- a/issue/index.php +++ b/issue/index.php @@ -45,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 '