From 89d8c0c6f2bfa3118acbfd9b40c980e4118586ba Mon Sep 17 00:00:00 2001 From: Ian Denhardt Date: Mon, 27 Dec 2010 22:08:36 -0500 Subject: [PATCH] automatically create a default photo album when a user's photos page is visited if none exist. --- plugins/GNUsocialPhotos/actions/photos.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/GNUsocialPhotos/actions/photos.php b/plugins/GNUsocialPhotos/actions/photos.php index 7adcaadadd..7f47974d77 100644 --- a/plugins/GNUsocialPhotos/actions/photos.php +++ b/plugins/GNUsocialPhotos/actions/photos.php @@ -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) { -- 2.39.5