X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/845c98a6fa7ce005d3830548c042d77b68f7dc31..e2e6d4c1c37aff2e6b50331cb31af9d59536624f:/issue/index.php diff --git a/issue/index.php b/issue/index.php index 6e13b13..f950861 100644 --- a/issue/index.php +++ b/issue/index.php @@ -13,7 +13,6 @@ if ($id) { $Article->title .= ': '.htmlspecialchars($Issue->subject); print "

{$Article->title}

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

%s%s %s

'."\n", 'Geplaatst', @@ -31,6 +30,7 @@ if ($id) { showdate(preg_split('/\D/', $Issue->closed)) ); } + print $Issue->body; $Args = "/$id"; # minimal reference print placeholder_include('reply'); return; @@ -51,7 +51,9 @@ if ($_POST) { $_POST = []; } -$sql = 'SELECT * FROM issues WHERE page = ?'; +$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'; } @@ -61,11 +63,15 @@ $query = $Db->query($sql, [$Page]); ob_start(); print '