link}?last=$newcomment#$newcomment"; abort($target, ($Page->api ? 200 : 303) . ' reply success'); $_POST['reply'] = NULL; } catch (Exception $e) { if ($Page->api) { abort(ucfirst($e->getMessage()), '500 reply error'); } printf("

Antwoord niet opgeslagen: %s.

\n\n", nl2br(htmlspecialchars($e->getMessage())) ); } } $cols = "*, (SELECT json_agg(journal.*) FROM journal WHERE comment_id = comments.id AND property = 'attr') AS journal"; $query = $Db->query("SELECT $cols FROM comments WHERE page = ? ORDER BY created", [$Page->link]); print '
'; $imagecount = 0; for ($i = 0; $row = $query->fetch(); $i++) { $rowuser = new User("profile/{$row->author}"); printf('
', $row->id); if ($i) { # subsequent reply header printf('%s', $rowuser->html); } else { $Page->teaser = $row->raw; } $rowdate = showdate(preg_split('/\D/', $row->created)); if ($User->admin('beheer')) { if ($row->updated) { $rowdate = "$rowdate " . showdate(preg_split('/\D/', $row->updated)); } if ($User->admin('user') || $User->login === $row->author) { $rowdate .= sprintf(' %s', "/{$Page->link}/{$row->id}", 'reactie aanpassen', "\u{270D}"); } } printf(' %s', $rowdate); if ($html = $row->message) { $html = preg_replace('/(?<= 2 ? 'loading="lazy" ' : '', $html, -1, $found); $imagecount += $found; if ($i) { $html = "
\n$html
\n"; } print $html; } if ($changes = json_decode($row->journal)) { print '\n"; } print "
\n"; } if ($User->login) { print '

'; print '
'; if (isset($Issue) and $User->admin("edit {$Page->link}")) { print "\n"; } { print '

'; printf( '' . "Geplaatste berichten zijn hier direct zichtbaar voor bewoners.\n" . '' . ''."\n", 'announce', '1', ($_POST['announce'] ?? TRUE) ? ' checked' : '', ' onclick="this.nextSibling.hidden = !this.checked"', "De eerste regel wordt ook weergegeven op het scherm in de hal." ); print "

\n"; } if (isset($Issue)) { printf( '

' . '

'."\n", 'image', 'Beeldmateriaal', ' type="file" accept="image/*"' ); } printf(''."\n", 'reply', "Bericht van {$User->login}", '' ); print ''."\n"; print "
"; print ''; print "
\n"; } print "
\n\n";