diff options
author | Wesley Miaw <josuah@users.sourceforge.net> | 2005-12-01 06:25:09 +0000 |
---|---|---|
committer | Wesley Miaw <josuah@users.sourceforge.net> | 2005-12-01 06:25:09 +0000 |
commit | 20030121c4fc988b94418561191bd9784b9cfd29 (patch) | |
tree | 05fe8479ef2a8c02ab867213d1bbd3e7cf4ec412 /functions | |
parent | e5e49f470c5e4cdcf55671416ea7297177d139ff (diff) | |
download | phpicalendar-20030121c4fc988b94418561191bd9784b9cfd29.tar.gz phpicalendar-20030121c4fc988b94418561191bd9784b9cfd29.tar.bz2 phpicalendar-20030121c4fc988b94418561191bd9784b9cfd29.zip |
Feature #1109495. Print view will now show the location if the field
is defined. Code provided by Nicolas Contamin.
Diffstat (limited to 'functions')
-rw-r--r-- | functions/template.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/functions/template.php b/functions/template.php index c70da14..399aa6a 100644 --- a/functions/template.php +++ b/functions/template.php @@ -76,6 +76,7 @@ class Page { foreach ($new_val as $new_key2 => $new_val2) { if ($new_val2['event_text']) { $event_text = stripslashes(urldecode($new_val2['event_text'])); + $location = stripslashes(urldecode($new_val2['location'])); $description = stripslashes(urldecode($new_val2['description'])); $event_start = $new_val2['event_start']; $event_end = $new_val2['event_end']; @@ -94,9 +95,13 @@ class Page { if ($description == '') { $events_tmp = preg_replace('!<\!-- switch description_events on -->(.*)<\!-- switch description_events off -->!is', '', $events_tmp); } + + if ($location == '') { + $events_tmp = preg_replace('!<\!-- switch location_events on -->(.*)<\!-- switch location_events off -->!is', '', $events_tmp); + } - $search = array('{EVENT_START}', '{EVENT_TEXT}', '{DESCRIPTION}'); - $replace = array($event_start, $event_text, $description); + $search = array('{EVENT_START}', '{EVENT_TEXT}', '{DESCRIPTION}', '{LOCATION}'); + $replace = array($event_start, $event_text, $description, $location); $events_tmp = str_replace($search, $replace, $events_tmp); $some_events .= $events_tmp; $events_tmp = $loop_event; |