From 34236e997976488dfa419e3eb478cb7e505eec63 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 3 Oct 2025 03:24:30 +0000 Subject: [PATCH] 1.0.0 --- auth.php | 201 ++++++++++++++++++ courses.php | 52 +++++ dashboard.php | 21 ++ db/migrate.php | 41 ++++ db/migrations/001_create_users_table.sql | 8 + .../002_add_profile_fields_to_users.sql | 5 + db/migrations/003_create_courses_table.sql | 9 + db/migrations/004_add_features_tables.sql | 59 +++++ db/seeds/seed_courses.php | 77 +++++++ db/seeds/seed_forums.php | 44 ++++ disclaimer.php | 26 +++ forum.php | 71 +++++++ forums.php | 35 +++ index.php | 158 +++++--------- login.php | 22 ++ privacy_policy.php | 30 +++ profile.php | 62 ++++++ register.php | 26 +++ templates/footer.php | 53 +++++ templates/header.php | 139 ++++++++++++ terms_of_service.php | 30 +++ thread.php | 77 +++++++ 22 files changed, 1145 insertions(+), 101 deletions(-) create mode 100644 auth.php create mode 100644 courses.php create mode 100644 dashboard.php create mode 100644 db/migrate.php create mode 100644 db/migrations/001_create_users_table.sql create mode 100644 db/migrations/002_add_profile_fields_to_users.sql create mode 100644 db/migrations/003_create_courses_table.sql create mode 100644 db/migrations/004_add_features_tables.sql create mode 100644 db/seeds/seed_courses.php create mode 100644 db/seeds/seed_forums.php create mode 100644 disclaimer.php create mode 100644 forum.php create mode 100644 forums.php create mode 100644 login.php create mode 100644 privacy_policy.php create mode 100644 profile.php create mode 100644 register.php create mode 100644 templates/footer.php create mode 100644 templates/header.php create mode 100644 terms_of_service.php create mode 100644 thread.php diff --git a/auth.php b/auth.php new file mode 100644 index 0000000..d1f2404 --- /dev/null +++ b/auth.php @@ -0,0 +1,201 @@ +prepare("UPDATE users SET name = ?, email = ?, bio = ?, skills = ?, interests = ?, goals = ? WHERE id = ?"); + $stmt->execute([$name, $email, $bio, $skills, $interests, $goals, $user_id]); + + $_SESSION['user_name'] = $name; // Update session name + + header('Location: profile.php?success=1'); + exit; + } catch (PDOException $e) { + die("Profile update failed: " . $e->getMessage()); + } +} + +function handle_register() { + if ($_SERVER['REQUEST_METHOD'] !== 'POST') { + header('Location: register.php'); + exit; + } + + $name = $_POST['name'] ?? ''; + $email = $_POST['email'] ?? ''; + $password = $_POST['password'] ?? ''; + + if (empty($name) || empty($email) || empty($password)) { + die('Please fill all fields'); + } + + $hashed_password = password_hash($password, PASSWORD_DEFAULT); + + try { + $pdo = db(); + $stmt = $pdo->prepare("INSERT INTO users (name, email, password) VALUES (?, ?, ?)"); + $stmt->execute([$name, $email, $hashed_password]); + header('Location: login.php'); + exit; + } catch (PDOException $e) { + die("Registration failed: " . $e->getMessage()); + } +} + +function handle_login() { + if ($_SERVER['REQUEST_METHOD'] !== 'POST') { + header('Location: login.php'); + exit; + } + + $email = $_POST['email'] ?? ''; + $password = $_POST['password'] ?? ''; + + if (empty($email) || empty($password)) { + die('Please fill all fields'); + } + + try { + $pdo = db(); + $stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?"); + $stmt->execute([$email]); + $user = $stmt->fetch(); + + if ($user && password_verify($password, $user['password'])) { + $_SESSION['user_id'] = $user['id']; + $_SESSION['user_name'] = $user['name']; + $_SESSION['user_role'] = $user['role']; + header('Location: dashboard.php'); + exit; + } else { + die('Invalid login'); + } + } catch (PDOException $e) { + die("Login failed: " . $e->getMessage()); + } +} + +function handle_logout() { + session_destroy(); + header('Location: index.php'); + exit; +} + +function handle_create_thread() { + if ($_SERVER['REQUEST_METHOD'] !== 'POST') { + header('Location: forums.php'); + exit; + } + + if (!isset($_SESSION['user_id'])) { + header('Location: login.php'); + exit; + } + + $forum_id = $_POST['forum_id'] ?? null; + $title = $_POST['title'] ?? ''; + $user_id = $_SESSION['user_id']; + + if (empty($forum_id) || empty($title)) { + // Or redirect with an error message + die('Forum ID and Title are required.'); + } + + try { + $pdo = db(); + $stmt = $pdo->prepare("INSERT INTO discussion_threads (forum_id, user_id, title) VALUES (?, ?, ?)"); + $stmt->execute([$forum_id, $user_id, $title]); + + $new_thread_id = $pdo->lastInsertId(); + + // Redirect to the new thread page + header('Location: thread.php?id=' . $new_thread_id); + exit; + } catch (PDOException $e) { + die("Failed to create thread: " . $e->getMessage()); + } +} + +function handle_create_post() { + if ($_SERVER['REQUEST_METHOD'] !== 'POST') { + header('Location: forums.php'); + exit; + } + + if (!isset($_SESSION['user_id'])) { + header('Location: login.php'); + exit; + } + + $thread_id = $_POST['thread_id'] ?? null; + $content = $_POST['content'] ?? ''; + $user_id = $_SESSION['user_id']; + + if (empty($thread_id) || empty($content)) { + // Redirect back to the thread with an error + header('Location: thread.php?id=' . $thread_id . '&error=1'); + exit; + } + + try { + $pdo = db(); + $stmt = $pdo->prepare("INSERT INTO discussion_posts (thread_id, user_id, content) VALUES (?, ?, ?)"); + $stmt->execute([$thread_id, $user_id, $content]); + + // Redirect back to the thread page + header('Location: thread.php?id=' . $thread_id); + exit; + } catch (PDOException $e) { + die("Failed to create post: " . $e->getMessage()); + } +} diff --git a/courses.php b/courses.php new file mode 100644 index 0000000..e6d2361 --- /dev/null +++ b/courses.php @@ -0,0 +1,52 @@ +query('SELECT * FROM courses ORDER BY created_at DESC'); +$courses = $stmt->fetchAll(); + +?> + +
+

