]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GNUsocialPhotos/actions/photos.php
automatically create a default photo album when a user's photos page is visited if...
[quix0rs-gnu-social.git] / plugins / GNUsocialPhotos / actions / photos.php
index 7adcaadadd5dcbd0d43b8c082bcde3cece6adc94..7f47974d771a1430bfeba7f4359a60883336d703 100644 (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) {