query( "SELECT g.id, g.filename, g.caption, g.moderation_note, g.created_at, g.user_id, $name AS author FROM member_gallery g JOIN users u ON u.id = g.user_id WHERE g.status = 'pending' ORDER BY g.created_at" )->fetchAll(); $pendingComments = $pdo->query( "SELECT c.id, c.body, c.moderation_note, c.created_at, c.author_id, c.gallery_id, g.filename, $name AS author FROM gallery_comments c JOIN users u ON u.id = c.author_id JOIN member_gallery g ON g.id = c.gallery_id WHERE c.status = 'pending' ORDER BY c.created_at" )->fetchAll(); // Gemeldet, aber (noch) sichtbar - unter der Schwelle fuers automatische Ausblenden $reportedPictures = $pdo->query( "SELECT g.id, g.filename, g.caption, g.created_at, g.user_id, $name AS author FROM member_gallery g JOIN users u ON u.id = g.user_id WHERE g.status = 'visible' AND EXISTS (SELECT 1 FROM content_reports r WHERE r.content_type = 'picture' AND r.content_id = g.id)" )->fetchAll(); $reportedComments = $pdo->query( "SELECT c.id, c.body, c.created_at, c.author_id, c.gallery_id, g.filename, $name AS author FROM gallery_comments c JOIN users u ON u.id = c.author_id JOIN member_gallery g ON g.id = c.gallery_id WHERE c.status = 'visible' AND EXISTS (SELECT 1 FROM content_reports r WHERE r.content_type = 'comment' AND r.content_id = c.id)" )->fetchAll(); // Alle Meldungen mit Grund und Melder, gruppiert nach Inhalt $reports = []; foreach ($pdo->query( "SELECT r.content_type, r.content_id, r.reason, r.created_at, $name AS reporter FROM content_reports r JOIN users u ON u.id = r.reporter_id ORDER BY r.created_at" )->fetchAll() as $row) { $reports[$row['content_type'] . ':' . $row['content_id']][] = $row; } $pendingTotal = count($pendingPictures) + count($pendingComments); $reportedTotal = count($reportedPictures) + count($reportedComments); /** Knoepfe fuer einen Inhalt. */ $actions = static function (string $type, int $id, array $which): string { $labels = [ 'approve' => ['Freigeben', 'button-success'], 'hide' => ['Ausblenden', 'button-secondary'], 'dismiss' => ['Meldungen verwerfen', 'button-secondary'], 'delete' => ['Löschen', 'button-danger'], ]; $html = '
'; foreach ($which as $action) { [$label, $class] = $labels[$action]; $confirm = $action === 'delete' ? ' onsubmit="return confirm("Endgültig löschen?");"' : ''; $html .= '
' . csrf_field() . '' . '' . '
'; } return $html . '
'; }; /** Meldungen zu einem Inhalt als kleine Liste. */ $reportList = static function (string $type, int $id) use ($reports): string { $list = $reports[$type . ':' . $id] ?? []; if (!$list) { return ''; } $html = ''; }; $pageTitle = 'Moderation'; $containerWide = true; include __DIR__ . '/includes/header.php'; ?>

Moderation

Bilder und Kommentare neuer Mitglieder (erste Tage), Beiträge mit Links und alles, was -mal gemeldet wurde, warten hier auf eine Entscheidung. Bis dahin sieht sie nur der Verfasser. Alle Entscheidungen landen im Audit-Log.

Wartet auf Freigabe

Alles erledigt - nichts wartet auf Freigabe. 🎉

Bild

Grund:

Kommentar

Grund:

0): ?>

Gemeldet, aber noch sichtbar

Weniger als Meldungen - noch nicht automatisch ausgeblendet.

Bild
Kommentar