]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
better pagination and no rows in subscriptions and subscribed
authorEvan Prodromou <evan@prodromou.name>
Wed, 18 Jun 2008 16:50:41 +0000 (12:50 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 18 Jun 2008 16:50:41 +0000 (12:50 -0400)
darcs-hash:20080618165041-84dde-d98bebb8e74286993c582710ae385d5d7ef1b3fb.gz

actions/subscribed.php
actions/subscriptions.php

index 2b5bbd1b88093b7d8ac7bc605a36f478f38e0cdd..d59af0a53d49a76965e2bc533c22a5e31321400f 100644 (file)
@@ -75,9 +75,6 @@ class SubscribedAction extends Action {
 
                while ($subs->fetch()) {
                        $idx++;
-                       if ($idx % SUBSCRIPTIONS_PER_ROW == 1) {
-                               common_element_start('div', 'row');
-                       }
 
                        $other = Profile::staticGet($subs->subscriber);
                        
@@ -98,32 +95,14 @@ class SubscribedAction extends Action {
 
                        # XXX: subscribe form here
 
-                       if ($idx % SUBSCRIPTIONS_PER_ROW == 0) {
-                               common_element_end('div');
-                       }
-
                        if ($idx == SUBSCRIPTIONS_PER_PAGE) {
                                break;
                        }
                }
 
-               if ($page > 1) {
-                       common_element('a', array('href' =>
-                                                                         common_local_url('subscriptions',
-                                                                                                          array('nickname' => $profile->nickname,
-                                                                                                                        'page' => $page - 1)),
-                                                                         'class' => 'prev'),
-                                          _t('Previous'));
-               }
-
-               if ($subs_count > SUBSCRIPTIONS_PER_PAGE) {
-                       common_element('a', array('href' =>
-                                                                         common_local_url('subscriptions',
-                                                                                                          array('nickname' => $profile->nickname,
-                                                                                                                        'page' => $page + 1)),
-                                                                         'class' => 'next'),
-                                          _t('Next'));
-               }
                common_element_end('div');
+               
+               common_pagination($page > 1, $subs_count > SUBSCRIPTIONS_PER_PAGE,
+                                                 $page, 'subscribed', array('nickname' => $profile->nickname));
        }
 }
\ No newline at end of file
index 35a707894424731869324adefb39e5fec9b95e36..e5db39bcecd3cea2dcc08f1fdff9f6f179fc1984 100644 (file)
@@ -72,9 +72,6 @@ class SubscriptionsAction extends Action {
                while ($subs->fetch()) {
                        
                        $idx++;
-                       if ($idx % SUBSCRIPTIONS_PER_ROW == 1) {
-                               common_element_start('div', 'row');
-                       }
 
                        $other = Profile::staticGet($subs->subscribed);
                        
@@ -98,32 +95,14 @@ class SubscriptionsAction extends Action {
 
                        # XXX: subscribe form here
 
-                       if ($idx % SUBSCRIPTIONS_PER_ROW == 0) {
-                               common_element_end('div');
-                       }
-
                        if ($idx == SUBSCRIPTIONS_PER_PAGE) {
                                break;
                        }
                }
 
-               if ($page > 1) {
-                       common_element('a', array('href' =>
-                                                                         common_local_url('subscriptions',
-                                                                                                          array('nickname' => $profile->nickname,
-                                                                                                                        'page' => $page - 1)),
-                                                                         'class' => 'prev'),
-                                          _t('Previous'));
-               }
-
-               if ($subs_count > SUBSCRIPTIONS_PER_PAGE) {
-                       common_element('a', array('href' =>
-                                                                         common_local_url('subscriptions',
-                                                                                                          array('nickname' => $profile->nickname,
-                                                                                                                        'page' => $page + 1)),
-                                                                         'class' => 'next'),
-                                          _t('Next'));
-               }
                common_element_end('div');
+               
+               common_pagination($page > 1, $subs_count > SUBSCRIPTIONS_PER_PAGE,
+                                                 $page, 'subscriptions', array('nickname' => $profile->nickname));
        }
 }
\ No newline at end of file