From 540ca5a5233ce2195ebb85aaa920bc7670f6df59 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 5 Feb 2004 04:59:19 +0000 Subject: Slight design change in day, wired up week days on day.php. --- day.php | 2 +- functions/template.php | 22 +++++++++++++++++- templates/default/day.tpl | 58 ++++++++++++----------------------------------- 3 files changed, 36 insertions(+), 46 deletions(-) diff --git a/day.php b/day.php index eed3953..4a7fc99 100644 --- a/day.php +++ b/day.php @@ -20,7 +20,7 @@ $today_today = date('Ymd', strtotime("now + $second_offset seconds")); $next_day = date('Ymd', strtotime("+1 day", $unix_time)); $prev_day = date('Ymd', strtotime("-1 day", $unix_time)); -$display_date = localizeDate($dateFormat_week_list, $unix_time); +$display_date = localizeDate($dateFormat_day, $unix_time); $start_week_time = strtotime(dateOfWeek($getdate, $week_start_day)); diff --git a/functions/template.php b/functions/template.php index d6e4a1e..acd7861 100644 --- a/functions/template.php +++ b/functions/template.php @@ -5,7 +5,9 @@ class Page { var $page; function draw_day($template_p) { - global $template, $getdate, $cal, $master_array ; + global $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day; + + // Replaces the allday events $replace = ''; if (is_array($master_array[$getdate]['-1'])) { preg_match("!<\!-- loop allday on -->(.*)<\!-- loop allday off -->!is", $this->page, $match1); @@ -23,6 +25,24 @@ class Page { } } $this->page = ereg_replace('(.*)', $replace, $this->page); + + // Replaces the daysofweek + preg_match("!<\!-- loop daysofweek on -->(.*)<\!-- loop daysofweek off -->!is", $this->page, $match1); + $loop_dof = trim($match1[1]); + $start_wt = strtotime(dateOfWeek($getdate, $week_start_day)); + $start_day = strtotime($week_start_day); + for ($i=0; $i<7; $i++) { + $day_num = date("w", $start_day); + $weekday = $daysofweek_lang[$day_num]; + $daylink = date('Ymd', $start_wt); + $start_day = strtotime("+1 day", $start_day); + $start_wt = strtotime("+1 day", $start_wt); + $loop_tmp = str_replace('{DAY}', $weekday, $loop_dof); + $loop_tmp = str_replace('{DAYLINK}', $daylink, $loop_tmp); + $weekday_loop .= $loop_tmp; + } + $this->page = ereg_replace('(.*)', $weekday_loop, $this->page); + } function draw_month($template_p, $offset = '+0', $type) { diff --git a/templates/default/day.tpl b/templates/default/day.tpl index 5738d9f..837e0f0 100644 --- a/templates/default/day.tpl +++ b/templates/default/day.tpl @@ -8,16 +8,7 @@ - - + + + +
+ + + + + + +
+ {DAY} +
+
@@ -41,40 +45,6 @@ - - - - - - - - - - - - - - - - -
- {DAY} - - {DAY} - - {DAY} - - {DAY} - - {DAY} - - {DAY} - - {DAY} -
- - - -- cgit v1.2.3