pdo(); $userId = $_SESSION['user_id'] ?? null; $error = ''; $info = ''; $search = trim((string)($_GET['q'] ?? '')); $boardSlug = trim((string)($_GET['board'] ?? '')); $communityCfg = require __DIR__ . '/../../../config/community.php'; $community = $pdo ? new \App\Community($pdo, $communityCfg) : null; $access = $pdo ? new \App\CommunityAccess($pdo, $communityCfg) : null; $stats = $community ? $community->getStats() : ['threads' => 0, 'posts' => 0, 'members' => 0]; $forumCategories = $community ? $community->listForumCategories() : []; $selectedBoard = ($community && $boardSlug !== '') ? $community->getBoardBySlug($boardSlug) : null; $userRoles = $access && $userId ? $access->getUserRoles((int)$userId) : []; $isForumAdmin = $access && $userId ? $access->canModerateForum((int)$userId) : false; $canManageApplications = $access && $userId ? ($access->canManageApplications((int)$userId) && $access->supportsApplications()) : false; $canManageRoles = $access && $userId ? $access->canManageRoles((int)$userId) : false; if ($_SERVER['REQUEST_METHOD'] === 'POST' && $community && $access) { $action = (string)($_POST['action'] ?? ''); try { if ($action === 'thread_create') { if (!$userId) { throw new \RuntimeException('Bitte einloggen, um Themen zu erstellen.'); } if (!$access->canCreateThread((int)$userId)) { $state = $access->getRestrictionState((int)$userId); throw new \RuntimeException($state['reason'] ?: 'Du darfst aktuell keine Themen erstellen.'); } $community->createThreadInBoard((int)$userId, (string)($_POST['board_slug'] ?? ''), (string)($_POST['title'] ?? ''), (string)($_POST['body'] ?? '')); redirect('/community' . ($boardSlug !== '' ? '?board=' . rawurlencode($boardSlug) : '')); } elseif ($action === 'application_decide') { $access->decideApplication((int)$userId, (int)($_POST['application_id'] ?? 0), (string)($_POST['decision'] ?? ''), (string)($_POST['decision_reason'] ?? '')); $info = 'Bewerbung wurde bearbeitet.'; } elseif ($action === 'report_resolve') { $access->resolveReport((int)$userId, (int)($_POST['report_id'] ?? 0), (string)($_POST['moderator_note'] ?? '')); $info = 'Meldung wurde abgeschlossen.'; } elseif ($action === 'role_revoke') { $access->revokeRole((int)$userId, (int)($_POST['target_user_id'] ?? 0), (string)($_POST['role'] ?? '')); $info = 'Rolle wurde entzogen.'; } elseif ($action === 'restriction_set') { $access->setRestriction((int)$userId, (int)($_POST['target_user_id'] ?? 0), (string)($_POST['restriction_type'] ?? ''), (string)($_POST['reason'] ?? '')); $info = 'Community-Sperre wurde gesetzt.'; } elseif ($action === 'restriction_clear') { $access->clearRestriction((int)$userId, (int)($_POST['target_user_id'] ?? 0), (string)($_POST['restriction_type'] ?? '')); $info = 'Community-Sperre wurde aufgehoben.'; } } catch (\Throwable $e) { $error = $e->getMessage(); } } $threads = $community ? ($search !== '' ? $community->searchThreads($search, 50, $boardSlug !== '' ? $boardSlug : null) : $community->listThreads(50, $boardSlug !== '' ? $boardSlug : null)) : []; $applications = $canManageApplications && $access ? $access->listApplications('open') : []; $reports = $isForumAdmin && $access ? $access->listOpenReports() : []; $roleAssignments = $canManageRoles && $access ? $access->listRoleAssignments() : []; ?>
Home / Community /

Community

Fragen stellen, Erfahrungen teilen, Antworten finden und gemeinsam weiterdenken.

Themen
Beiträge

Themen: Beiträge:
Noch keine Themen
Thema Antworten Letzte Aktivität
computePoints((int)$t['uid']) : 0.0; $lvl = $community ? $community->membershipLevel($pts) : ['label'=>'','icon'=>'']; $preview = mb_substr((string)$t['body'], 0, 220); ?>

220 ? '…' : '' ?>

Antworten
Keine Themen gefunden.

Offene Bewerbungen

Bewerbungen ab Rang Community-Vater prüfen.

Keine offenen Bewerbungen.
supportsReports()): ?>

Offene Meldungen

Gemeldete Inhalte prüfen und moderieren.

#

Gemeldet von am

Keine offenen Meldungen.
hasModerationTables()): ?>

Rollenübersicht

Vergebene Community-Rollen im Blick behalten.

Rolle: · seit

Keine Rollen vergeben.