diff --git a/communities.php b/communities.php index 5d8e791..e69de29 100644 --- a/communities.php +++ b/communities.php @@ -1,77 +0,0 @@ - -query('SELECT * FROM communities ORDER BY name'); -$communities = $stmt->fetchAll(); - -?> - - - - - - Communities - Community Hub - - - - - - - - -
-
-

Welcome to the Communities Page

-
- -
-
-
-
-

Explore and engage with your local community.

- -
-
-
- -
-
-
- - - - - - - - \ No newline at end of file diff --git a/conversation.php b/conversation.php new file mode 100644 index 0000000..e69de29 diff --git a/discussion.php b/discussion.php index 015c30c..13b461c 100644 --- a/discussion.php +++ b/discussion.php @@ -8,6 +8,15 @@ if (!isset($_SESSION['user_id'])) { exit; } +// Fetch user role if logged in +$user_role = null; +if (isset($_SESSION['user_id'])) { + $pdo = db(); + $stmt = $pdo->prepare('SELECT role FROM users WHERE id = ?'); + $stmt->execute([$_SESSION['user_id']]); + $user_role = $stmt->fetchColumn(); +} + if (!isset($_GET['id'])) { header('Location: communities.php'); exit; @@ -82,6 +91,9 @@ $replies = $stmt->fetchAll();