Courses

+ + +
No courses available yet.
+ +
+ +
+
+
+
+
+ + + Premium + + Free + +
+

+ +
+ +

$

+ + View Course +
+
+
+
+ +
+ +
+ + diff --git a/dashboard.php b/dashboard.php new file mode 100644 index 0000000..ace45fc --- /dev/null +++ b/dashboard.php @@ -0,0 +1,21 @@ + + +
+

Dashboard

+

Welcome, !

+

Your role is:

+ Logout +
+ + diff --git a/db/migrate.php b/db/migrate.php new file mode 100644 index 0000000..b1f6784 --- /dev/null +++ b/db/migrate.php @@ -0,0 +1,41 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // Create migrations table if it doesn't exist + $pdo->exec("CREATE TABLE IF NOT EXISTS `migrations` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `migration` VARCHAR(255) NOT NULL, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"); + + // Get all run migrations + $stmt = $pdo->query("SELECT `migration` FROM `migrations`"); + $run_migrations = $stmt->fetchAll(PDO::FETCH_COLUMN); + + // Get all migration files + $migration_files = glob(__DIR__ . '/migrations/*.sql'); + sort($migration_files); + + foreach ($migration_files as $file) { + $migration_name = basename($file); + if (!in_array($migration_name, $run_migrations)) { + echo "Running migration: {$migration_name}...\n"; + $sql = file_get_contents($file); + $pdo->exec($sql); + + $stmt = $pdo->prepare("INSERT INTO `migrations` (`migration`) VALUES (?)"); + $stmt->execute([$migration_name]); + echo "Success: {$migration_name} migrated.\n"; + } + } + + echo "All migrations have been run.\n"; + +} catch (PDOException $e) { + die("Migration failed: " . $e->getMessage()); +} + diff --git a/db/migrations/001_create_users_table.sql b/db/migrations/001_create_users_table.sql new file mode 100644 index 0000000..5ba57d3 --- /dev/null +++ b/db/migrations/001_create_users_table.sql @@ -0,0 +1,8 @@ +CREATE TABLE IF NOT EXISTS users ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + email VARCHAR(255) NOT NULL UNIQUE, + password VARCHAR(255) NOT NULL, + role ENUM('student', 'instructor', 'admin') NOT NULL DEFAULT 'student', + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); diff --git a/db/migrations/002_add_profile_fields_to_users.sql b/db/migrations/002_add_profile_fields_to_users.sql new file mode 100644 index 0000000..f51212c --- /dev/null +++ b/db/migrations/002_add_profile_fields_to_users.sql @@ -0,0 +1,5 @@ +ALTER TABLE `users` +ADD COLUMN `bio` TEXT DEFAULT NULL, +ADD COLUMN `skills` VARCHAR(255) DEFAULT NULL, +ADD COLUMN `interests` VARCHAR(255) DEFAULT NULL, +ADD COLUMN `goals` TEXT DEFAULT NULL; diff --git a/db/migrations/003_create_courses_table.sql b/db/migrations/003_create_courses_table.sql new file mode 100644 index 0000000..aad4c1f --- /dev/null +++ b/db/migrations/003_create_courses_table.sql @@ -0,0 +1,9 @@ +CREATE TABLE IF NOT EXISTS `courses` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `title` VARCHAR(255) NOT NULL, + `description` TEXT NOT NULL, + `instructor_id` INT, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + FOREIGN KEY (`instructor_id`) REFERENCES `users`(`id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; \ No newline at end of file diff --git a/db/migrations/004_add_features_tables.sql b/db/migrations/004_add_features_tables.sql new file mode 100644 index 0000000..c4402bb --- /dev/null +++ b/db/migrations/004_add_features_tables.sql @@ -0,0 +1,59 @@ +-- Monetization & Content Strategy +ALTER TABLE `courses` +ADD COLUMN `tier` ENUM('free', 'premium') NOT NULL DEFAULT 'free' AFTER `description`, +ADD COLUMN `price` DECIMAL(10, 2) DEFAULT NULL AFTER `tier`, +ADD COLUMN `type` ENUM('course', 'micro-lesson') NOT NULL DEFAULT 'course' AFTER `price`; + +-- Scalability & Compliance +ALTER TABLE `users` +ADD COLUMN `language` VARCHAR(5) NOT NULL DEFAULT 'en' AFTER `email`, +ADD COLUMN `parental_controls_enabled` BOOLEAN NOT NULL DEFAULT FALSE AFTER `language`; + +-- Community & Engagement: Gamification +CREATE TABLE IF NOT EXISTS `badges` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `name` VARCHAR(255) NOT NULL, + `description` TEXT, + `icon` VARCHAR(255) -- e.g., path to an image or a font-awesome class +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `user_badges` ( + `user_id` INT NOT NULL, + `badge_id` INT NOT NULL, + `awarded_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`user_id`, `badge_id`), + FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE, + FOREIGN KEY (`badge_id`) REFERENCES `badges`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +-- Community & Engagement: Discussion Boards +CREATE TABLE IF NOT EXISTS `discussion_forums` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `course_id` INT DEFAULT NULL, -- Can be null for general forums + `title` VARCHAR(255) NOT NULL, + `description` TEXT, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (`course_id`) REFERENCES `courses`(`id`) ON DELETE SET NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `discussion_threads` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `forum_id` INT NOT NULL, + `user_id` INT NOT NULL, + `title` VARCHAR(255) NOT NULL, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (`forum_id`) REFERENCES `discussion_forums`(`id`) ON DELETE CASCADE, + FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE IF NOT EXISTS `discussion_posts` ( + `id` INT AUTO_INCREMENT PRIMARY KEY, + `thread_id` INT NOT NULL, + `user_id` INT NOT NULL, + `parent_post_id` INT DEFAULT NULL, -- For replies + `content` TEXT NOT NULL, + `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + FOREIGN KEY (`thread_id`) REFERENCES `discussion_threads`(`id`) ON DELETE CASCADE, + FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON DELETE CASCADE, + FOREIGN KEY (`parent_post_id`) REFERENCES `discussion_posts`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/db/seeds/seed_courses.php b/db/seeds/seed_courses.php new file mode 100644 index 0000000..eb59245 --- /dev/null +++ b/db/seeds/seed_courses.php @@ -0,0 +1,77 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // Temporarily disable foreign key checks to truncate the table + $pdo->exec("SET FOREIGN_KEY_CHECKS=0;"); + $pdo->exec("TRUNCATE TABLE courses"); + $pdo->exec("SET FOREIGN_KEY_CHECKS=1;"); + + $courses = [ + [ + 'title' => 'Introduction to PHP', + 'description' => 'Learn the fundamentals of PHP, the most popular server-side scripting language.', + 'tier' => 'free', + 'price' => null, + 'type' => 'course', + 'instructor_id' => null // No instructor assigned yet + ], + [ + 'title' => 'Advanced MySQL', + 'description' => 'Master advanced MySQL concepts like indexing, transactions, and stored procedures.', + 'tier' => 'premium', + 'price' => '99.99', + 'type' => 'course', + 'instructor_id' => null + ], + [ + 'title' => 'JavaScript for Beginners', + 'description' => 'Get started with JavaScript, the language of the web.', + 'tier' => 'free', + 'price' => null, + 'type' => 'course', + 'instructor_id' => null + ], + [ + 'title' => 'Quick CSS Flexbox', + 'description' => 'A 25-minute dive into the essentials of CSS Flexbox for modern layouts.', + 'tier' => 'free', + 'price' => null, + 'type' => 'micro-lesson', + 'instructor_id' => null + ], + [ + 'title' => 'The Complete Forex Trading Course', + 'description' => 'An in-depth course on Forex trading strategies, risk management, and market analysis.', + 'tier' => 'premium', + 'price' => '149.50', + 'type' => 'course', + 'instructor_id' => null + ] + ]; + + $stmt = $pdo->prepare( + "INSERT INTO courses (title, description, tier, price, type, instructor_id) + VALUES (:title, :description, :tier, :price, :type, :instructor_id)" + ); + + foreach ($courses as $course) { + $stmt->execute([ + ':title' => $course['title'], + ':description' => $course['description'], + ':tier' => $course['tier'], + ':price' => $course['price'], + ':type' => $course['type'], + ':instructor_id' => $course['instructor_id'] + ]); + } + + echo "Successfully seeded the courses table.\n"; + +} catch (PDOException $e) { + die("Seeding failed: " . $e->getMessage()); +} + diff --git a/db/seeds/seed_forums.php b/db/seeds/seed_forums.php new file mode 100644 index 0000000..3a2bb94 --- /dev/null +++ b/db/seeds/seed_forums.php @@ -0,0 +1,44 @@ +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + + // Truncate the tables to start fresh + $pdo->exec("SET FOREIGN_KEY_CHECKS=0;"); + $pdo->exec("TRUNCATE TABLE discussion_forums"); + $pdo->exec("TRUNCATE TABLE discussion_threads"); + $pdo->exec("TRUNCATE TABLE discussion_posts"); + $pdo->exec("SET FOREIGN_KEY_CHECKS=1;"); + + // Find a course to associate with a forum + $stmt = $pdo->query("SELECT id FROM courses WHERE title LIKE '%PHP%' LIMIT 1"); + $php_course = $stmt->fetch(); + $php_course_id = $php_course ? $php_course['id'] : null; + + $forums = [ + [ + 'course_id' => null, + 'title' => 'General Discussion', + 'description' => 'A place to talk about anything and everything.' + ], + [ + 'course_id' => $php_course_id, + 'title' => 'PHP Course Q&A', + 'description' => 'Ask questions and get help for the Introduction to PHP course.' + ] + ]; + + $stmt = $pdo->prepare("INSERT INTO discussion_forums (course_id, title, description) VALUES (:course_id, :title, :description)"); + + foreach ($forums as $forum) { + $stmt->execute($forum); + } + + echo "Successfully seeded the discussion_forums table.\n"; + +} catch (PDOException $e) { + die("Seeding failed: " . $e->getMessage()); +} + diff --git a/disclaimer.php b/disclaimer.php new file mode 100644 index 0000000..1d1cbda --- /dev/null +++ b/disclaimer.php @@ -0,0 +1,26 @@ + + +
+

