]> git.mxchange.org Git - friendica.git/commitdiff
Some removed notices when viewing events (#5483)
authorMichael Vogel <icarus@dabo.de>
Tue, 24 Jul 2018 11:51:50 +0000 (13:51 +0200)
committerHypolite Petovan <mrpetovan@eml.cc>
Tue, 24 Jul 2018 11:51:50 +0000 (07:51 -0400)
src/Model/Event.php
src/Object/Post.php

index 2805a83f26ab852dd08674940d51ef27fad3a590..da386a77b7dbd39540d9fe11916f19f878a48775 100644 (file)
@@ -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 = "<h3>" . BBCode::convert($event['summary'], false, $simple) . "</h3>";
@@ -66,7 +70,7 @@ class Event extends BaseObject
                $o .= '<div class="summary event-summary">' . BBCode::convert($event['summary'], false, $simple) . '</div>' . "\r\n";
 
                $o .= '<div class="event-start"><span class="event-label">' . L10n::t('Starts:') . '</span>&nbsp;<span class="dtstart" title="'
-                       . DateTimeFormat::utc($event['start'], (($event['adjust']) ? DateTimeFormat::ATOM : 'Y-m-d\TH:i:s'))
+                       . DateTimeFormat::utc($event['start'], (!empty($event['adjust']) ? DateTimeFormat::ATOM : 'Y-m-d\TH:i:s'))
                        . '" >' . $event_start
                        . '</span></div>' . "\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.
index f9ccd3a76b94e180be6c654251a828b2a5b24c81..27fdb7ceea9defafa21f314a92420358950ed957 100644 (file)
@@ -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' : ''),