From: Michael Vogel Date: Tue, 24 Jul 2018 11:51:50 +0000 (+0200) Subject: Some removed notices when viewing events (#5483) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ca2c316de03ad0be95326b4d06edfec076c1a85f;p=friendica.git Some removed notices when viewing events (#5483) --- diff --git a/src/Model/Event.php b/src/Model/Event.php index 2805a83f26..da386a77b7 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -34,14 +34,18 @@ class Event extends BaseObject $bd_format = L10n::t('l F d, Y \@ g:i A'); // Friday January 18, 2011 @ 8 AM. $event_start = day_translate( - $event['adjust'] ? + !empty($event['adjust']) ? DateTimeFormat::local($event['start'], $bd_format) : DateTimeFormat::utc($event['start'], $bd_format) ); - $event_end = day_translate( - $event['adjust'] ? - DateTimeFormat::local($event['finish'], $bd_format) : DateTimeFormat::utc($event['finish'], $bd_format) - ); + if (!empty($event['finish'])) { + $event_end = day_translate( + !empty($event['adjust']) ? + DateTimeFormat::local($event['finish'], $bd_format) : DateTimeFormat::utc($event['finish'], $bd_format) + ); + } else { + $event_end = ''; + } if ($simple) { $o = "

" . BBCode::convert($event['summary'], false, $simple) . "

"; @@ -66,7 +70,7 @@ class Event extends BaseObject $o .= '
' . BBCode::convert($event['summary'], false, $simple) . '
' . "\r\n"; $o .= '
' . L10n::t('Starts:') . ' ' . $event_start . '
' . "\r\n"; @@ -863,6 +867,11 @@ class Event extends BaseObject if (substr($dtstart_title, 0, 10) === substr($dtend_title, 0, 10)) { $same_date = true; } + } else { + $dtend_title = ''; + $dtend_dt = ''; + $end_time = ''; + $end_short = ''; } // Format the event location. diff --git a/src/Object/Post.php b/src/Object/Post.php index f9ccd3a76b..27fdb7ceea 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -14,6 +14,7 @@ use Friendica\Core\PConfig; use Friendica\Database\DBA; use Friendica\Model\Contact; use Friendica\Model\Item; +use Friendica\Model\Term; use Friendica\Util\DateTimeFormat; use Friendica\Util\Temporal; @@ -336,13 +337,15 @@ class Post extends BaseObject unset($buttons["like"]); } + $tags = Term::populateTagsFromItem($item); + $tmp_item = [ 'template' => $this->getTemplate(), 'type' => implode("", array_slice(explode("/", $item['verb']), -1)), 'suppress_tags' => Config::get('system', 'suppress_tags'), - 'tags' => $item['tags'], - 'hashtags' => $item['hashtags'], - 'mentions' => $item['mentions'], + 'tags' => $tags['tags'], + 'hashtags' => $tags['hashtags'], + 'mentions' => $tags['mentions'], 'txt_cats' => L10n::t('Categories:'), 'txt_folders' => L10n::t('Filed under:'), 'has_cats' => ((count($categories)) ? 'true' : ''),