diff options
-rw-r--r-- | config.inc.php | 2 | ||||
-rw-r--r-- | functions/template.php | 9 | ||||
-rw-r--r-- | includes/event.php | 7 | ||||
-rw-r--r-- | 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 @@ <?php -// Configuration file for PHP iCalendar 1.1 +// Configuration file for PHP iCalendar 1.2 // // To set values, change the text between the single quotes // Follow instructions to the right for detailed information diff --git a/functions/template.php b/functions/template.php index 1472c15..ebecf7a 100644 --- a/functions/template.php +++ b/functions/template.php @@ -20,7 +20,16 @@ class Page { function replace_tags($tags = array()) { if (sizeof($tags) > 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('<!-- switch ' . $tag . ' on -->(.*)<!-- switch ' . $tag . ' off -->', '', $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=' - <font class="V9">(<i>' . $start . ' - ' . $end . '</i>)</font>'; + $event_times = $start . ' - ' . $end; } if ($start == '' && $end == '' && (isset($start) && isset($end))) { - $event_times=' - <font class="V9">(<i>' . $all_day_lang . '</i>)</font>'; + $event_times = $all_day_lang; } if ($description) $description = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$description); @@ -56,6 +56,9 @@ if ($location) { if ($url != '') $location = '<a href="'.$url.'" target="_blank">'.$location.'</a>'; } +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 @@ <tr> <td align="left" class="V12"> <div style="margin-left: 10px; margin-bottom:10px;"> - <p>{EVENT} {EVENT_TIMES}</p> - <!-- Switch Description On --> + <p>{EVENT} - <span class="V9">(<i>{EVENT_TIMES}</i>)</font></p> + <!-- switch description on --> <p>{DESCRIPTION}</p> - <!-- Switch Description Off --> - <!-- Switch Organizer On --> - <p>{ORGANIZER_LANG}: {ORGANIZER}</p> - <!-- Switch Organizer Off --> - <!-- Switch Attendee On --> - <p>{ATTENDEE_LANG}: {ATTENDEE}</p> - <!-- Switch Attendee Off --> - <!-- Switch Status On --> - <p>{STATUS_LANG}: {STATUS}</p> - <!-- Switch Status Off --> - <!-- Switch Location On --> - <p>{LOCATION_LANG}: {LOCATION}</p> - <!-- Switch Location Off --> + <!-- switch description off --> + <!-- switch organizer on --> + <p><b>{ORGANIZER_LANG}</b>: {ORGANIZER}</p> + <!-- switch organizer off --> + <!-- switch attendee on --> + <p><b>{ATTENDEE_LANG}</b>: {ATTENDEE}</p> + <!-- switch attendee off --> + <!-- switch status on --> + <p><b>{STATUS_LANG}</b>: {STATUS}</p> + <!-- switch status off --> + <!-- switch location on --> + <p><b>{LOCATIon_LANG}</b>: {LOCATIon}</p> + <!-- switch location off --> </div> </td> </tr> |