X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/dfe79667de45f0dfee4a57f4988ef7e2cb352d41..3a4f1ae1a32baa3658d54c3dadf268bab01308a2:/issue/index.php?ds=inline
diff --git a/issue/index.php b/issue/index.php
index 8f4ea8b..3f665db 100644
--- a/issue/index.php
+++ b/issue/index.php
@@ -5,13 +5,18 @@ require_once 'database.inc.php';
if ($id and ctype_digit($id)) {
$Article->title = "Issue #$id";
-
+ $Args = "/$id"; # minimal reference
$Issue = $Db->query(
'SELECT * FROM issues WHERE page = ? AND id = ?', [$Page, $id]
)->fetch();
if (!$Issue) throw new Exception('Issuenummer niet gevonden');
+ $replies = placeholder_include('reply'); # handle updates
+
$Article->title .= ': '.htmlspecialchars($Issue->subject);
+ $Article->teaser = $Issue->body;
+ $Article->body = $replies; # find image
+
print "
{$Article->title}
\n";
print "\n";
print '- Geplaatst
';
@@ -31,8 +36,7 @@ if ($id and ctype_digit($id)) {
print '';
print $Issue->body;
- $Args = "/$id"; # minimal reference
- print placeholder_include('reply');
+ print $replies;
print "
\n";
return;
}
@@ -51,8 +55,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 ~ '';
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();