X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fevent.php;h=a9f054fc2ed2bf530e9c6c0d9fbadf7570313c6d;hb=146dc5c8cd75dd34b5d0e0f1f214927cdd10ea4b;hp=fedbe24468ab67a4085422375974013e279bd77e;hpb=98bba66dcb335a86385967bc08ce30f5be0f4b75;p=friendica.git diff --git a/include/event.php b/include/event.php index fedbe24468..a9f054fc2e 100644 --- a/include/event.php +++ b/include/event.php @@ -3,7 +3,7 @@ require_once('include/bbcode.php'); require_once('include/map.php'); -function format_event_html($ev) { +function format_event_html($ev, $simple = false) { @@ -12,6 +12,32 @@ function format_event_html($ev) { $bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM + $event_start = (($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_end = (($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 ))); + + if ($simple) { + $o = "
".bbcode($ev['desc'])."
"; + + $o .= "".$event_start."
"; + + if(! $ev['nofinish']) + $o .= "".$event_end."
"; + + if(strlen($ev['location'])) + $o .= "".$ev['location']."
"; + + return $o; + } + $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'])
+ $o .= ' ' . t('Location:') . ' '
+ . bbcode($ev['location'])
. '