From f6e9e9577b2a92f5a676a332cc7aa586423fa5f3 Mon Sep 17 00:00:00 2001 From: sorenpeter Date: Tue, 31 Oct 2023 22:50:37 +0100 Subject: [PATCH] Profile as default if not logged in is working --- partials/base.php | 6 +++--- partials/header.php | 22 +++++++++++++++++----- style.css | 20 +++++++++++++++++++- views/home.php | 41 +++++++++++++++++++++++++++++++++++----- views/profile.php | 46 ++++++++++++++------------------------------- 5 files changed, 89 insertions(+), 46 deletions(-) diff --git a/partials/base.php b/partials/base.php index a0ba705..ddc6751 100644 --- a/partials/base.php +++ b/partials/base.php @@ -81,7 +81,7 @@ $twtFollowingList = []; // Show twts only for URL in query request, else show user timeline -if (!empty($_GET['twts'])) { // Show twts for some user +if (!empty($_GET['twts'])) { // Show twts for some user --> /profile $twtsURL = $_GET['twts']; if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) { die('Not a valid URL'); @@ -92,7 +92,7 @@ if (!empty($_GET['twts'])) { // Show twts for some user $parsedTwtxtFiles[$parsedTwtxtFile->mainURL] = $parsedTwtxtFile; } -} else { // Show timeline for the URL +} else { // Show timeline for the URL --> / (home) $parsedTwtxtFiles = []; foreach ($fileLines as $currentLine) { if (str_starts_with($currentLine, '#')) { @@ -120,7 +120,7 @@ foreach ($parsedTwtxtFiles as $currentTwtFile) { } } -// Show individual posts +# Show individual posts if (!empty($_GET['hash'])) { $hash = $_GET['hash']; $twts = array_filter($twts, function($twt) use ($hash) { diff --git a/partials/header.php b/partials/header.php index 1fcff5e..7cceda7 100644 --- a/partials/header.php +++ b/partials/header.php @@ -1,3 +1,10 @@ + + @@ -10,18 +17,23 @@

- 🧶 Timeline for - sorenpeter@darch.dk - (twtxt.txt) + + + Timeline for nick ?>@mainURL, PHP_URL_HOST); ?> + + + + +