diff --git a/assets/images/avatars/avatar_2_1771557067.png b/assets/images/avatars/avatar_2_1771557067.png deleted file mode 100644 index 63e17fb..0000000 Binary files a/assets/images/avatars/avatar_2_1771557067.png and /dev/null differ diff --git a/assets/images/badges/badge_1_1771598872_8939.jpg b/assets/images/badges/badge_1_1771598872_8939.jpg deleted file mode 100644 index ab5fcf7..0000000 Binary files a/assets/images/badges/badge_1_1771598872_8939.jpg and /dev/null differ diff --git a/assets/images/banners/banner_24_1771614033_1623.jpg b/assets/images/banners/banner_24_1771614033_1623.jpg deleted file mode 100644 index ab5fcf7..0000000 Binary files a/assets/images/banners/banner_24_1771614033_1623.jpg and /dev/null differ diff --git a/assets/images/custom_emotes/1771261756_shield.png b/assets/images/custom_emotes/1771261756_shield.png deleted file mode 100644 index b7f55a2..0000000 Binary files a/assets/images/custom_emotes/1771261756_shield.png and /dev/null differ diff --git a/assets/images/servers/server_1_1771640324.png b/assets/images/servers/server_1_1771640324.png deleted file mode 100644 index 1b02552..0000000 Binary files a/assets/images/servers/server_1_1771640324.png and /dev/null differ diff --git a/assets/images/servers/server_1_1771640329.png b/assets/images/servers/server_1_1771640329.png deleted file mode 100644 index 902615e..0000000 Binary files a/assets/images/servers/server_1_1771640329.png and /dev/null differ diff --git a/assets/images/servers/server_1_1771640434.png b/assets/images/servers/server_1_1771640434.png deleted file mode 100644 index 78ae1c4..0000000 Binary files a/assets/images/servers/server_1_1771640434.png and /dev/null differ diff --git a/assets/images/servers/server_1_1771640533.png b/assets/images/servers/server_1_1771640533.png deleted file mode 100644 index a6424f9..0000000 Binary files a/assets/images/servers/server_1_1771640533.png and /dev/null differ diff --git a/assets/images/servers/server_1_1771640704.png b/assets/images/servers/server_1_1771640704.png deleted file mode 100644 index 154f16b..0000000 Binary files a/assets/images/servers/server_1_1771640704.png and /dev/null differ diff --git a/assets/images/servers/server_1_1771642459.png b/assets/images/servers/server_1_1771642459.png deleted file mode 100644 index e9af8ec..0000000 Binary files a/assets/images/servers/server_1_1771642459.png and /dev/null differ diff --git a/assets/pasted-20260215-151928-c94822be.png b/assets/pasted-20260215-151928-c94822be.png deleted file mode 100644 index c6b60fa..0000000 Binary files a/assets/pasted-20260215-151928-c94822be.png and /dev/null differ diff --git a/assets/pasted-20260215-153522-763a8478.png b/assets/pasted-20260215-153522-763a8478.png deleted file mode 100644 index 1acd0a1..0000000 Binary files a/assets/pasted-20260215-153522-763a8478.png and /dev/null differ diff --git a/assets/pasted-20260215-162151-f0d79b58.png b/assets/pasted-20260215-162151-f0d79b58.png deleted file mode 100644 index 67fce27..0000000 Binary files a/assets/pasted-20260215-162151-f0d79b58.png and /dev/null differ diff --git a/assets/pasted-20260215-164921-daccb69a.png b/assets/pasted-20260215-164921-daccb69a.png deleted file mode 100644 index d2f6997..0000000 Binary files a/assets/pasted-20260215-164921-daccb69a.png and /dev/null differ diff --git a/assets/pasted-20260215-214239-79c3300e.png b/assets/pasted-20260215-214239-79c3300e.png deleted file mode 100644 index 252efa2..0000000 Binary files a/assets/pasted-20260215-214239-79c3300e.png and /dev/null differ diff --git a/assets/pasted-20260216-132213-80b79cbe.png b/assets/pasted-20260216-132213-80b79cbe.png deleted file mode 100644 index b8b920e..0000000 Binary files a/assets/pasted-20260216-132213-80b79cbe.png and /dev/null differ diff --git a/assets/pasted-20260216-162915-c3590120.png b/assets/pasted-20260216-162915-c3590120.png deleted file mode 100644 index 1c8e4f1..0000000 Binary files a/assets/pasted-20260216-162915-c3590120.png and /dev/null differ diff --git a/assets/pasted-20260216-163622-0013f90f.png b/assets/pasted-20260216-163622-0013f90f.png deleted file mode 100644 index 4c36fa8..0000000 Binary files a/assets/pasted-20260216-163622-0013f90f.png and /dev/null differ diff --git a/assets/pasted-20260216-170004-77ff069d.png b/assets/pasted-20260216-170004-77ff069d.png deleted file mode 100644 index 337a2f4..0000000 Binary files a/assets/pasted-20260216-170004-77ff069d.png and /dev/null differ diff --git a/assets/pasted-20260216-225623-7f182d79.png b/assets/pasted-20260216-225623-7f182d79.png deleted file mode 100644 index bee4866..0000000 Binary files a/assets/pasted-20260216-225623-7f182d79.png and /dev/null differ diff --git a/assets/pasted-20260217-121543-09802912.png b/assets/pasted-20260217-121543-09802912.png deleted file mode 100644 index 4720fd2..0000000 Binary files a/assets/pasted-20260217-121543-09802912.png and /dev/null differ diff --git a/assets/pasted-20260217-141526-2008a77e.png b/assets/pasted-20260217-141526-2008a77e.png deleted file mode 100644 index 544a593..0000000 Binary files a/assets/pasted-20260217-141526-2008a77e.png and /dev/null differ diff --git a/assets/pasted-20260217-143739-c7f88b4b.png b/assets/pasted-20260217-143739-c7f88b4b.png deleted file mode 100644 index 3e01147..0000000 Binary files a/assets/pasted-20260217-143739-c7f88b4b.png and /dev/null differ diff --git a/assets/pasted-20260218-160633-6ce717d1.png b/assets/pasted-20260218-160633-6ce717d1.png deleted file mode 100644 index ddd4797..0000000 Binary files a/assets/pasted-20260218-160633-6ce717d1.png and /dev/null differ diff --git a/assets/pasted-20260218-191112-132e95c8.png b/assets/pasted-20260218-191112-132e95c8.png deleted file mode 100644 index 642e98e..0000000 Binary files a/assets/pasted-20260218-191112-132e95c8.png and /dev/null differ diff --git a/assets/pasted-20260219-121958-92d2aa61.png b/assets/pasted-20260219-121958-92d2aa61.png deleted file mode 100644 index 9684a1e..0000000 Binary files a/assets/pasted-20260219-121958-92d2aa61.png and /dev/null differ diff --git a/assets/pasted-20260219-144524-4a4fe8eb.png b/assets/pasted-20260219-144524-4a4fe8eb.png deleted file mode 100644 index 40f7482..0000000 Binary files a/assets/pasted-20260219-144524-4a4fe8eb.png and /dev/null differ diff --git a/assets/pasted-20260219-145037-ae47b380.png b/assets/pasted-20260219-145037-ae47b380.png deleted file mode 100644 index 89d2522..0000000 Binary files a/assets/pasted-20260219-145037-ae47b380.png and /dev/null differ diff --git a/assets/pasted-20260219-164830-4e1d84f3.png b/assets/pasted-20260219-164830-4e1d84f3.png deleted file mode 100644 index 3ba126a..0000000 Binary files a/assets/pasted-20260219-164830-4e1d84f3.png and /dev/null differ diff --git a/assets/pasted-20260220-031637-86ef045c.png b/assets/pasted-20260220-031637-86ef045c.png deleted file mode 100644 index 89f2f73..0000000 Binary files a/assets/pasted-20260220-031637-86ef045c.png and /dev/null differ diff --git a/assets/pasted-20260220-145350-f3302486.png b/assets/pasted-20260220-145350-f3302486.png deleted file mode 100644 index d3b9c1c..0000000 Binary files a/assets/pasted-20260220-145350-f3302486.png and /dev/null differ diff --git a/assets/pasted-20260220-202504-6801c34a.png b/assets/pasted-20260220-202504-6801c34a.png deleted file mode 100644 index 32b6fa5..0000000 Binary files a/assets/pasted-20260220-202504-6801c34a.png and /dev/null differ diff --git a/assets/pasted-20260220-222757-27e58242.png b/assets/pasted-20260220-222757-27e58242.png deleted file mode 100644 index e84f9bb..0000000 Binary files a/assets/pasted-20260220-222757-27e58242.png and /dev/null differ diff --git a/assets/pasted-20260220-224107-f358f1b7.png b/assets/pasted-20260220-224107-f358f1b7.png deleted file mode 100644 index cf8f196..0000000 Binary files a/assets/pasted-20260220-224107-f358f1b7.png and /dev/null differ diff --git a/assets/pasted-20260220-230123-feffa54b.png b/assets/pasted-20260220-230123-feffa54b.png deleted file mode 100644 index 80c7b00..0000000 Binary files a/assets/pasted-20260220-230123-feffa54b.png and /dev/null differ diff --git a/assets/pasted-20260221-165938-c8695a55.png b/assets/pasted-20260221-165938-c8695a55.png deleted file mode 100644 index 024cefa..0000000 Binary files a/assets/pasted-20260221-165938-c8695a55.png and /dev/null differ diff --git a/assets/pasted-20260221-202552-3aaf0f9e.png b/assets/pasted-20260221-202552-3aaf0f9e.png new file mode 100644 index 0000000..4517501 Binary files /dev/null and b/assets/pasted-20260221-202552-3aaf0f9e.png differ diff --git a/check_divs.py b/check_divs.py deleted file mode 100644 index 2c1a53c..0000000 --- a/check_divs.py +++ /dev/null @@ -1,13 +0,0 @@ - -with open('index.php', 'r') as f: - lines = f.readlines() - -count = 0 -for i, line in enumerate(lines[:1484]): - count += line.count('prepare("SELECT id FROM users WHERE email = ? OR username = ?"); + $stmt->execute([$email, $username]); + + if ($stmt->fetch()) { + echo "L'utilisateur admin ou cet email existe déjà."; + } else { + $stmt = $pdo->prepare("INSERT INTO users (username, display_name, email, password_hash, status, is_admin) VALUES (?, ?, ?, ?, ?, ?)"); + $stmt->execute([$username, 'Administrateur', $email, $password_hash, 'offline', 1]); + + echo "

Succès !

"; + echo "

Compte administrateur créé avec succès.

"; + echo ""; + echo "

IMPORTANT : Supprimez ce fichier (create_admin.php) immédiatement après utilisation pour des raisons de sécurité.

"; + } +} catch (PDOException $e) { + echo "Erreur lors de la création du compte : " . $e->getMessage(); +} +?> diff --git a/data/test.txt b/data/test.txt deleted file mode 100644 index b6fc4c6..0000000 --- a/data/test.txt +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/data/test_www.txt b/data/test_www.txt deleted file mode 100644 index b6fc4c6..0000000 --- a/data/test_www.txt +++ /dev/null @@ -1 +0,0 @@ -hello \ No newline at end of file diff --git a/database/schema.sql b/database/schema.sql index 6028fd5..ec6d000 100644 --- a/database/schema.sql +++ b/database/schema.sql @@ -1,7 +1,7 @@ /*M!999999\- enable the sandbox mode */ -- MariaDB dump 10.19 Distrib 10.11.14-MariaDB, for debian-linux-gnu (x86_64) -- --- Host: 127.0.0.1 Database: app_38443 +-- Host: localhost Database: app_38443 -- ------------------------------------------------------ -- Server version 10.11.14-MariaDB-0+deb12u2 @@ -35,7 +35,38 @@ CREATE TABLE `channel_autoroles` ( KEY `role_id` (`role_id`), CONSTRAINT `channel_autoroles_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE, CONSTRAINT `channel_autoroles_ibfk_2` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `channel_events` +-- + +DROP TABLE IF EXISTS `channel_events`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `channel_events` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `channel_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + `title` varchar(255) NOT NULL, + `description` text DEFAULT NULL, + `banner_url` varchar(255) DEFAULT NULL, + `banner_color` varchar(20) DEFAULT NULL, + `start_date` date NOT NULL, + `start_time` time NOT NULL, + `end_date` date NOT NULL, + `end_time` time NOT NULL, + `frequency` varchar(50) DEFAULT NULL, + `is_permanent` tinyint(1) DEFAULT 0, + `created_at` timestamp NULL DEFAULT current_timestamp(), + `enable_reactions` tinyint(1) DEFAULT 0, + PRIMARY KEY (`id`), + KEY `channel_id` (`channel_id`), + KEY `user_id` (`user_id`), + CONSTRAINT `channel_events_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE, + CONSTRAINT `channel_events_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -93,7 +124,7 @@ CREATE TABLE `channel_permissions` ( PRIMARY KEY (`id`), UNIQUE KEY `channel_role_user_fixed` (`channel_id`,`role_id_idx`,`user_id_idx`), KEY `role_id` (`role_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -112,7 +143,7 @@ CREATE TABLE `channel_rss_feeds` ( PRIMARY KEY (`id`), KEY `channel_id` (`channel_id`), CONSTRAINT `channel_rss_feeds_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -131,7 +162,7 @@ CREATE TABLE `channel_rules` ( PRIMARY KEY (`id`), KEY `channel_id` (`channel_id`), CONSTRAINT `channel_rules_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -158,7 +189,7 @@ CREATE TABLE `channels` ( PRIMARY KEY (`id`), KEY `server_id` (`server_id`), CONSTRAINT `channels_ibfk_1` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -175,7 +206,24 @@ CREATE TABLE `custom_emotes` ( `code` varchar(60) NOT NULL, `created_at` timestamp NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `event_participations` +-- + +DROP TABLE IF EXISTS `event_participations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `event_participations` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `event_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `event_id` (`event_id`,`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -193,7 +241,7 @@ CREATE TABLE `forum_tags` ( PRIMARY KEY (`id`), KEY `channel_id` (`channel_id`), CONSTRAINT `forum_tags_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -220,6 +268,26 @@ CREATE TABLE `forum_threads` ( CONSTRAINT `forum_threads_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE, CONSTRAINT `forum_threads_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `forum_threads_ibfk_3` FOREIGN KEY (`solution_message_id`) REFERENCES `messages` (`id`) ON DELETE SET NULL +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `member_badges` +-- + +DROP TABLE IF EXISTS `member_badges`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `member_badges` ( + `server_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + `badge_id` int(11) NOT NULL, + PRIMARY KEY (`server_id`,`user_id`,`badge_id`), + KEY `user_id` (`user_id`), + KEY `badge_id` (`badge_id`), + CONSTRAINT `member_badges_ibfk_1` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE, + CONSTRAINT `member_badges_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, + CONSTRAINT `member_badges_ibfk_3` FOREIGN KEY (`badge_id`) REFERENCES `server_badges` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; @@ -241,7 +309,7 @@ CREATE TABLE `message_reactions` ( KEY `user_id` (`user_id`), CONSTRAINT `message_reactions_ibfk_1` FOREIGN KEY (`message_id`) REFERENCES `messages` (`id`) ON DELETE CASCADE, CONSTRAINT `message_reactions_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -271,7 +339,28 @@ CREATE TABLE `messages` ( CONSTRAINT `fk_thread` FOREIGN KEY (`thread_id`) REFERENCES `forum_threads` (`id`) ON DELETE CASCADE, CONSTRAINT `messages_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE, CONSTRAINT `messages_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=351 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `poll_votes` +-- + +DROP TABLE IF EXISTS `poll_votes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `poll_votes` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `message_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + `option_index` int(11) NOT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + UNIQUE KEY `user_poll_option` (`message_id`,`user_id`,`option_index`), + KEY `poll_votes_ibfk_2` (`user_id`), + CONSTRAINT `poll_votes_ibfk_1` FOREIGN KEY (`message_id`) REFERENCES `messages` (`id`) ON DELETE CASCADE, + CONSTRAINT `poll_votes_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -292,7 +381,7 @@ CREATE TABLE `roles` ( PRIMARY KEY (`id`), KEY `server_id` (`server_id`), CONSTRAINT `roles_ibfk_1` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -310,7 +399,7 @@ CREATE TABLE `rss_processed_items` ( PRIMARY KEY (`id`), UNIQUE KEY `idx_channel_guid` (`channel_id`,`rss_guid`), CONSTRAINT `rss_processed_items_ibfk_1` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=65 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -330,7 +419,26 @@ CREATE TABLE `rule_acceptances` ( KEY `channel_id` (`channel_id`), CONSTRAINT `rule_acceptances_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE, CONSTRAINT `rule_acceptances_ibfk_2` FOREIGN KEY (`channel_id`) REFERENCES `channels` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `server_badges` +-- + +DROP TABLE IF EXISTS `server_badges`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8mb4 */; +CREATE TABLE `server_badges` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `server_id` int(11) NOT NULL, + `name` varchar(255) NOT NULL, + `image_url` text NOT NULL, + `created_at` timestamp NULL DEFAULT current_timestamp(), + PRIMARY KEY (`id`), + KEY `server_id` (`server_id`), + CONSTRAINT `server_badges_ibfk_1` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -372,7 +480,7 @@ CREATE TABLE `servers` ( UNIQUE KEY `invite_code_2` (`invite_code`), KEY `owner_id` (`owner_id`), CONSTRAINT `servers_ibfk_1` FOREIGN KEY (`owner_id`) REFERENCES `users` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -440,7 +548,7 @@ CREATE TABLE `users` ( UNIQUE KEY `username` (`username`), UNIQUE KEY `email` (`email`), UNIQUE KEY `bot_token` (`bot_token`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -484,7 +592,7 @@ CREATE TABLE `voice_signals` ( KEY `to_peer_id` (`to_peer_id`), KEY `room_id` (`room_id`), KEY `created_at` (`created_at_ms`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +) ENGINE=InnoDB AUTO_INCREMENT=2183 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -504,7 +612,7 @@ CREATE TABLE `voice_whispers` ( PRIMARY KEY (`id`), UNIQUE KEY `user_id` (`user_id`,`whisper_key`), CONSTRAINT `voice_whispers_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -536,21 +644,4 @@ CREATE TABLE `webhooks` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Seed initial data -INSERT INTO `users` (id, username, display_name, email, password_hash, status, is_admin) VALUES -(1, 'System', 'System Bot', 'system@local', '$2y$10$4DDos6MKhMCbsvw1Yquuj.o0NwWCRlbgy85QCmGIJV6GlL8QC4cWW', 'online', 1); - -INSERT INTO `servers` (id, name, owner_id, invite_code) VALUES -(1, 'General Community', 1, 'GEN-123'), -(2, 'Flatlogic Devs', 1, 'DEV-456'); - -INSERT INTO `server_members` (server_id, user_id) VALUES (1, 1), (2, 1); - -INSERT INTO `channels` (id, server_id, name, type) VALUES -(1, 1, 'general', 'chat'), -(2, 1, 'random', 'chat'), -(3, 1, 'Voice General', 'voice'), -(4, 2, 'announcements', 'chat'), -(5, 2, 'coding-help', 'chat'); - --- Dump completed on 2026-02-19 16:49:04 +-- Dump completed on 2026-02-21 20:28:47 diff --git a/fix_index.py b/fix_index.py deleted file mode 100644 index 1456fd1..0000000 --- a/fix_index.py +++ /dev/null @@ -1,265 +0,0 @@ -import sys - -with open('index.php', 'r') as f: - lines = f.readlines() - -start_marker = "" in line and i > 1200: # around there - else_line = i - break - -if not else_line: - print("Error: Could not find the final else line") - sys.exit(1) - -# Now find the first foreach after this else -start_line = 0 -for i in range(else_line, len(lines)): - if start_marker in lines[i]: - start_line = i - break - -if not start_line: - print("Error: Could not find start marker after else") - sys.exit(1) - -# Now find the end of this block. It should end with -# But I might have multiple ones now. -# We want to find the one that is followed by (closing the main if) -# and then (closing chat-container or messages-list) - -end_line = 0 -for i in range(start_line, len(lines)): - if "" in lines[i]: - # Check if next line (or soon after) is - is_real_end = False - for j in range(i+1, min(i+10, len(lines))): - if "" in lines[j]: - is_real_end = True - end_line = j - break - if is_real_end: - break - -if not end_line: - print("Error: Could not find end marker") - sys.exit(1) - -print(f"Replacing lines {start_line+1} to {end_line+1}") - -new_block = """ -
-
">
-
-
- "> - - - - - - - - Épinglé - - -
-
- - -
- - Attachment - - - - - - -
- - - -
-
📊 SONDAGE
- -
- - -
- - - -
- $opt): - $count = 0; - $user_voted = false; - if (isset($m['votes_data'])) { - foreach($m['votes_data'] as $v) { - if ($v['option_index'] == $idx) { - $count = (int)$v['vote_count']; - $user_ids = explode(',', $v['user_ids'] ?? ''); - if (in_array($current_user_id, $user_ids)) { - $user_voted = true; - } - break; - } - } - } - $percent = $total_votes > 0 ? round(($count / $total_votes) * 100) : 0; - $is_expired = !empty($meta['end_date']) && strtotime($meta['end_date']) < time(); - ?> -
-
-
- - % () -
-
- -
- -
- -
- -
- - - - - -
- - - -
- -
- - -
- -
- - -
- - - - - - -
- -
- -
- - -
-
- prepare("SELECT emoji, COUNT(*) as count, GROUP_CONCAT(user_id) as users FROM message_reactions WHERE message_id = ? GROUP BY emoji"); - $stmt_react->execute([$m['id']]); - $reactions = $stmt_react->fetchAll(); - foreach ($reactions as $r): - $reacted = in_array($current_user_id, explode(',', $r['users'])); - ?> - - - - - + -
-
- -
- - - - - - - - - - - -
- -
- - """ - -# Adjust end_line to be the last endif before the start of next section -# The original file has at line 1486 in my previous read. -# Let's verify. - -with open('index.php', 'w') as f: - f.writelines(lines[:start_line]) - f.write(new_block) - f.write("\n") - f.writelines(lines[end_line+1:]) - diff --git a/fix_index_v2.py b/fix_index_v2.py deleted file mode 100644 index 4cabbc2..0000000 --- a/fix_index_v2.py +++ /dev/null @@ -1,222 +0,0 @@ -import sys - -with open('index.php', 'r') as f: - lines = f.readlines() - -# Section starts after line 1294 (index 1294) -# Section ends before chat-input-container (Line 1749 -> index 1748) -start_index = 1294 -end_index = 0 -for i, line in enumerate(lines): - if '
' in line: - end_index = i - break - -if not end_index: - print("Error: Could not find end marker") - sys.exit(1) - -print(f"Replacing lines {start_index+1} to {end_index}") - -new_content = """ -
-
">
-
-
- "> - - - - - - - - Épinglé - - -
-
- - -
- - Attachment - - - - - - -
- - - -
-
📊 SONDAGE
- -
- - -
- - - -
- $opt): - $count = 0; - $user_voted = false; - if (isset($m['votes_data'])) { - foreach($m['votes_data'] as $v) { - if ($v['option_index'] == $idx) { - $count = (int)$v['vote_count']; - $user_ids = explode(',', $v['user_ids'] ?? ''); - if (in_array($current_user_id, $user_ids)) { - $user_voted = true; - } - break; - } - } - } - $percent = $total_votes > 0 ? round(($count / $total_votes) * 100) : 0; - $is_expired = !empty($meta['end_date']) && strtotime($meta['end_date']) < time(); - ?> -
-
-
- - % () -
-
- -
- -
- -
- -
- - - - - -
- - - -
- -
- - -
- -
- - -
- - - - - - -
- -
- -
- - -
-
- prepare("SELECT emoji, COUNT(*) as count, GROUP_CONCAT(user_id) as users FROM message_reactions WHERE message_id = ? GROUP BY emoji"); - $stmt_react->execute([$m['id']]); - $reactions = $stmt_react->fetchAll(); - foreach ($reactions as $r): - $reacted = in_array($current_user_id, explode(',', $r['users'])); - ?> - - - - - + -
-
- -
- - - - - - - - - - - -
- -
- - -
-
-""" - -with open('index.php', 'w') as f: - f.writelines(lines[:start_index]) - f.write(new_content) - f.write("\n") - f.writelines(lines[end_index:]) - diff --git a/fix_index_v3.py b/fix_index_v3.py deleted file mode 100644 index 5b06a39..0000000 --- a/fix_index_v3.py +++ /dev/null @@ -1,815 +0,0 @@ -import sys -import re - -with open('index.php', 'r') as f: - content = f.read() - -# First, let's restore the thread loop (the first one) -thread_loop_pattern = r'<\?php foreach\(\$messages as \$m\):.*?\<\?php endforeach; \?\>' -# We need a non-greedy regex that handles nested PHP tags -# Actually, it's easier to find the markers. - -# Let's find the first foreach($messages as $m) -# and the first endforeach after it. - -# I'll just use a simpler approach: -# Find everything between
-# and
-# and replace it with a clean version of both loops. - -start_marker = '
' -end_marker = '
' - -start_pos = content.find(start_marker) -end_pos = content.find(end_marker) - -if start_pos == -1 or end_pos == -1: - print("Error: Could not find markers") - sys.exit(1) - -# Now we need to keep the structure between those markers but clean it. -# The structure is: -# if($active_thread): -# ... -# foreach($messages as $m): (thread loop) -# ... -# endforeach -# ... -# elseif($channel_type === 'event'): -# ... -# else: (normal chat) -# ... -# foreach($messages as $m): (normal loop) -# ... -# endforeach -# endif - -clean_inner = """ - -
-
- ← Retour au forum -
- - - - - - - - - -
-
-

