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 '
';
while ($row = $query->fetch()) {
- printf('%s %s%s',
+ printf('
',
$row->closed ? ' class="disabled"' : '',
- "/$Page/{$row->id}/{$row->link}",
- sprintf($row->closed ? '%s' : '%s',
- htmlspecialchars($row->subject)),
- showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3)),
- implode(' ', [
- $row->replycount ? sprintf('+%d', $row->replycount) : '',
- isset($row->assign) ? ''.$row->assign.'' : '',
- ])
+ "/$Page/{$row->id}/{$row->link}"
);
- print " \n";
+ printf($row->closed ? '
%s' : '%s', htmlspecialchars($row->subject));
+ {
+ printf('
%s',
+ showdate(array_slice(preg_split('/\D/', $row->updated), 0, 3))
+ );
+ }
+ if ($row->imagecount) {
+ print '
📷';
+ }
+ if ($row->replycount) {
+ printf('
%s %d',
+ '',
+ $row->replycount
+ );
+ }
+ if (isset($row->assign)) {
+ print '
'.$row->assign.'';
+ }
+ print "
\n";
}
print "
\n";
$Place['issuelist'] = ob_get_clean();