accessLevel == 'public') || (current_user_can($event->accessLevel))) {
$title = stripslashes($event->eventTitle);
$description = preg_replace('#\r?\n#', '
', $event->eventDescription);
$description = stripslashes($description);
$location = stripslashes($event->eventLocation);
$PostID = isset($event->postID) ? $event->postID : '';
$linkout = isset($event->eventLinkout) ? $event->eventLinkout : '';
list($ec_startyear, $ec_startmonth, $ec_startday) = explode("-", $event->eventStartDate);
if(!is_null($event->eventStartTime) && !empty($event->eventStartTime)) {
list($ec_starthour, $ec_startminute, $ec_startsecond) = explode(":", $event->eventStartTime);
$startTime = date($options['timeFormatWidget'], mktime($ec_starthour, $ec_startminute, $ec_startsecond, $ec_startmonth, $ec_startday, $ec_startyear));
} else $startTime = null;
$startDate = date($options['dateFormatWidget'], mktime($ec_starthour, $ec_startminute, $ec_startsecond, $ec_startmonth, $ec_startday, $ec_startyear));
list($ec_endyear, $ec_endmonth, $ec_endday) = explode("-", $event->eventEndDate);
if($event->eventEndTime != null && !empty($event->eventEndTime)) {
list($ec_endhour, $ec_endminute, $ec_endsecond) = explode(":", $event->eventEndTime);
$endTime = date($options['timeFormatWidget'], mktime($ec_endhour, $ec_endminute, $ec_endsecond, $ec_endmonth, $ec_endday, $ec_endyear));
} else $endTime = null;
$endDate = date($options['dateFormatWidget'], mktime($ec_endhour, $ec_endminute, $ec_endsecond, $ec_endmonth, $ec_endday, $ec_endyear));
// Title
$output = '
'."\n".'
'.$title.'
'."\n";
// If Location
if(!empty($location) && !is_null($location)) $output .= '
'._c('Location','events-calendar').': '.$location.'
'."\n";
// start time
if(!empty($startTime) && !is_null($startTime))
$output .='
'.$startTime.' ';
// end Time
if((!empty($endTime) && !empty($startTime)) || (!is_null($endTime) && !is_null($startTime)))
$output .= _c('to','events-calendar').' '.$endTime.'';
// Description
$output .= '
'.$description.'
'."\n";
// If Star Date <> End Date
if($event->eventStartDate != $event->eventEndDate )
$output .= '
'._c('Date range','events-calendar').'
'._c('Since','events-calendar').' '.$startDate.' '._c('until','events-calendar').' '.$endDate."\n";
// Link outside the site if the link exist
if ($linkout != '')
$output .= '
'._c('Link out','events-calendar').'
'.substr($linkout,0,37).'';
// Link to a post when exist
if ($PostID != '') {
$IDtmp = get_post($PostID);
$ptitle = $IDtmp->post_title;
$output .= '
'._c('Post','events-calendar').' ('.$PostID.')
'.stripslashes($ptitle).'
';
}
echo $output;
} // if
} // for each
} // function display
}
endif;
?>