From 6684149e9fb74fd4e05af3415756b654526a5fd2 Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 15 Nov 2021 12:55:01 +0100 Subject: [PATCH] Add season placeholder --- includes/assets/css/default.css | 2 +- includes/functions/getCurrentSeason.php | 16 +++++++++++++++- includes/pages/home.php | 6 ++++++ includes/pages/install.php | 9 +++++++++ includes/pages/wishlist.php | 7 +------ 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/includes/assets/css/default.css b/includes/assets/css/default.css index 99e0d196..547f1b00 100644 --- a/includes/assets/css/default.css +++ b/includes/assets/css/default.css @@ -28,7 +28,7 @@ form { section { max-width: 80ch; padding: 2rem; - margin: 0 auto; + margin: 1rem auto 0 auto; background-color: #fff; } diff --git a/includes/functions/getCurrentSeason.php b/includes/functions/getCurrentSeason.php index 4fb8e1fb..e2afd513 100644 --- a/includes/functions/getCurrentSeason.php +++ b/includes/functions/getCurrentSeason.php @@ -8,5 +8,19 @@ function getCurrentSeason(): string { - var_dump(date()); + $now = time(); + $month = date('n'); + $season = ''; + + $startOfYear = strtotime('01. January'); + $startOfEaster = strtotime('15. April'); // Approximate + $startOfChristmas = strtotime('24. December'); + + if ($now <= $startOfEaster) { + $season = 'Easter'; + } elseif ($now <= $startOfChristmas) { + $season = 'Christmas'; + } + + return $season; } diff --git a/includes/pages/home.php b/includes/pages/home.php index 554c0f56..84002935 100644 --- a/includes/pages/home.php +++ b/includes/pages/home.php @@ -16,6 +16,12 @@ $page->header();

Welcome to wishthis

Register + Login +
+ +
+

Wishlist

+ Create a wishlist
diff --git a/includes/pages/install.php b/includes/pages/install.php index c74a48b5..cb0ecd1b 100644 --- a/includes/pages/install.php +++ b/includes/pages/install.php @@ -94,6 +94,15 @@ switch ($step) { PRIMARY KEY (id) );'); + /** + * Wishlists + */ + $database->query('CREATE TABLE `wishlists` ( + `id` int AUTO_INCREMENT, + `name` varchar(128) NOT NULL, + PRIMARY KEY (id) + );'); + /** * Options */ diff --git a/includes/pages/wishlist.php b/includes/pages/wishlist.php index 02f4a524..b3fbe0c1 100644 --- a/includes/pages/wishlist.php +++ b/includes/pages/wishlist.php @@ -32,12 +32,7 @@ $page->header();
- -
- -
- - +