From 2fc741867d6e1486412bb7c8ad8ac362f47429a8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 7 Jun 2003 06:08:52 +0000 Subject: - Bugfix: if you clicked on an archive date in the calendar block and then select a new date via the form the block still displays the original click as the "selected" date. Patch by Craig Courtney. --- modules/archive.module | 10 +++++++++- modules/archive/archive.module | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/archive.module b/modules/archive.module index a39cc9f9c..05848c06b 100644 --- a/modules/archive.module +++ b/modules/archive.module @@ -8,13 +8,21 @@ function archive_system($field){ } function archive_calendar($original = 0) { + $edit = $_POST["edit"]; // Extract today's date: $start_of_today = mktime(0, 0, 0, date("n", time()), date("d", time()), date("Y", time())); $end_of_today = mktime(23, 59, 59, date("n", time()), date("d", time()), date("Y", time())); // Extract the requested date: - if (arg(0) == "archive" && arg(3)) { + if ($edit["year"] && $edit["month"] && $edit["day"]) { + $year = $edit["year"]; + $month = $edit["month"]; + $day = $edit["day"]; + + $requested = mktime(0, 0, 0, $month, $day, $year); + } + else if (arg(0) == "archive" && arg(3)) { $year = arg(1); $month = arg(2); $day = arg(3); diff --git a/modules/archive/archive.module b/modules/archive/archive.module index a39cc9f9c..05848c06b 100644 --- a/modules/archive/archive.module +++ b/modules/archive/archive.module @@ -8,13 +8,21 @@ function archive_system($field){ } function archive_calendar($original = 0) { + $edit = $_POST["edit"]; // Extract today's date: $start_of_today = mktime(0, 0, 0, date("n", time()), date("d", time()), date("Y", time())); $end_of_today = mktime(23, 59, 59, date("n", time()), date("d", time()), date("Y", time())); // Extract the requested date: - if (arg(0) == "archive" && arg(3)) { + if ($edit["year"] && $edit["month"] && $edit["day"]) { + $year = $edit["year"]; + $month = $edit["month"]; + $day = $edit["day"]; + + $requested = mktime(0, 0, 0, $month, $day, $year); + } + else if (arg(0) == "archive" && arg(3)) { $year = arg(1); $month = arg(2); $day = arg(3); -- cgit v1.2.3