From 5c5eed1390a103fecc2c57c21bbf79365cb1ee98 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 26 Jan 2004 21:30:17 +0000 Subject: More template work on event.php --- config.inc.php | 2 +- functions/template.php | 9 +++++++++ includes/event.php | 7 +++++-- templates/default/event.tpl | 30 +++++++++++++++--------------- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/config.inc.php b/config.inc.php index 418e7e7..6f8de84 100644 --- a/config.inc.php +++ b/config.inc.php @@ -1,6 +1,6 @@ 0) foreach ($tags as $tag => $data) { + + // This opens up another template and parses it as well. $data = (file_exists($data)) ? $this->parse($data) : $data; + + // This removes any unfilled tags + if ($data == '') { + $this->page = eregi_replace('(.*)', '', $this->page); + } + + // This replaces any tags $this->page = eregi_replace('{' . $tag . '}', $data, $this->page); } else diff --git a/includes/event.php b/includes/event.php index 3de7a73..ec94749 100644 --- a/includes/event.php +++ b/includes/event.php @@ -26,10 +26,10 @@ $cal_title_full = $cal.' '.$calendar_lang; // Format event time if (($start) && ($end)) { - $event_times=' - (' . $start . ' - ' . $end . ')'; + $event_times = $start . ' - ' . $end; } if ($start == '' && $end == '' && (isset($start) && isset($end))) { - $event_times=' - (' . $all_day_lang . ')'; + $event_times = $all_day_lang; } if ($description) $description = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'\0',$description); @@ -56,6 +56,9 @@ if ($location) { if ($url != '') $location = ''.$location.''; } +if (sizeof($attendee) == 0) $attendee = ''; +if (sizeof($organizer) == 0) $organizer = ''; + $page = new Page(BASE.'templates/'.$template.'/event.tpl'); $page->replace_tags(array( diff --git a/templates/default/event.tpl b/templates/default/event.tpl index 44ed4b8..1b85ee3 100644 --- a/templates/default/event.tpl +++ b/templates/default/event.tpl @@ -15,22 +15,22 @@
-

{EVENT} {EVENT_TIMES}

- +

{EVENT} - ({EVENT_TIMES})

+

{DESCRIPTION}

- - -

{ORGANIZER_LANG}: {ORGANIZER}

- - -

{ATTENDEE_LANG}: {ATTENDEE}

- - -

{STATUS_LANG}: {STATUS}

- - -

{LOCATION_LANG}: {LOCATION}

- + + +

{ORGANIZER_LANG}: {ORGANIZER}

+ + +

{ATTENDEE_LANG}: {ATTENDEE}

+ + +

{STATUS_LANG}: {STATUS}

+ + +

{LOCATIon_LANG}: {LOCATIon}

+
-- cgit v1.2.3