pdo(); $userId = $_SESSION['user_id'] ?? null; $error = ''; $search = trim((string)($_GET['q'] ?? '')); $communityCfg = require __DIR__ . '/../../../config/community.php'; $community = $pdo ? new \App\Community($pdo, $communityCfg) : null; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['action']) && $_POST['action'] === 'thread_create') { if (!$userId) { $error = 'Bitte einloggen, um Fragen zu stellen.'; } elseif ($community) { $title = trim((string)($_POST['title'] ?? '')); $body = trim((string)($_POST['body'] ?? '')); if ($title === '' || $body === '') { $error = 'Titel und Text sind erforderlich.'; } else { $community->createThread((int)$userId, $title, $body); redirect('/community'); } } } $threads = $community ? ($search !== '' ? $community->searchThreads($search, 50) : $community->listThreads(50)) : []; ?>

Community

Forum

Login für neue Frage
computePoints((int)$t['uid']) : 0.0; $lvl = $community ? $community->membershipLevel($pts) : ['label'=>'','icon'=>'']; ?>
( Punkte) Beiträge: Antworten:

200 ? '…' : '' ?>

Keine Treffer.