automatically create a default photo album when a user's photos page is visited if none exist.

This commit is contained in:
Ian Denhardt 2010-12-27 22:08:36 -05:00
parent d61f88b979
commit 89d8c0c6f2

View File

@ -85,6 +85,9 @@ class PhotosAction extends Action
//TODO choice of available albums by user.
//Currently based on fact that each user can only have one album.
$album = GNUSocialPhotoAlbum::staticGet('profile_id', $this->user->id);
if (!$album) {
$album = GNUSocialPhotoAlbum::newAlbum($this->user->id, 'Default');
}
$photos = GNUsocialPhoto::getGalleryPage($page, $album->album_id, 9);
if ($page > 1) {