diff options
author | Evan Prodromou <evan@prodromou.name> | 2008-06-18 13:24:44 -0400 |
---|---|---|
committer | Evan Prodromou <evan@prodromou.name> | 2008-06-18 13:24:44 -0400 |
commit | f341780e1ff56a02d3283a1fb380f4fa0ac34ae9 (patch) | |
tree | 9fd3b27795b75d0844b32f8b405de99db83f965a /lib | |
parent | 78ac9df2a626fe1da4f9d864ca17ae19ee6d1c75 (diff) |
more subscriptions/subscribers changes
Showstream now shows subscriptions in reverse chron order, like the
other pages.
Added a callback method to figure out who the _other_ guy is in a
subscription.
Changed gallery page to be a UL of images.
darcs-hash:20080618172444-84dde-b886f6f8170370ae1aaf2e7f996aff288a471145.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gallery.php | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/lib/gallery.php b/lib/gallery.php index 6d21b8310..d0c55d634 100644 --- a/lib/gallery.php +++ b/lib/gallery.php @@ -68,15 +68,25 @@ class GalleryAction extends Action { $subs_count = $subs->find(); - common_element_start('div', $this->div_class()); - - $idx = 0; + if ($subs_count == 0) { + common_element('p', _t('Nobody to show!')); + return; + } + + common_element_start('ul', $this->div_class()); - while ($subs->fetch()) { + for ($idx = 0; $idx < min($subs_count, AVATARS_PER_PAGE); $idx++) { + + $result = $subs->fetch(); - $idx++; + if (!$result) { + common_debug('Ran out of subscribers too early.', __FILE__); + break; + } - $other = Profile::staticGet($subs->subscribed); + $other = Profile::staticGet($this->get_other($subs)); + + common_element_start('li'); common_element_start('a', array('title' => ($other->fullname) ? $other->fullname : @@ -97,14 +107,12 @@ class GalleryAction extends Action { common_element_end('a'); # XXX: subscribe form here - - if ($idx == AVATARS_PER_PAGE) { - break; - } + + common_element_end('li'); } - common_element_end('div'); - + common_element_end('ul'); + common_pagination($page > 1, $subs_count > AVATARS_PER_PAGE, $page, @@ -123,6 +131,10 @@ class GalleryAction extends Action { function define_subs(&$subs, &$profile) { return; } + + function get_other(&$subs) { + return NULL; + } function div_class() { return ''; |