Disclaimer

+

Last Updated:

+ +

1. General Information

+

The information provided by our platform is for general informational and educational purposes only. All information on the site is provided in good faith, however, we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site.

+ +

2. Forex & Trading Disclaimer

+

High-Risk Investment Warning: Trading Forex (foreign exchange) and other leveraged products is highly speculative and carries a high level of risk. It is possible to lose all your capital. These products may not be suitable for everyone and you should ensure that you understand the risks involved. Seek independent advice if necessary.

+

Our platform does not provide financial advice. The content on this site, including courses, mentorship, and discussions, is for educational purposes only. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice.

+ +

3. External Links Disclaimer

+

The Site may contain (or you may be sent through the Site) links to other websites or content belonging to or originating from third parties. Such external links are not investigated, monitored, or checked for accuracy, adequacy, validity, reliability, availability or completeness by us.

+ +

4. Contact Us

+

If you have any questions about this Disclaimer, please contact us.

+ +
+ + diff --git a/forum.php b/forum.php new file mode 100644 index 0000000..0b2343f --- /dev/null +++ b/forum.php @@ -0,0 +1,71 @@ +prepare('SELECT * FROM discussion_forums WHERE id = ?'); +$stmt->execute([$forum_id]); +$forum = $stmt->fetch(); + +if (!$forum) { + header('Location: forums.php'); + exit(); +} + +// Fetch threads in this forum +$stmt = $pdo->prepare( + 'SELECT t.*, u.username FROM discussion_threads t JOIN users u ON t.user_id = u.id WHERE t.forum_id = ? ORDER BY t.created_at DESC' +); +$stmt->execute([$forum_id]); +$threads = $stmt->fetchAll(); + +?> + +
+

