From 3425e2a6bfeb947b455568a01af55c2e853f8767 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Fri, 30 Jan 2004 07:34:19 +0000 Subject: Initial checkin --- functions/list_functions.php | 97 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 functions/list_functions.php (limited to 'functions/list_functions.php') diff --git a/functions/list_functions.php b/functions/list_functions.php new file mode 100644 index 0000000..8d4d3a6 --- /dev/null +++ b/functions/list_functions.php @@ -0,0 +1,97 @@ +$select_month\n"; + } else { + $return .= "\n"; + } + $month_time = strtotime ("+1 month", $month_time); + } + + return $return; +} + + +function list_years() { + global $getdate, $this_year, $cal, $dateFormat_month; + $year_time = strtotime($getdate); + for ($i=0; $i < $num_years; $i++) { + $offset = $num_years - $i; + $prev_time = strtotime("-$offset year", $year_time); + $prev_date = date("Ymd", $prev_time); + $prev_year = date("Y", $prev_time); + $return .= "\n"; + } + + $getdate_date = date("Ymd", $year_time); + $getdate_year = date("Y", $year_time); + $return .= "\n"; + + for ($i=0; $i < $num_years; $i++) { + $offset = $i + 1; + $next_time = strtotime("+$offset year", $year_time); + $next_date = date("Ymd", $next_time); + $next_year = date("Y", $next_time); + $return .= "\n"; + } + + return $return; +} + + +function list_weeks() { + global $getdate, $this_year, $cal, $dateFormat_week_jump; + ereg ("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2); + $this_day = $day_array2[3]; + $this_month = $day_array2[2]; + $this_year = $day_array2[1]; + $check_week = strtotime($getdate); + $start_week_time = strtotime(dateOfWeek(date("Ymd", strtotime("$this_year-01-01")), $week_start_day)); + $end_week_time = $start_week_time + (6 * 25 * 60 * 60); + + do { + $weekdate = date ("Ymd", $start_week_time); + $select_week1 = localizeDate($dateFormat_week_jump, $start_week_time); + $select_week2 = localizeDate($dateFormat_week_jump, $end_week_time); + + if (($check_week >= $start_week_time) && ($check_week <= $end_week_time)) { + $return .= "\n"; + } else { + $return .= "\n"; + } + $start_week_time = strtotime ("+1 week", $start_week_time); + $end_week_time = $start_week_time + (6 * 25 * 60 * 60); + } while (date("Y", $start_week_time) <= $this_year); + + return $return; +} + +function list_languages() { + global $getdate, $cal, $current_view; + $dir_handle = @opendir(BASE.'languages/'); + $tmp_pref_language = urlencode(ucfirst($language)); + while ($file = readdir($dir_handle)) { + if (substr($file, -8) == ".inc.php") { + $language_tmp = urlencode(ucfirst(substr($file, 0, -8))); + if ($language_tmp == $tmp_pref_language) { + $return .= "\n"; + } else { + $return .= "\n"; + } + } + } + closedir($dir_handle); + + return $return; +} + + +?> \ No newline at end of file -- cgit v1.2.3