]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
automatically create a default photo album when a user's photos page is visited if...
authorIan Denhardt <ian@zenhack.net>
Tue, 28 Dec 2010 03:08:36 +0000 (22:08 -0500)
committerIan Denhardt <ian@zenhack.net>
Tue, 28 Dec 2010 03:08:36 +0000 (22:08 -0500)
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) {