+

+ +
+
+
Create a New Thread
+
+ +
+ + +
+ +
+
+
+ +

Threads

+
+ +
No threads in this forum yet. Be the first to post!
+ + + +
+ By on +
+ + +
+
+ + diff --git a/forums.php b/forums.php new file mode 100644 index 0000000..970ef2b --- /dev/null +++ b/forums.php @@ -0,0 +1,35 @@ +query('SELECT * FROM discussion_forums ORDER BY title ASC'); +$forums = $stmt->fetchAll(); + +?> + +
+

Forums

+ +
+ +
No forums available yet.
+ + + +
+
+
+

+
+ + +
+
+ + diff --git a/index.php b/index.php index 4a0bf53..465a19a 100644 --- a/index.php +++ b/index.php @@ -1,103 +1,59 @@ - +
+
+

Escape the Matrix

+

Your journey to digital freedom starts here.

+ Learn More +
-$phpVersion = PHP_VERSION; -$now = date('Y-m-d H:i:s'); -?> - - - - - - New Style - - - - - - -
-
-

Welcome!

-

This is your new landing page.

-

Runtime: PHP — UTC

+
+

Overview

+

We provide the tools and knowledge for you to break free from the old ways. Learn in-demand digital skills, connect with like-minded individuals, and build your own reality.

