diff --git a/partials/landing/main/home.php b/partials/landing/main/home.php index 31fa730..dec6bad 100755 --- a/partials/landing/main/home.php +++ b/partials/landing/main/home.php @@ -3,6 +3,7 @@ $app = app(); $flash = $app->flash()->get(); $eventsForJs = []; +$threadsForJs = []; try { $pdo = $app->pdo(); if ($pdo) { @@ -29,9 +30,24 @@ try { 'lng' => $r['lng'] !== null ? (float)$r['lng'] : null, ]; } + + $communityCfg = require __DIR__ . '/../../../config/community.php'; + $community = new \App\Community($pdo, $communityCfg); + $threads = $community->listThreads(8); + foreach ($threads as $thread) { + $threadsForJs[] = [ + 'id' => (int)$thread['id'], + 'title' => (string)$thread['title'], + 'body' => (string)$thread['body'], + 'displayName' => (string)($thread['display_name'] ?: 'Mitglied'), + 'createdAt' => (string)$thread['created_at'], + 'answers' => (int)$thread['answers'], + ]; + } } } catch (Throwable $e) { $eventsForJs = []; + $threadsForJs = []; } ?>
@@ -110,6 +126,21 @@ try { +
+
+
+

Tausch dich in der Community aus

+
+
+ +
+
+
+ +
+
+
+
@@ -146,6 +177,7 @@ try {