From e4ed759394b18227d519d56554d85e454ab6d5fc Mon Sep 17 00:00:00 2001 From: mohrt Date: Tue, 6 Mar 2007 20:13:55 +0000 Subject: [PATCH] fix html_select_date separator when parts are missing (thanks to kayk for the patch) --- NEWS | 3 +++ libs/plugins/function.html_select_date.php | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 6fc3709a..8bc3cc6c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +- fix html_select_date separator when parts are missing (hayk, + monte) + Version 2.6.17 (Mar 5th, 2007) ------------------------------ diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index ff920e43..e5eb1830 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -178,7 +178,9 @@ function smarty_function_html_select_date($params, &$smarty) $html_result = $month_result = $day_result = $year_result = ""; + $field_separator_count = -1; if ($display_months) { + $field_separator_count++; $month_names = array(); $month_values = array(); if(isset($month_empty)) { @@ -216,6 +218,7 @@ function smarty_function_html_select_date($params, &$smarty) } if ($display_days) { + $field_separator_count++; $days = array(); if (isset($day_empty)) { $days[''] = $day_empty; @@ -251,6 +254,7 @@ function smarty_function_html_select_date($params, &$smarty) } if ($display_years) { + $field_separator_count++; if (null !== $field_array){ $year_name = $field_array . '[' . $prefix . 'Year]'; } else { @@ -314,7 +318,7 @@ function smarty_function_html_select_date($params, &$smarty) break; } // Add the field seperator - if($i != 2) { + if($i < $field_separator_count) { $html_result .= $field_separator; } }