]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
pages and limits
authorEvan Prodromou <evan@prodromou.name>
Fri, 18 Jul 2008 05:25:57 +0000 (01:25 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 18 Jul 2008 05:25:57 +0000 (01:25 -0400)
darcs-hash:20080718052557-84dde-65d7411377b866a66474584e90dc08ea3eb432b0.gz

actions/twitapistatuses.php

index a384cc75bed317b93fde481092003383ad5e9bbf..96931fec634949caef800d55219a1d46ce25d31e 100644 (file)
@@ -639,24 +639,26 @@ class TwitapistatusesAction extends TwitterapiAction {
                $user = $this->get_subs_user($apidata);
                
                # XXX: id
-               # XXX: page
                # XXX: lite
                
+               $page = $this->trimmed('page');
+               
+               if (!$page || !is_numeric($page)) {
+                       $page = 1;
+               }
+               
                $profile = $user->getProfile();
                
                if (!$profile) {
                        common_server_error(_('User has no profile.'));
                        return;
                }
-                                                               
-               if (!$page) {
-                       $page = 1;
-               }
                                
                $sub = new Subscription();
                $sub->$user_attr = $profile->id;
                $sub->orderBy('created DESC');
-
+               $sub->limit(($page-1)*100, 100);
+               
                $others = array();
 
                if ($sub->find()) {