function format_event_html($ev) { if (!(is_array($ev) && count($ev))) { return ''; } $bd_format = t('l F d, Y \\@ g:i A'); // Friday January 18, 2011 @ 8 AM $o = '<div class="vevent">' . "\r\n"; $o .= '<p class="summary event-summary">' . bbcode($ev['summary']) . '</p>' . "\r\n"; $o .= '<p class="description event-description">' . bbcode($ev['desc']) . '</p>' . "\r\n"; $o .= '<p class="event-start">' . t('Starts:') . ' <abbr class="dtstart" title="' . datetime_convert('UTC', 'UTC', $ev['start'], $ev['adjust'] ? ATOM_TIME : 'Y-m-d\\TH:i:s') . '" >' . ($ev['adjust'] ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $ev['start'], $bd_format)) : day_translate(datetime_convert('UTC', 'UTC', $ev['start'], $bd_format))) . '</abbr></p>' . "\r\n"; if (!$ev['nofinish']) { $o .= '<p class="event-end" >' . t('Finishes:') . ' <abbr class="dtend" title="' . datetime_convert('UTC', 'UTC', $ev['finish'], $ev['adjust'] ? ATOM_TIME : 'Y-m-d\\TH:i:s') . '" >' . ($ev['adjust'] ? day_translate(datetime_convert('UTC', date_default_timezone_get(), $ev['finish'], $bd_format)) : day_translate(datetime_convert('UTC', 'UTC', $ev['finish'], $bd_format))) . '</abbr></p>' . "\r\n"; } if (strlen($ev['location'])) { $o .= '<p class="event-location"> ' . t('Location:') . ' <span class="location">' . bbcode($ev['location']) . '</span></p>' . "\r\n"; if (strpos($ev['location'], "[map") === False) { $map = generate_named_map($ev['location']); if ($map !== $ev['location']) { $o .= $map; } } } $o .= '</div>' . "\r\n"; return $o; }
function bb_map_location($match) { // the extra space in the following line is intentional return str_replace($match[0], '<div class="map" >' . generate_named_map($match[1]) . '</div>', $match[0]); }