]> git.mxchange.org Git - friendica.git/commitdiff
add map to events
authorfabrixxm <fabrix.xm@gmail.com>
Fri, 15 May 2015 19:10:43 +0000 (21:10 +0200)
committerfabrixxm <fabrix.xm@gmail.com>
Fri, 15 May 2015 19:10:43 +0000 (21:10 +0200)
include/event.php

index f9f3b1320465c3b817a397329a12101b05395c13..c24484f8a558891d91542a7a6d83bce84f15bc8f 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 
+require_once('include/bbcode.php');
+require_once('include/map.php');
 
 function format_event_html($ev) {
 
-       require_once('include/bbcode.php');
+
 
        if(! ((is_array($ev)) && count($ev)))
                return '';
@@ -36,10 +38,17 @@ function format_event_html($ev) {
                                $ev['finish'] , $bd_format )))
                        . '</abbr></p>'  . "\r\n";
 
-       if(strlen($ev['location']))
+       if(strlen($ev['location'])){
                $o .= '<p class="event-location"> ' . t('Location:') . ' <span class="location">' 
                        . bbcode($ev['location']) 
                        . '</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";
        return $o;