From f3fecfd7d223b9c5957a8797d7587eb16f9d6134 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 28 Nov 2025 17:49:50 +0000 Subject: [PATCH] v2 --- communities.php | 77 ------------------- conversation.php | 0 discussion.php | 12 +++ discussions.php | 12 +++ edit_discussion.php | 14 +++- edit_reply.php | 13 ++++ event.php | 12 +++ events.php | 12 +++ index.php | 17 ++++- manage_communities.php | 156 +++++++++++++++++++++++++++++++++++++ messages.php | 0 profile.php | 170 ----------------------------------------- proposal.php | 152 ------------------------------------ proposals.php | 161 -------------------------------------- temp_update.sh | 69 +++++++++++++++++ 15 files changed, 315 insertions(+), 562 deletions(-) create mode 100644 conversation.php create mode 100644 manage_communities.php create mode 100644 messages.php create mode 100644 temp_update.sh 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();