From 8767e4b66fffb6010646f92a77b267e5e254d2d0 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Sat, 15 May 2004 23:56:17 +0000 Subject: Subscribe and Download links work on all templates. --- day.php | 1 + functions/template.php | 12 ++++++++++++ month.php | 1 + week.php | 1 + 4 files changed, 15 insertions(+) diff --git a/day.php b/day.php index 93e0eaf..9dc3e82 100644 --- a/day.php +++ b/day.php @@ -80,6 +80,7 @@ $page->replace_tags(array( $page->draw_day($this->page); $page->tomorrows_events($this->page); $page->get_vtodo($this->page); +$page->draw_subscribe($this->page); $page->output(); diff --git a/functions/template.php b/functions/template.php index e5c631b..3c2eefe 100644 --- a/functions/template.php +++ b/functions/template.php @@ -4,6 +4,18 @@ class Page { var $page; + function draw_subscribe($template_p) { + global $template, $getdate, $cal, $ALL_CALENDARS_COMBINED, $subscribe_path, $download_filename; + preg_match("!<\!-- switch display_download on -->(.*)<\!-- switch display_download off -->!is", $this->page, $match1); + $subscribe = trim($match2[1]); + if ($cal != $ALL_CALENDARS_COMBINED && $subscribe_path != '' && $download_filename != '') { + $this->page = str_replace('{SUBSCRIBE_PATH}', $subscribe_path, $this->page); + $this->page = str_replace('{DOWNLOAD_FILENAME}', $download_filename, $this->page); + } else { + $this->page = preg_replace('!<\!-- switch display_download on -->(.*)<\!-- switch display_download off -->!is', '', $this->page); + } + } + function draw_print($template_p) { global $template, $getdate, $cal, $master_array, $daysofweek_lang, $week_start_day; foreach($master_array as $key => $val) { diff --git a/month.php b/month.php index 017b5a1..1f7fc9b 100644 --- a/month.php +++ b/month.php @@ -79,6 +79,7 @@ $page->replace_tags(array( )); $page->monthbottom($this->page); +$page->draw_subscribe($this->page); $page->output(); diff --git a/week.php b/week.php index 1caa054..effa298 100644 --- a/week.php +++ b/week.php @@ -85,6 +85,7 @@ $page->replace_tags(array( $page->draw_week($this->page); $page->tomorrows_events($this->page); $page->get_vtodo($this->page); +$page->draw_subscribe($this->page); $page->output(); -- cgit v1.2.3