+
+ +
+

Mentor Highlights

+
+
+

Morpheus

+

Specialty: Opening minds. Morpheus can show you the door, but you're the one who has to walk through it.

+
+
+

Trinity

+

Specialty: Digital infiltration and high-speed maneuvering. Learn to navigate the system's constructs with grace and power.

+
+
+

Neo

+

Specialty: Understanding the code. Neo helps you see the world for what it truly is and manipulate it to your will.

+
+
+
+ +
+

Success Stories

+
+
+

"I was lost in the system, a battery. Now I build my own worlds."

+

- A Former Blue Pill

+
+
+

"The mentors here don't just teach, they awaken."

+

- The Kid

+
+
+
+ +
+

Join the Resistance

+
+ + +
+
+ +
+

© 2025 Neo's Crew. All rights reserved. There is no spoon.

+
-
-
- Page updated: (UTC) -
- - + + \ No newline at end of file diff --git a/login.php b/login.php new file mode 100644 index 0000000..314bedd --- /dev/null +++ b/login.php @@ -0,0 +1,22 @@ + + +
+

Login

+
+
+ + +
+
+ + +
+ +
+
+ + diff --git a/privacy_policy.php b/privacy_policy.php new file mode 100644 index 0000000..a8f593b --- /dev/null +++ b/privacy_policy.php @@ -0,0 +1,30 @@ + + +
+

Privacy Policy

+

Last Updated:

+ +

1. Introduction

+

