off-by-one error in subscriptions
darcs-hash:20080521190640-84dde-04fc00048b044474488e7774053674231c96e355.gz
This commit is contained in:
parent
b791a83592
commit
0f0d50f06a
|
@ -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');
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user