X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fshowstream.php;h=82a55518da60fdfafca3b770d25847d853a45757;hb=6396504aa60a3ae7505211ab7e99733b1c74267b;hp=c9b35ee0bbb4bc297e0733ea4f9e7173ec944846;hpb=a0bdc80053ce3b1d908aad6ab4a462b44b504e0c;p=quix0rs-gnu-social.git diff --git a/actions/showstream.php b/actions/showstream.php index c9b35ee0bb..82a55518da 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -59,7 +59,7 @@ class ShowstreamAction extends StreamAction { $this->show_last_notice($profile); - if ($cur) { + if ($cur && $cur->id != $profile->id) { if ($cur->isSubscribed($profile)) { $this->show_unsubscribe_form($profile); } else { @@ -125,7 +125,7 @@ class ShowstreamAction extends StreamAction { 'name' => 'subscribeto', 'type' => 'hidden', 'value' => $profile->nickname)); - common_element('input', array('type' => 'submit'), _t('subscribe')); + common_element('input', array('type' => 'submit', 'value' => _t('Subscribe'))); common_element_end('form'); } @@ -192,13 +192,25 @@ class ShowstreamAction extends StreamAction { $subs->subscriber = $profile->id; $subs_count = $subs->count(); + if (!$subs_count) { + $subs_count = 0; + } + $subbed = DB_DataObject::factory('subscription'); $subbed->subscribed = $profile->id; $subbed_count = $subbed->count(); + if (!$subbed_count) { + $subbed_count = 0; + } + $notices = DB_DataObject::factory('notice'); $notices->profile_id = $profile->id; $notice_count = $notices->count(); + + if (!$notice_count) { + $notice_count = 0; + } # Other stats...? common_element_start('dl', 'statistics'); @@ -220,7 +232,7 @@ class ShowstreamAction extends StreamAction { $page = $this->arg('page') || 1; - $notice->limit((($page-1)*NOTICES_PER_PAGE) + 1, NOTICES_PER_PAGE); + $notice->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE); $notice->find(); @@ -229,7 +241,7 @@ class ShowstreamAction extends StreamAction { while ($notice->fetch()) { $this->show_notice($notice); } - + # XXX: show a link for the next page common_element_end('div'); } @@ -237,7 +249,7 @@ class ShowstreamAction extends StreamAction { $notice = DB_DataObject::factory('notice'); $notice->profile_id = $profile->id; $notice->orderBy('created DESC'); - $notice->limit(1, 1); + $notice->limit(0, 1); $notice->find(); while ($notice->fetch()) {