X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fevent.php;h=a9f054fc2ed2bf530e9c6c0d9fbadf7570313c6d;hb=eed55664fc61a0e285dcf5c814b39496537c7039;hp=f9f3b1320465c3b817a397329a12101b05395c13;hpb=ed1dce93d688cc6917348cac955e2b3a159215b9;p=friendica.git diff --git a/include/event.php b/include/event.php index f9f3b13204..a9f054fc2e 100644 --- a/include/event.php +++ b/include/event.php @@ -1,15 +1,43 @@ ".bbcode($ev['summary']).""; + + $o .= "

".bbcode($ev['desc'])."

"; + + $o .= "

".t('Starts:')."

".$event_start."

"; + + if(! $ev['nofinish']) + $o .= "

".t('Finishes:')."

".$event_end."

"; + + if(strlen($ev['location'])) + $o .= "

".t('Location:')."

".$ev['location']."

"; + + return $o; + } + $o = '
' . "\r\n"; @@ -19,28 +47,27 @@ function format_event_html($ev) { $o .= '

' . t('Starts:') . ' ' - . (($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))) + . '" >'.$event_start . '

' . "\r\n"; if(! $ev['nofinish']) $o .= '

' . t('Finishes:') . ' ' - . (($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 ))) + . '" >'.$event_end . '

' . "\r\n"; - if(strlen($ev['location'])) - $o .= '

' . t('Location:') . ' ' - . bbcode($ev['location']) + if(strlen($ev['location'])){ + $o .= '

' . t('Location:') . ' ' + . bbcode($ev['location']) . '

' . "\r\n"; + if (strpos($ev['location'], "[map") !== False) { + $map = generate_named_map($ev['location']); + if ($map!==$ev['location']) $o.=$map; + } + + } + $o .= '
' . "\r\n"; return $o; } @@ -49,7 +76,6 @@ function format_event_html($ev) { function parse_event($h) { require_once('include/Scrape.php'); - require_once('library/HTMLPurifier.auto.php'); require_once('include/html2bbcode'); $h = '' . $h . ''; @@ -128,7 +154,7 @@ function format_event_bbcode($ev) { if(($ev['finish']) && (! $ev['nofinish'])) $o .= '[event-finish]' . $ev['finish'] . '[/event-finish]'; - + if($ev['location']) $o .= '[event-location]' . $ev['location'] . '[/event-location]'; @@ -191,11 +217,17 @@ function ev_compare($a,$b) { if($date_a === $date_b) return strcasecmp($a['desc'],$b['desc']); - + return strcmp($date_a,$date_b); } +function event_delete($event_id) { + if ($event_id == 0) + return; + q("DELETE FROM `event` WHERE `id` = %d", intval($event_id)); + logger("Deleted event ".$event_id, LOGGER_DEBUG); +} function event_store($arr) { @@ -315,7 +347,7 @@ function event_store($arr) { } else { - // New event. Store it. + // New event. Store it. $r = q("INSERT INTO `event` ( `uid`,`cid`,`uri`,`created`,`edited`,`start`,`finish`,`summary`, `desc`,`location`,`type`, `adjust`,`nofinish`,`allow_cid`,`allow_gid`,`deny_cid`,`deny_gid`) @@ -353,6 +385,7 @@ function event_store($arr) { $item_arr['contact-id'] = $arr['cid']; $item_arr['uri'] = $arr['uri']; $item_arr['parent-uri'] = $arr['uri']; + $item_arr['guid'] = $arr['guid']; $item_arr['type'] = 'activity'; $item_arr['wall'] = (($arr['cid']) ? 0 : 1); $item_arr['contact-id'] = $contact['id'];