]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/noticesection.php
Updated Cloudy theme default avatars and minor CSS
[quix0rs-gnu-social.git] / lib / noticesection.php
index 7dfa0472d32d5f9be01ee0ac2848122e6d055723..94c2738efdabc3c5b1c60e5da6b3a774c8cd8c63 100644 (file)
@@ -73,6 +73,11 @@ class NoticeSection extends Section
     function showNotice($notice)
     {
         $profile = $notice->getProfile();
+        if (empty($profile)) {
+            common_log(LOG_WARNING, sprintf("Notice %d has no profile",
+                                            $notice->id));
+            return;
+        }
         $this->out->elementStart('li', 'hentry notice');
         $this->out->elementStart('div', 'entry-title');
         $avatar = $profile->getAvatar(AVATAR_MINI_SIZE);
@@ -80,9 +85,9 @@ class NoticeSection extends Section
         $this->out->elementStart('a', array('title' => ($profile->fullname) ?
                                             $profile->fullname :
                                             $profile->nickname,
-                                            'href' => $profile->noticeurl,
+                                            'href' => $profile->profileurl,
                                             'class' => 'url'));
-        $this->out->element('img', array('src' => (($avatar) ? common_avatar_display_url($avatar) :  common_default_avatar(AVATAR_MINI_SIZE)),
+        $this->out->element('img', array('src' => (($avatar) ? $avatar->displayUrl() :  Avatar::defaultImage(AVATAR_MINI_SIZE)),
                                          'width' => AVATAR_MINI_SIZE,
                                          'height' => AVATAR_MINI_SIZE,
                                          'class' => 'avatar photo',
@@ -96,7 +101,7 @@ class NoticeSection extends Section
         $this->out->elementStart('p', 'entry-content');
         $this->out->raw($notice->rendered);
         $this->out->elementEnd('p');
-        if ($notice->value) {
+        if (!empty($notice->value)) {
             $this->out->elementStart('p');
             $this->out->text($notice->value);
             $this->out->elementEnd('p');