From 4a515d713826621bdb3911d47521b4b221e0b48c Mon Sep 17 00:00:00 2001 From: Chad Little Date: Thu, 5 Feb 2004 00:15:37 +0000 Subject: Coded allday events for day.php --- day.php | 4 ++-- functions/template.php | 21 +++++++++++++++++++++ templates/default/day.tpl | 7 ++----- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/day.php b/day.php index 1ff5935..eed3953 100644 --- a/day.php +++ b/day.php @@ -32,7 +32,7 @@ $list_weeks = list_weeks(); $list_jumps = list_jumps(); $list_calcolors = list_calcolors(); -$page = new Page(BASE.'templates/'.$template.'/DAY.tpl'); +$page = new Page(BASE.'templates/'.$template.'/day.tpl'); $page->replace_tags(array( 'header' => BASE.'templates/'.$template.'/header.tpl', @@ -62,7 +62,7 @@ $page->replace_tags(array( 'style_select' => $style_select )); -$page->monthbottom($this->page); +$page->draw_day($this->page); $page->output(); diff --git a/functions/template.php b/functions/template.php index d5cdd7b..d6e4a1e 100644 --- a/functions/template.php +++ b/functions/template.php @@ -4,6 +4,27 @@ class Page { var $page; + function draw_day($template_p) { + global $template, $getdate, $cal, $master_array ; + $replace = ''; + if (is_array($master_array[$getdate]['-1'])) { + preg_match("!<\!-- loop allday on -->(.*)<\!-- loop allday off -->!is", $this->page, $match1); + $loop_ad = trim($match1[1]); + foreach ($master_array[$getdate]['-1'] as $allday) { + $event_calno = $allday['calnumber']; + $event_calna = $allday['calname']; + $event_url = $allday['url']; + if ($event_calno < 1) $event_calno=1; + if ($event_calno > 7) $event_calno=7; + $event = openevent($event_calna, '', '', $allday, 0, '', '', '', 'psf', $url); + $loop_tmp = str_replace('{EVENT}', $event, $loop_ad); + $loop_tmp = str_replace('{CALNO}', $event_calno, $loop_tmp); + $replace .= $loop_tmp; + } + } + $this->page = ereg_replace('(.*)', $replace, $this->page); + } + function draw_month($template_p, $offset = '+0', $type) { global $template, $getdate, $master_array, $this_year, $this_month, $dateFormat_month, $week_start_day, $cal, $minical_view, $month_event_lines, $daysofweekreallyshort_lang, $daysofweekshort_lang, $daysofweek_lang, $timeFormat_small, $timeFormat; preg_match("!<\!-- loop weekday on -->(.*)<\!-- loop weekday off -->!is", $template_p, $match1); diff --git a/templates/default/day.tpl b/templates/default/day.tpl index a447eed..5738d9f 100644 --- a/templates/default/day.tpl +++ b/templates/default/day.tpl @@ -35,11 +35,8 @@ -
- Call at some place -
-
- Some Holiday +
+ {EVENT}
-- cgit v1.2.3