]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/showstream.php
better deletion of old avatars
[quix0rs-gnu-social.git] / actions / showstream.php
index c9b35ee0bbb4bc297e0733ea4f9e7173ec944846..82a55518da60fdfafca3b770d25847d853a45757 100644 (file)
@@ -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()) {