off-by-one error in subscriptions

darcs-hash:20080521190640-84dde-04fc00048b044474488e7774053674231c96e355.gz
This commit is contained in:
Evan Prodromou 2008-05-21 15:06:40 -04:00
parent b791a83592
commit 0f0d50f06a
3 changed files with 10 additions and 3 deletions

View File

@ -159,7 +159,14 @@ class ShowstreamAction extends StreamAction {
global $config; global $config;
# XXX: add a limit # 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'); common_element_start('div', 'subscriptions');

View File

@ -49,7 +49,7 @@ class SubscribedAction extends Action {
# We ask for an extra one to know if we need to do another page # 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(); $subs_count = $subs->find();

View File

@ -45,7 +45,7 @@ class SubscriptionsAction extends Action {
# We ask for an extra one to know if we need to do another page # 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(); $subs_count = $subs->find();