From 5b61a18f1bab2cf17f849b64129efa9726848262 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 26 Jan 2025 17:17:10 +0200 Subject: feat(profile): Show archives made by user in their profile page --- models/webpage.php | 8 ++++++++ views/profile/index.php | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/models/webpage.php b/models/webpage.php index 742b977..3445f62 100644 --- a/models/webpage.php +++ b/models/webpage.php @@ -48,6 +48,14 @@ class Webpage extends Table { ); } + static function allArchivesByUser(int $UID) : array { + return Table::_get_all( + 'Webpages', + 'Database\Webpage', + "WHERE RequesterUID = \"$UID\" ORDER BY Date DESC" + ); + } + static function getArchivePathsByPattern(string $URLPattern) : array { return Table::_get_all( 'Webpages', diff --git a/views/profile/index.php b/views/profile/index.php index 471b257..e4015e9 100644 --- a/views/profile/index.php +++ b/views/profile/index.php @@ -12,6 +12,31 @@

Username ?>

+ +
+ +

Archives

+ UID) as $page): ?> +
+
+
+ + URL ?> + Date ?> +
+
+ Visits: Visits ?> + RequesterUID)->Username ?> +
+
+ +
+ + +
+ +
+

User "" doesn't exist!

-- cgit v1.2.3