diff options
| author | Syndamia <kamen@syndamia.com> | 2025-01-19 19:25:43 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2025-01-19 19:25:43 +0200 |
| commit | 1c65183651962e7c91097d3ffd29cfb24b3a6bee (patch) | |
| tree | c257900e580016c6e3475f9de266c7690f210e5e /views | |
| parent | 640dd416d3de28ad39b05747ad4b7c81d5203776 (diff) | |
| download | nowayforward_human-1c65183651962e7c91097d3ffd29cfb24b3a6bee.tar nowayforward_human-1c65183651962e7c91097d3ffd29cfb24b3a6bee.tar.gz nowayforward_human-1c65183651962e7c91097d3ffd29cfb24b3a6bee.zip | |
feat: Add archive page
Diffstat (limited to 'views')
| -rw-r--r-- | views/archive/index.php | 24 | ||||
| -rw-r--r-- | views/home/index.php | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/views/archive/index.php b/views/archive/index.php new file mode 100644 index 0000000..7e85c70 --- /dev/null +++ b/views/archive/index.php @@ -0,0 +1,24 @@ +<?php + include '../meta.php'; + $page = null; + runController('archive'); +?> + +<?php if ($page !== null): ?> + <iframe> + <!-- /archives/$page->WID --> + </iframe> + <?php foreach (Database\Webpage::allArchives($page->URL) as $page): ?> + <section> + <?php echo $page->Date ?> + </section> + <?php endforeach; ?> + +<?php else: ?> + <h2>This page hasn't been archived yet!</h2> + <form action="/sample_archive/index.php" method="POST"> + <input type="hidden" name="page_url" value="<?php echo $_GET["page_url"] ?>"> + <input type="submit" value="Archive Now!"> + </form> + +<?php endif; ?> diff --git a/views/home/index.php b/views/home/index.php index 33f123d..4883a91 100644 --- a/views/home/index.php +++ b/views/home/index.php @@ -4,7 +4,7 @@ <section class="highlight separate-margin"> <h2>Explore the archives or add a new page</h2> - <form action="/sample_archive/index.php" method="POST" class="font-125 flex-row width-100 center-margin"> + <form action="/archive/index.php" method="GET" class="font-125 flex-row width-100 center-margin"> <input type="text" name="page_url" placeholder="Enter a URL" class="flex-expand"> <input type="submit" name="archive_page_button" value="Search"> </form> |
