aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--models/archivelist.php2
-rw-r--r--views/global/router.php1
-rw-r--r--views/list/index.php22
-rw-r--r--views/list/meta.php4
4 files changed, 28 insertions, 1 deletions
diff --git a/models/archivelist.php b/models/archivelist.php
index 3723419..25b75fe 100644
--- a/models/archivelist.php
+++ b/models/archivelist.php
@@ -19,7 +19,7 @@ class ArchiveList extends Table {
static function fromDB(int $LID) : ArchiveList {
return Table::_fromDB(
"SELECT * FROM ArchiveLists WHERE LID = \"$LID\"",
- 'Database\ArchiveLists'
+ 'Database\ArchiveList'
);
}
diff --git a/views/global/router.php b/views/global/router.php
index f8e1299..fa9348d 100644
--- a/views/global/router.php
+++ b/views/global/router.php
@@ -18,6 +18,7 @@ function route_view() {
case '/login': return '/login';
case '/logout': return '/logout';
case '/newlist': return '/newlist';
+ case '/list': return '/list';
}
switch ($uri) {
diff --git a/views/list/index.php b/views/list/index.php
new file mode 100644
index 0000000..01c18b4
--- /dev/null
+++ b/views/list/index.php
@@ -0,0 +1,22 @@
+<?php
+ $list = null;
+ $author = null;
+
+ try {
+ $list = Database\ArchiveList::fromDB($lid);
+ $author = Database\User::fromDBuid($list->AuthorUID);
+ }
+ catch(Exception $e) {}
+?>
+
+<?php if ($list !== null): ?>
+ <section>
+ <p><?= $list->Name ?></p>
+ <p><?= $list->Description ?></p>
+ <p><?= $author->Username ?></p>
+ </section>
+<?php else: ?>
+ <p>
+ List doesn't exist
+ </p>
+<?php endif; ?>
diff --git a/views/list/meta.php b/views/list/meta.php
new file mode 100644
index 0000000..137794e
--- /dev/null
+++ b/views/list/meta.php
@@ -0,0 +1,4 @@
+<?php
+
+$lid = explode('/', $uri, 4)[2];
+$title = 'List';