summaryrefslogtreecommitdiff
path: root/plugins/GNUsocialPhotos/actions/photos.php
diff options
context:
space:
mode:
authorSean Corbett <sean@gnu.org>2010-09-05 14:16:46 -0400
committerSean Corbett <sean@gnu.org>2010-09-05 14:16:46 -0400
commit1b601160f423cfd7e195e8c2a4f6fc7a9cab7331 (patch)
treebcc23f0638ddda6ce3c6c197a061aa10f699118a /plugins/GNUsocialPhotos/actions/photos.php
parent2f06e2904251dbf7e8fe1211eda585c46971b1b5 (diff)
Changes to only display currently viewed profile's pictures.
Diffstat (limited to 'plugins/GNUsocialPhotos/actions/photos.php')
-rw-r--r--plugins/GNUsocialPhotos/actions/photos.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/GNUsocialPhotos/actions/photos.php b/plugins/GNUsocialPhotos/actions/photos.php
index 368f806ff..a9f76042b 100644
--- a/plugins/GNUsocialPhotos/actions/photos.php
+++ b/plugins/GNUsocialPhotos/actions/photos.php
@@ -99,8 +99,20 @@ class PhotosAction extends Action
}
$this->element('a', array('href' => 'photos?pageid=' . ($page+1) ), 'Next page');
- //TODO need to set album ID..
- $photos = GNUsocialPhoto::getGalleryPage($page, 0, 9);
+ $args = $this->returnToArgs();
+ $profile_nick = $args[1]['nickname']; //Nickname for the profile being looked at
+
+ //TODO choice of available albums by user.
+ //Currently based on fact that each user can only have one album.
+ error_log('profile nick:', 3, '/tmp/sean.log');
+ error_log($profile_nick, 3, '/tmp/sean.log');
+ $profile = Profile::staticGet('nickname', $profile_nick);
+ //error_log(',profile_id:', 3, '/tmp/sean.log');
+ //error_log($profile->id, 3, '/tmp/sean.log');
+ $album = GNUSocialPhotoAlbum::staticGet('profile_id', $profile->id);
+ //error_log(',album_id:', 3, '/tmp/sean.log');
+ //error_log($album->album_id, 3, '/tmp/sean.log');
+ $photos = GNUsocialPhoto::getGalleryPage($page, $album->album_id, 9);
$this->elementStart('ul', array('class' => 'photothumbs'));
foreach ($photos as $photo) {