- - - Discussion : -

- prepare("SELECT ft.* FROM forum_tags ft JOIN thread_tags tt ON ft.id = tt.tag_id WHERE tt.thread_id = ?"); - $stmt_t->execute([$active_thread['id']]); - $thread_tags = $stmt_t->fetchAll(); - if ($thread_tags): - foreach ($thread_tags as $t): - ?> - - -
- -
-
">
-
-
- "> - - - - - - SOLUTION - -
-
- -
- -
-
📊 SONDAGE
- -
- - -
- - - -
- $opt): - $count = 0; - $user_voted = false; - if (isset($m['votes_data'])) { - foreach($m['votes_data'] as $v) { - if ($v['option_index'] == $idx) { - $count = (int)$v['vote_count']; - $user_ids = explode(',', $v['user_ids'] ?? ''); - if (in_array($current_user_id, $user_ids)) { - $user_voted = true; - } - break; - } - } - } - $percent = $total_votes > 0 ? round(($count / $total_votes) * 100) : 0; - $is_expired = !empty($meta['end_date']) && strtotime($meta['end_date']) < time(); - ?> -
-
-
- - % () -
-
- -
- -
- -
- -
- - - - - -
- - - -
- -
- - -
- -
- - -
- - - - - - -
- -
- -
- - -
- prepare("SELECT emoji, COUNT(*) as count, GROUP_CONCAT(user_id) as users FROM message_reactions WHERE message_id = ? GROUP BY emoji"); - $stmt_react->execute([$m['id']]); - $reactions = $stmt_react->fetchAll(); - foreach ($reactions as $r): - $reacted = in_array($current_user_id, explode(',', $r['users'])); - ?> - - - - - + -
-
- - - - - - - - - - - - - -
-
-
- -
-
- -
-
-
-

