]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
off-by-one error in subscriptions
authorEvan Prodromou <evan@prodromou.name>
Wed, 21 May 2008 19:06:40 +0000 (15:06 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 21 May 2008 19:06:40 +0000 (15:06 -0400)
darcs-hash:20080521190640-84dde-04fc00048b044474488e7774053674231c96e355.gz

actions/showstream.php
actions/subscribed.php
actions/subscriptions.php

index bf9df04a3488fdf66a2168e4b24c36485ca6738e..984c2454b16202419b4d47a23d25e1180479caf0 100644 (file)
@@ -159,7 +159,14 @@ class ShowstreamAction extends StreamAction {
                global $config;
                
                # XXX: add a limit
-               $subs = $profile->getLink('id', 'subscription', 'subscriber');
+               $subs = DB_DataObject::factory('subscription');
+               $subs->subscriber = $profile->id;
+
+               # We ask for an extra one to know if we need to do another page
+
+               $subs->limit(0, SUBSCRIPTIONS);
+
+               $subs_count = $subs->find();
 
                common_element_start('div', 'subscriptions');
 
index 3218e07b868c71eb21f8685151692e1108086b66..e8df331ee67388905e3a60aab5e3491a99121b78 100644 (file)
@@ -49,7 +49,7 @@ class SubscribedAction extends Action {
 
                # We ask for an extra one to know if we need to do another page
 
-               $subs->limit((($page-1)*SUBSCRIPTIONS_PER_PAGE)+1, SUBSCRIPTIONS_PER_PAGE + 1);
+               $subs->limit((($page-1)*SUBSCRIPTIONS_PER_PAGE), SUBSCRIPTIONS_PER_PAGE + 1);
 
                $subs_count = $subs->find();
 
index f111d0be2e5a7180c0be884028fa4ab4bfcf64de..3ec7a0122000d26070a6068514e1f3a34c712300 100644 (file)
@@ -45,7 +45,7 @@ class SubscriptionsAction extends Action {
 
                # We ask for an extra one to know if we need to do another page
 
-               $subs->limit((($page-1)*SUBSCRIPTIONS_PER_PAGE)+1, SUBSCRIPTIONS_PER_PAGE + 1);
+               $subs->limit((($page-1)*SUBSCRIPTIONS_PER_PAGE), SUBSCRIPTIONS_PER_PAGE + 1);
 
                $subs_count = $subs->find();