's of the different / tags. An example might be in the template: all_extra ='class ="foo"'. */ $all_extra = null; /* Separate attributes for the tags. */ $day_extra = null; $month_extra = null; $year_extra = null; /* Order in which to display the fields. "D" -> day, "M" -> month, "Y" -> year. */ $field_order = 'MDY'; /* String printed between the different fields. */ $field_separator = "\n"; extract($params); // make syntax "+N" or "-N" work with start_year and end_year if(preg_match('!(\+|\-)\s*(\d+)!',$end_year,$match)) { if($match[1] == '+') { $end_year = $match[2] + strftime("%Y"); } else { $end_year = $match[2] - strftime("%Y"); } } if(preg_match('!(\+|\-)\s*(\d+)!',$start_year,$match)) { if($match[1] == '+') { $start_year = $match[2] + strftime("%Y"); } else { $start_year = $match[2] - strftime("%Y"); } } $time = smarty_make_timestamp($time); $field_order = strtoupper($field_order); $html_result = $month_result = $day_result = $year_result = ""; if ($display_months) { $month_names = array(); for ($i = 1; $i <= 12; $i++) $month_names[] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000)); $month_result .= ''; } if ($display_days) { $days = range(1, 31); for ($i = 0; $i < count($days); $i++) $days[$i] = sprintf($day_format, $days[$i]); $day_result .= ''; } if ($display_years) { if (null !== $field_array){ $year_name = $field_array . '[' . $prefix . 'Year]'; } else { $year_name = $prefix . 'Year'; } if ($year_as_text) { $year_result .= ' $years, 'values' => $years, 'selected' => strftime("%Y", $time), 'print_result' => false), $smarty); $year_result .= ''; } } // Loop thru the field_order field for ($i = 0; $i <= 2; $i++){ $c = substr($field_order, $i, 1); switch ($c){ case 'D': $html_result .= $day_result; break; case 'M': $html_result .= $month_result; break; case 'Y': $html_result .= $year_result; break; } // Add the field seperator $html_result .= $field_separator; } print $html_result; } /* vim: set expandtab: */ ?>