Compare commits

..

2 Commits

Author SHA1 Message Date
ae6cb85625 Merge pull request 'Add option to make comments invisible (not having to delete them). This is for moderation purposes.' (#3) from development into main
All checks were successful
Website Sync / website-sync (push) Successful in 6s
Reviewed-on: #3
2026-02-12 20:08:58 -03:00
14866f6b25 Add option to make comments invisible (not having to delete them). This is for moderation purposes.
All checks were successful
Website Sync / website-sync (push) Successful in 7s
2026-02-12 20:03:54 -03:00
2 changed files with 2 additions and 1 deletions

View File

@@ -3,7 +3,7 @@
declare(strict_types=1); declare(strict_types=1);
function retrieve_chat_history(object $pdo){ function retrieve_chat_history(object $pdo){
$query = "SELECT username, content, date_sent FROM comments;"; $query = "SELECT username, content, date_sent FROM comments WHERE visible=true;";
$stmt = $pdo->prepare($query); $stmt = $pdo->prepare($query);
$stmt->execute(); $stmt->execute();

View File

@@ -2,6 +2,7 @@ CREATE TABLE comments (
id INT(11) NOT NULL AUTO_INCREMENT, id INT(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(255) NOT NULL, username VARCHAR(255) NOT NULL,
content TEXT NOT NULL, content TEXT NOT NULL,
visible BOOLEAN DEFAULT 1,
date_sent DATETIME DEFAULT CURRENT_TIME, date_sent DATETIME DEFAULT CURRENT_TIME,
users_id INT(11) NOT NULL, users_id INT(11) NOT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),