From 853d253a7dc0c7de6438310cd94a7ece2da9397c Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Fri, 12 Dec 2025 10:34:56 +0500 Subject: feat: store posts in text format --- status/index.php | 52 ----------------------------------- status/post.php | 84 -------------------------------------------------------- 2 files changed, 136 deletions(-) delete mode 100644 status/index.php delete mode 100644 status/post.php (limited to 'status') diff --git a/status/index.php b/status/index.php deleted file mode 100644 index 13d5405..0000000 --- a/status/index.php +++ /dev/null @@ -1,52 +0,0 @@ -prepare('SELECT * FROM statuses WHERE id = ?'); - $stmt->execute([$_GET['id']]); - - $status = $stmt->fetch(PDO::FETCH_ASSOC) ?: null; -} else { - $stmt = $db->query('SELECT id, title, posted_at FROM statuses ORDER BY posted_at DESC'); - $statuses = $stmt->fetchAll(PDO::FETCH_ASSOC); -} -?> - - - - - statuses - ilt.su - - - - - - - - -
-

ilt.su - statuses

- -

No title.' ?>

-
- No contents.' ?> -
-

Posted ago

- - - -

Statuses

- - -
- - - \ No newline at end of file diff --git a/status/post.php b/status/post.php deleted file mode 100644 index 064d86f..0000000 --- a/status/post.php +++ /dev/null @@ -1,84 +0,0 @@ -prepare('INSERT INTO statuses(title, contents) VALUES (?, ?)') - ->execute([$title, $contents]); - - $id = $db->lastInsertId(); - - header("Location: /status/?id=$id"); - exit; -} - -if (isset($_GET['id']) && !empty(trim($_GET['id']))) { - $stmt = $db->prepare('SELECT * FROM statuses WHERE id = ?'); - $stmt->execute([$_GET['id']]); - - $status = $stmt->fetch(PDO::FETCH_ASSOC) ?: null; -} else { - $stmt = $db->query('SELECT id, title, posted_at FROM statuses ORDER BY posted_at DESC'); - $statuses = $stmt->fetchAll(PDO::FETCH_ASSOC); -} -?> - - - - - new status - ilt.su - - - - - - - - -
-

ilt.su - statuses

-

post a new status

-
- - - - - - - - - - - - - -
title:
contents:
-
-
- - - \ No newline at end of file -- cgit v1.2.3