Événements

-

Découvrez et gérez les événements à venir.

-
- - - -
- -
- -
-
- -
-

Aucun événement prévu pour le moment.

- -

Cliquez sur "Ajouter un événement" pour commencer.

- -
- - -
-
-
">
-
-
-
-
- -
-
- - - à - -
- -
- - - Fin: à - -
- - -
- - - - -
- -
-
- -
-
Voir plus
- - -
-
- Participants () -
- prepare("SELECT u.avatar_url, u.display_name FROM event_participations ep JOIN users u ON ep.user_id = u.id WHERE ep.event_id = ? LIMIT 5"); - $stmt_p->execute([$event['id']]); - $participants = $stmt_p->fetchAll(); - $p_idx = 0; - foreach ($participants as $p): - ?> -
; margin-left: 0 ? '-8px' : '0'; ?>; position: relative; z-index: ;">
- - 5): ?> -
+
- -
-
- -
- -
- -
-
- - -
-
- -
-

📜

-
- -
-
- . - -
- -
- - - - -
- -
- -
- - - - - - - prepare("SELECT 1 FROM rule_acceptances WHERE user_id = ? AND channel_id = ?"); - $stmtAcc->execute([$current_user_id, $active_channel_id]); - $has_accepted = $stmtAcc->fetch(); - ?> -
- -
- Vous avez accepté les règles. -
-
- -
- -

