X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/a875a31121144d25bd59bb72aa2afd8a5565c853..180e9830307c556340816c53b29e543c697b9cf8:/issue/index.php diff --git a/issue/index.php b/issue/index.php index cefe00f..332179e 100644 --- a/issue/index.php +++ b/issue/index.php @@ -52,8 +52,9 @@ if ($_POST) { $_POST = []; } -$cols = "*, (SELECT count(*) FROM comments WHERE" - . " page=i.page||'/'||i.id AND message IS NOT NULL) AS replycount"; +$subsql = "SELECT count(*) FROM comments WHERE page=i.page||'/'||i.id"; +$cols = "*, ($subsql AND message IS NOT NULL) AS replycount"; +$cols .= ", ($subsql AND message ~ 'img') AS imagecount"; $sql = "SELECT $cols FROM issues i WHERE page = ?"; if (isset($_GET['open'])) { $sql .= ' AND closed IS NULL'; @@ -68,18 +69,29 @@ if ($id == 'feed') { ob_start(); print '\n"; $Place['issuelist'] = ob_get_clean();