From: Ian Denhardt Date: Tue, 28 Dec 2010 03:08:36 +0000 (-0500) Subject: automatically create a default photo album when a user's photos page is visited if... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=89d8c0c6f2bfa3118acbfd9b40c980e4118586ba;p=quix0rs-gnu-social.git automatically create a default photo album when a user's photos page is visited if none exist. --- 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) {