From 1b35cf3f1124b161ebde5e9e3a2c74c8ea2821d0 Mon Sep 17 00:00:00 2001 From: Connor Thomson Date: Sun, 20 Sep 2026 21:01:48 -0700 Subject: Add status and more --- profile/index.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 profile/index.php (limited to 'profile') diff --git a/profile/index.php b/profile/index.php new file mode 100755 index 0000000..89d8637 --- /dev/null +++ b/profile/index.php @@ -0,0 +1,43 @@ +. + */ + +define('ROOT', rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/'); + +require_once ROOT . '/php/render.php'; +require_once ROOT . '/php/user.php'; + +$username = isset($_GET['username']) ? $_GET['username'] : ''; + +$user = find_user($username); + +if (!$user) { + http_response_code(404); + + render_content(ROOT . '/html/unknown-user.html'); + exit; +} + +$content = replace(ROOT . '/html/profile.html', [ + '{{username}}' => htmlspecialchars($user['username'], ENT_QUOTES, 'UTF-8'), + '{{status}}' => htmlspecialchars($user['status'], ENT_QUOTES, 'UTF-8') +]); + +render_page($content); + +?> -- cgit v1.2.3