add map to events

This commit is contained in:
fabrixxm 2015-05-15 21:10:43 +02:00
parent e75b72caf6
commit 19ee5797fa
1 changed files with 11 additions and 2 deletions

View File

@ -1,9 +1,11 @@
<?php <?php
require_once('include/bbcode.php');
require_once('include/map.php');
function format_event_html($ev) { function format_event_html($ev) {
require_once('include/bbcode.php');
if(! ((is_array($ev)) && count($ev))) if(! ((is_array($ev)) && count($ev)))
return ''; return '';
@ -36,10 +38,17 @@ function format_event_html($ev) {
$ev['finish'] , $bd_format ))) $ev['finish'] , $bd_format )))
. '</abbr></p>' . "\r\n"; . '</abbr></p>' . "\r\n";
if(strlen($ev['location'])) if(strlen($ev['location'])){
$o .= '<p class="event-location"> ' . t('Location:') . ' <span class="location">' $o .= '<p class="event-location"> ' . t('Location:') . ' <span class="location">'
. bbcode($ev['location']) . bbcode($ev['location'])
. '</span></p>' . "\r\n"; . '</span></p>' . "\r\n";
if (str_pos("[map", $ev['location'])==0) {
$map = generate_named_map($ev['location']);
if ($map!==$ev['location']) $o.=$map;
}
}
$o .= '</div>' . "\r\n"; $o .= '</div>' . "\r\n";
return $o; return $o;