Veuillez accepter les règles pour obtenir l'accès complet.

- - -
- -
- -
-

🛡️

-

Cliquez sur un bouton pour vous attribuer ou vous retirer un rôle.

- -
- prepare("SELECT 1 FROM user_roles WHERE user_id = ? AND role_id = ?"); - $stmtHasRole->execute([$current_user_id, $ar['role_id']]); - $has_role = $stmtHasRole->fetch(); - ?> -
- - -
- -
- - - - - -
-
- -
- -
- - -
- -
- -
- -
-
-
-

🏛️

-
- - Tous - - "> - - - -
-
-
- - - - - - -
-
- -
- - -
-
-

- - - -

-
- Par • Dans # -
-
- - Retour au forum - -
- - -
-

Bienvenue dans # !

-

C'est le début du salon #.

-
- - -
-
">
-
-
- "> - - - - - - - - Épinglé - - -
-
- -
- -
- - Attachment - - - - - - -
- - - -
-
📊 SONDAGE
- -
- - -
- - - -
- $opt): - $count = 0; - $user_voted = false; - if (isset($m['votes_data'])) { - foreach($m['votes_data'] as $v) { - if ($v['option_index'] == $idx) { - $count = (int)$v['vote_count']; - $user_ids = explode(',', $v['user_ids'] ?? ''); - if (in_array($current_user_id, $user_ids)) { - $user_voted = true; - } - break; - } - } - } - $percent = $total_votes > 0 ? round(($count / $total_votes) * 100) : 0; - $is_expired = !empty($meta['end_date']) && strtotime($meta['end_date']) < time(); - ?> -
-
-
- - % () -
-
- -
- -
- -
- -
- - - - - -
- - - -
- -
- - -
- -
- - -
- - - - - - -
- -
- -
- - -
- prepare("SELECT emoji, COUNT(*) as count, GROUP_CONCAT(user_id) as users FROM message_reactions WHERE message_id = ? GROUP BY emoji"); - $stmt_react->execute([$m['id']]); - $reactions = $stmt_react->fetchAll(); - foreach ($reactions as $r): - $reacted = in_array($current_user_id, explode(',', $r['users'])); - ?> - - - - - + -
-
- -
- - - - - - - - - - - -
- -
- - -""" - -new_content = clean_inner.strip() -content = content[:start_pos + len(start_marker)] + "\n" + new_content + "\n" + content[end_pos:] - -with open('index.php', 'w') as f: - f.write(content) -