Welcome to our platform. We are committed to protecting your privacy. This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you visit our website.

+ +

2. Information We Collect

+

We may collect information about you in a variety of ways. The information we may collect on the Site includes:

+
    +
  • Personal Data: Personally identifiable information, such as your name, shipping address, email address, and telephone number, and demographic information, such as your age, gender, hometown, and interests, that you voluntarily give to us when you register with the Site or when you choose to participate in various activities related to the Site, such as online chat and message boards.
  • +
  • Derivative Data: Information our servers automatically collect when you access the Site, such as your IP address, your browser type, your operating system, your access times, and the pages you have viewed directly before and after accessing the Site.
  • +
+ +

3. Use of Your Information

+

Having accurate information about you permits us to provide you with a smooth, efficient, and customized experience. Specifically, we may use information collected about you via the Site to...

+

[Placeholder: Detailed text about information usage to be added here.]

+ +

4. Contact Us

+

If you have questions or comments about this Privacy Policy, please contact us.

+ +
+ + diff --git a/profile.php b/profile.php new file mode 100644 index 0000000..db668cf --- /dev/null +++ b/profile.php @@ -0,0 +1,62 @@ +prepare('SELECT * FROM users WHERE id = ?'); +$stmt->execute([$_SESSION['user_id']]); +$user = $stmt->fetch(); + +?> + +
+
+
+

Your Profile

+ + +
Profile updated successfully!
+ + +
+
+
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+
+ + diff --git a/register.php b/register.php new file mode 100644 index 0000000..c9c18d7 --- /dev/null +++ b/register.php @@ -0,0 +1,26 @@ + + +
+

Register

+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ + diff --git a/templates/footer.php b/templates/footer.php new file mode 100644 index 0000000..5991c78 --- /dev/null +++ b/templates/footer.php @@ -0,0 +1,53 @@ + + + + + diff --git a/templates/header.php b/templates/header.php new file mode 100644 index 0000000..8a96cea --- /dev/null +++ b/templates/header.php @@ -0,0 +1,139 @@ + + + + + + + Escape the Matrix + + + + + \ No newline at end of file diff --git a/terms_of_service.php b/terms_of_service.php new file mode 100644 index 0000000..3b21993 --- /dev/null +++ b/terms_of_service.php @@ -0,0 +1,30 @@ + + +
+

Terms of Service

+

Last Updated:

+ +

1. Agreement to Terms

+

By using our services, you agree to be bound by these Terms of Service. If you do not agree to these Terms, do not use the services.

+ +

2. User Accounts

+

You may be required to create an account to access certain features. You are responsible for safeguarding your account and for all activities that occur under your account. You must notify us immediately of any unauthorized use of your account.

+ +

3. Content

+

Our Service allows you to post, link, store, share and otherwise make available certain information, text, graphics, videos, or other material ("Content"). You are responsible for the Content that you post on or through the Service, including its legality, reliability, and appropriateness.

+

[Placeholder: Detailed text about content ownership, rights, and responsibilities to be added here.]

+ +

4. Prohibited Activities

+

You agree not to engage in any of the following prohibited activities...

+

[Placeholder: List of prohibited activities to be added here.]

+ +

5. Contact Us

+

If you have any questions about these Terms, please contact us.

+ +
+ + diff --git a/thread.php b/thread.php new file mode 100644 index 0000000..32c982b --- /dev/null +++ b/thread.php @@ -0,0 +1,77 @@ +prepare('SELECT t.*, u.username FROM discussion_threads t JOIN users u ON t.user_id = u.id WHERE t.id = ?'); +$stmt->execute([$thread_id]); +$thread = $stmt->fetch(); + +if (!$thread) { + header('Location: forums.php'); + exit(); +} + +// Fetch posts in this thread +$stmt = $pdo->prepare( + 'SELECT p.*, u.username FROM discussion_posts p JOIN users u ON p.user_id = u.id WHERE p.thread_id = ? ORDER BY p.created_at ASC' +); +$stmt->execute([$thread_id]); +$posts = $stmt->fetchAll(); + +?> + +
+

+

Started by on

+
+ +
+ +
No replies yet.
+ + +
+
+

+
+ +
+ + +
+ +
+ +
+
+
Post a Reply
+
+ +
+ +
+ +
+
+
+ +
+ +