aboutsummaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authordavef <davefd2@users.sourceforge.net>2005-05-16 19:14:59 +0000
committerdavef <davefd2@users.sourceforge.net>2005-05-16 19:14:59 +0000
commit81b77a2e087100632ef3c1fb1f8d2f75f867a27e (patch)
treee224a6b82613a883d9211c4a304b2d34955b2386 /includes
parentc4cd9ef3029afc434d5ae41693d059ccfe459799 (diff)
downloadphpicalendar-81b77a2e087100632ef3c1fb1f8d2f75f867a27e.tar.gz
phpicalendar-81b77a2e087100632ef3c1fb1f8d2f75f867a27e.tar.bz2
phpicalendar-81b77a2e087100632ef3c1fb1f8d2f75f867a27e.zip
Big openevent cleanup - changed the openevent api, which significantly simplifies the code.
Diffstat (limited to 'includes')
-rw-r--r--includes/event.php45
1 files changed, 19 insertions, 26 deletions
diff --git a/includes/event.php b/includes/event.php
index 7bfd5d4..3d97fca 100644
--- a/includes/event.php
+++ b/includes/event.php
@@ -1,6 +1,8 @@
<?php
define('BASE', '../');
+$getdate = $_POST['date'];
include_once(BASE.'functions/init.inc.php');
+include_once(BASE.'functions/ical_parser.php');
require_once(BASE.'functions/template.php');
function decode_popup ($item) {
@@ -9,29 +11,20 @@ function decode_popup ($item) {
return $item;
}
-$event = (isset($_POST['event'])) ? decode_popup($_POST['event']) : ('');
-$description = (isset($_POST['description'])) ? decode_popup($_POST['description']) : ('');
-$cal = (isset($_POST['cal'])) ? decode_popup($_POST['cal']) : ('');
-$start = (isset($_POST['start'])) ? decode_popup($_POST['start']) : ('');
-$end = (isset($_POST['end'])) ? decode_popup($_POST['end']) : ('');
-$status = (isset($_POST['status'])) ? decode_popup($_POST['status']) : ('');
-$location = (isset($_POST['location'])) ? decode_popup($_POST['location']) : ('');
-$url = (isset($_POST['url'])) ? decode_popup($_POST['url']) : ('');
-$organizer = (isset($_POST['organizer'])) ? ($_POST['organizer']) : ('');
-$organizer = unserialize (decode_popup ($organizer));
-$attendee = (isset($_POST['attendee'])) ? ($_POST['attendee']) : ('');
-$attendee = unserialize (decode_popup ($attendee));
-$cal_title_full = $cal.' '.$calendar_lang;
+$event = $master_array[$_POST['date']][$_POST['time']][decode_popup($_POST['uid'])];
+$organizer = unserialize($event['organizer']);
+$attendee = unserialize($event['attendee']);
// Format event time
-if (($start) && ($end)) {
- $event_times = $start . ' - ' . $end;
-}
-if ($start == '' && $end == '' && (isset($start) && isset($end))) {
+// All day
+if ($_POST['time'] == -1) {
$event_times = $lang['l_all_day'];
+} else {
+ $event_times = date($timeFormat, $event['start_unixtime']) . ' - ' . date($timeFormat, $event['end_unixtime']);
}
-if ($description) $description = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$description);
+if ($event['description']) $event['description'] = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]",'<a target="_new" href="\0">\0</a>',$event['description']);
+
if (is_array($organizer)) {
$i=0;
$display .= $organizer_lang . ' - ';
@@ -51,8 +44,8 @@ if (is_array($attendee)) {
$attendee = substr($attendees,0,-2);
}
-if ($location) {
- if ($url != '') $location = '<a href="'.$url.'" target="_blank">'.$location.'</a>';
+if ($event['location']) {
+ if ($event['url'] != '') $event['location'] = '<a href="'.$event['url'].'" target="_blank">'.$event['location'].'</a>';
}
if (sizeof($attendee) == 0) $attendee = '';
@@ -61,15 +54,15 @@ if (sizeof($organizer) == 0) $organizer = '';
$page = new Page(BASE.'templates/'.$template.'/event.tpl');
$page->replace_tags(array(
- 'cal' => $cal,
- 'event' => $event,
+ 'cal' => $event['calname'],
+ 'event_text' => urldecode($event['event_text']),
'event_times' => $event_times,
- 'description' => $description,
+ 'description' => urldecode($event['description']),
'organizer' => $organizer,
'attendee' => $attendee,
- 'status' => $status,
- 'location' => $location,
- 'cal_title_full' => $cal_title_full,
+ 'status' => $event['status'],
+ 'location' => $event['location'],
+ 'cal_title_full' => $event['calname'].' '.$lang['l_calendar'],
'template' => $template,
'l_organizer' => $lang['l_organizer'],
'l_attendee' => $lang['l_attendee'],

© 2014-2022 Faster IT GmbH | imprint | privacy policy