Ejemplo n.º 1
0
function makeTitle($arr, $time)
{
    global $timeFormat, $dateFormat_week;
    $event_text = chopToWordCount(sanitizeForWeb(urldecode($arr["event_text"])), 20);
    if ($time == -1) {
        $start = localizeDate($dateFormat_week, $arr['start_unixtime']);
        $end = localizeDate($dateFormat_week, $arr['end_unixtime'] - 60);
        $title = $event_text;
        if ($start != $end) {
            $title .= "\n{$start} - {$end}";
        }
    } else {
        $start = date($timeFormat, $arr['start_unixtime']);
        $end = date($timeFormat, $arr['end_unixtime']);
        $title = "{$start}: {$event_text}";
        if ($start != $end) {
            $title = "{$event_text}\n{$start} - {$end}";
        }
    }
    if (!empty($arr['location'])) {
        $title .= "\nLocation: " . chopToWordCount(sanitizeForWeb(urldecode($arr['location'])), 20);
    }
    if (!empty($arr['description'])) {
        $title .= "\n\n" . chopToWordCount(sanitizeForWeb(urldecode($arr['description'])), 80);
    }
    $title = trim($title);
    return $title;
}
Ejemplo n.º 2
0
 function monthbottom()
 {
     global $phpiCal_config, $getdate, $master_array, $this_year, $this_month, $cal, $timeFormat, $dateFormat_week_list, $lang;
     preg_match('!<\\!-- loop showbottomevents_odd on -->(.*)<\\!-- loop showbottomevents_odd off -->!Uis', $this->page, $match1);
     preg_match('!<\\!-- loop showbottomevents_even on -->(.*)<\\!-- loop showbottomevents_even off -->!Uis', $this->page, $match2);
     $loop[0] = trim($match1[1]);
     $loop[1] = trim($match2[1]);
     $m_start = $this_year . $this_month . '01';
     $u_start = strtotime($m_start);
     $i = 0;
     $seen_events = array();
     $middle = '';
     do {
         if (isset($master_array[$m_start])) {
             foreach ($master_array[$m_start] as $cal_time => $event_times) {
                 #	$switch['CAL'] 			= $cal;
                 #	$switch['START_DATE'] 	= localizeDate ($dateFormat_week_list, $u_start);
                 $start_date = localizeDate($dateFormat_week_list, $u_start);
                 foreach ($event_times as $uid => $val) {
                     if (isset($seen_events[$uid]) && @$val['spans_day'] == 1) {
                         continue;
                     }
                     $seen_events[$uid] = 1;
                     $switch['CAL'] = $cal;
                     $switch['START_DATE'] = $start_date;
                     $switch['CALNAME'] = $val['calname'];
                     if (!isset($val['event_start'])) {
                         $switch['START_TIME'] = $lang['l_all_day'];
                         $switch['EVENT_TEXT'] = openevent($m_start, $cal_time, $uid, $val, $phpiCal_config->month_event_lines, 15, 'psf');
                         $switch['DESCRIPTION'] = sanitizeForWeb(stripslashes(urldecode($val['description'])));
                     } else {
                         $event_start = $val['start_unixtime'];
                         $event_end = isset($val['display_end']) ? $val['display_end'] : $val['event_end'];
                         $event_start = date($timeFormat, $val['start_unixtime']);
                         $event_end = date($timeFormat, $val['end_unixtime']);
                         $switch['START_TIME'] = $event_start . ' - ' . $event_end;
                         $switch['EVENT_TEXT'] = openevent($m_start, $cal_time, $uid, $val, 0, 15, 'psf');
                         $switch['DESCRIPTION'] = sanitizeForWeb(stripslashes(urldecode($val['description'])));
                     }
                     if ($switch['EVENT_TEXT'] != '') {
                         $switch['DAYLINK'] = $m_start;
                         $temp = $loop[$i];
                         foreach ($switch as $tag => $data) {
                             $temp = str_replace('{' . $tag . '}', $data, $temp);
                         }
                         $middle .= $temp;
                         $i = $i == 1 ? 0 : 1;
                     }
                     unset($switch);
                 }
             }
         }
         $u_start = strtotime('+1 day', $u_start);
         $m_start = date('Ymd', $u_start);
         $check_month = date('m', $u_start);
         #	unset ($switch);
     } while ($this_month == $check_month);
     $this->page = preg_replace('!<\\!-- loop showbottomevents_odd on -->.*<\\!-- loop showbottomevents_even off -->!Uis', $middle, $this->page);
 }
Ejemplo n.º 3
0
    $end = localizeDate($dateFormat_week, $event['end_unixtime'] - 60);
    $event_times = $lang['l_all_day'] . " {$start}";
    if ($start != $end) {
        $event_times = "{$start} - {$end}";
    }
} else {
    $start = date($timeFormat, $event['start_unixtime']);
    $end = date($timeFormat, $event['end_unixtime']);
    $event_times = "{$start}";
    if ($start != $end) {
        $event_times = "{$start} - {$end}";
    }
}
$event['event_text'] = sanitizeForWeb(urldecode($event['event_text']));
$event['description'] = sanitizeForWeb(urldecode($event['description']));
$event['location'] = sanitizeForWeb(urldecode($event['location']));
if (isset($event['description'])) {
    $event['description'] = ereg_replace("(blocked)?([[:alpha:]]+://([^<>&[:space:]]|&amp;)+[[:alnum:]/])", '<a target="_new" href="\\2">\\2</a>', $event['description']);
    $event['description'] = ereg_replace("(blocked)?(mailto:)?([[:alnum:]_.%+-]+@[[:alnum:].-]+\\.[[:alpha:]]{2,4})", '<a href="mailto:\\3">\\3</a>', $event['description']);
}
if (isset($organizer) && is_array($organizer)) {
    $i = 0;
    $organizers = array();
    foreach ($organizer as $val) {
        if (!empty($organizer[$i]["email"])) {
            $organizers[] .= "<a href=\"mailto:{$organizer[$i]["email"]}\">{$organizer[$i]["name"]}</a>";
        } else {
            $organizers[] .= $organizer[$i]["name"];
        }
        $i++;
    }