From 3ecdfe257d36565d7f97b50d7d1ba6f362df2d2b Mon Sep 17 00:00:00 2001 From: Pierre Date: Thu, 24 May 2018 21:30:48 +0200 Subject: [PATCH] Countdown timer now accepts is now minute-precise --- classes/components/posts.php | 5 ++++- db_struct.sql | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/components/posts.php b/classes/components/posts.php index 12ae231..5166d75 100644 --- a/classes/components/posts.php +++ b/classes/components/posts.php @@ -408,6 +408,7 @@ class Posts { $day_end = $array_date_end[0]; $month_end = $array_date_end[1]; $year_end = $array_date_end[2]; + $time_end = $post->get_time_end(); } //Process user page posts @@ -444,6 +445,7 @@ class Posts { "jour_fin" => isset($day_end) ? $day_end : null, "mois_fin" => isset($month_end) ? $month_end : null, "annee_fin" => isset($year_end) ? $year_end : null, + "time_end" => isset($time_end) ? $time_end : null, //Weblink page "url_page" => $post->has_link_url() ? $post->get_link_url() : null, @@ -707,7 +709,8 @@ class Posts { //Countdown timer - specific if($entry['annee_fin'] != 0) $post->set_time_end(strtotime($entry["annee_fin"]."/".$entry['mois_fin']."/".$entry["jour_fin"])); - + if($entry["time_end"] != 0) + $post->set_time_end($entry["time_end"]); //Web link $post->set_link_url($entry["url_page"] != null ? $entry["url_page"] : ""); diff --git a/db_struct.sql b/db_struct.sql index 6e0a7d7..fcdfc0f 100644 --- a/db_struct.sql +++ b/db_struct.sql @@ -433,6 +433,7 @@ CREATE TABLE `texte` ( `annee_fin` varchar(255) DEFAULT NULL, `mois_fin` varchar(255) DEFAULT NULL, `jour_fin` varchar(255) DEFAULT NULL, + `time_end` int(11) DEFAULT NULL, `url_page` varchar(255) DEFAULT NULL, `titre_page` varchar(255) DEFAULT NULL, `description_page` longtext,