From 2fcb7baf53fe03e70221d5acbcef50e9cd6aff6f Mon Sep 17 00:00:00 2001 From: mohrt Date: Tue, 18 Jun 2002 14:15:58 +0000 Subject: [PATCH] corrected warnings in html_select_time function, made make timestamp always return a timestamp --- NEWS | 2 ++ libs/plugins/function.html_select_date.php | 1 + libs/plugins/shared.make_timestamp.php | 7 +++++-- plugins/function.html_select_date.php | 1 + plugins/shared.make_timestamp.php | 7 +++++-- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 4f9845b2..d780ad08 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - fixed warnings with html_select_date and timestamp + functions (Monte) - added support for sub directory exlusion format (Monte) - added support for grouping by cache_id, compile_id and segments thereof (Monte) diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index 0324420e..54ab05e2 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -56,6 +56,7 @@ function smarty_function_html_select_date($params, &$smarty) $field_order = 'MDY'; /* String printed between the different fields. */ $field_separator = "\n"; + $time = time(); extract($params); diff --git a/libs/plugins/shared.make_timestamp.php b/libs/plugins/shared.make_timestamp.php index 19b00900..fb43ba08 100644 --- a/libs/plugins/shared.make_timestamp.php +++ b/libs/plugins/shared.make_timestamp.php @@ -22,8 +22,11 @@ function smarty_make_timestamp($string) return $time; } - // can't decipher, just return it - return $string; + // couldn't recognize it, try to return a time + if ((int) $time > 0) + return (int) $time; + else + return time(); } /* vim: set expandtab: */ diff --git a/plugins/function.html_select_date.php b/plugins/function.html_select_date.php index 0324420e..54ab05e2 100644 --- a/plugins/function.html_select_date.php +++ b/plugins/function.html_select_date.php @@ -56,6 +56,7 @@ function smarty_function_html_select_date($params, &$smarty) $field_order = 'MDY'; /* String printed between the different fields. */ $field_separator = "\n"; + $time = time(); extract($params); diff --git a/plugins/shared.make_timestamp.php b/plugins/shared.make_timestamp.php index 19b00900..fb43ba08 100644 --- a/plugins/shared.make_timestamp.php +++ b/plugins/shared.make_timestamp.php @@ -22,8 +22,11 @@ function smarty_make_timestamp($string) return $time; } - // can't decipher, just return it - return $string; + // couldn't recognize it, try to return a time + if ((int) $time > 0) + return (int) $time; + else + return time(); } /* vim: set expandtab: */