summaryrefslogtreecommitdiff
path: root/status/index.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-12-12 10:34:56 +0500
committerilotterytea <iltsu@alright.party>2025-12-12 10:34:56 +0500
commit853d253a7dc0c7de6438310cd94a7ece2da9397c (patch)
treec0035cabd2253146a313bb023d0d05aafc12536f /status/index.php
parent125a28557b42cfadc5a8c237a9b8d1ea0260a206 (diff)
feat: store posts in text format
Diffstat (limited to 'status/index.php')
-rw-r--r--status/index.php52
1 files changed, 0 insertions, 52 deletions
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 @@
-<?php
-include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/time.php';
-$db = new PDO("sqlite:{$_SERVER['DOCUMENT_ROOT']}/database.db");
-
-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);
-}
-?>
-<!DOCTYPE html>
-<html>
-
-<head>
- <title>statuses - ilt.su</title>
- <meta name="description" content="my statuses.">
- <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
- <link rel="stylesheet" href="/static/style.css">
- <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
- <meta name="robots" content="noindex, nofollow">
-</head>
-
-<body>
- <main>
- <p><a href="/">ilt.su</a> - <a href="/status/">statuses</a></p>
- <?php if (isset($status)): ?>
- <h1><?= $status['title'] ?? '<i>No title.</i>' ?></h1>
- <div>
- <?= $status['contents'] ?? '<i>No contents.</i>' ?>
- </div>
- <p><i>Posted <?= format_timestamp(time() - strtotime($status['posted_at'])) ?> ago</i></p>
- <?php endif; ?>
-
- <?php if (isset($statuses)): ?>
- <h1>Statuses</h1>
- <ul>
- <?php foreach ($statuses as $s): ?>
- <li><a href="/status/?id=<?= $s['id'] ?>"><?= $s['title'] ?></a>
- <i><?= format_timestamp(time() - strtotime($s['posted_at'])) ?>
- ago</i>
- </li>
- <?php endforeach; ?>
- </ul>
- <?php endif; ?>
- </main>
-</body>
-
-</html> \ No newline at end of file