X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fnoticelist.php;h=9fc0126b3eb95e4def41607b9540330fe16dd572;hb=09bab904091316fe669619ec90a26a86fc1927d5;hp=20bf3c9f11d5966643829d15e4ecf05d882b722d;hpb=a7c85bebd5be9ea019a8c80d74730d7eb28d4651;p=quix0rs-gnu-social.git diff --git a/lib/noticelist.php b/lib/noticelist.php index 20bf3c9f11..9fc0126b3e 100644 --- a/lib/noticelist.php +++ b/lib/noticelist.php @@ -203,11 +203,14 @@ class NoticeListItem extends Widget function showNoticeOptions() { - $this->out->elementStart('div', 'notice-options'); - $this->showFaveForm(); - $this->showReplyLink(); - $this->showDeleteLink(); - $this->out->elementEnd('div'); + $user = common_current_user(); + if ($user) { + $this->out->elementStart('div', 'notice-options'); + $this->showFaveForm(); + $this->showReplyLink(); + $this->showDeleteLink(); + $this->out->elementEnd('div'); + } } /** @@ -282,8 +285,8 @@ class NoticeListItem extends Widget $avatar = $this->profile->getAvatar($avatar_size); $this->out->element('img', array('src' => ($avatar) ? - common_avatar_display_url($avatar) : - common_default_avatar($avatar_size), + $avatar->displayUrl() : + Avatar::defaultImage($avatar_size), 'class' => 'avatar photo', 'width' => $avatar_size, 'height' => $avatar_size, @@ -440,19 +443,21 @@ class NoticeListItem extends Widget function showReplyLink() { - $reply_url = common_local_url('newnotice', - array('replyto' => $this->profile->nickname)); - - $this->out->elementStart('dl', 'notice_reply'); - $this->out->element('dt', null, _('Reply to this notice')); - $this->out->elementStart('dd'); - $this->out->elementStart('a', array('href' => $reply_url, - 'title' => _('Reply to this notice'))); - $this->out->text(_('Reply')); - $this->out->element('span', 'notice_id', $this->notice->id); - $this->out->elementEnd('a'); - $this->out->elementEnd('dd'); - $this->out->elementEnd('dl'); + if (common_logged_in()) { + $reply_url = common_local_url('newnotice', + array('replyto' => $this->profile->nickname)); + + $this->out->elementStart('dl', 'notice_reply'); + $this->out->element('dt', null, _('Reply to this notice')); + $this->out->elementStart('dd'); + $this->out->elementStart('a', array('href' => $reply_url, + 'title' => _('Reply to this notice'))); + $this->out->text(_('Reply')); + $this->out->element('span', 'notice_id', $this->notice->id); + $this->out->elementEnd('a'); + $this->out->elementEnd('dd'); + $this->out->elementEnd('dl'); + } } /**