]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GNUsocialPhotos/classes/gnusocialphotoalbum.php
Photo albums on photos page
[quix0rs-gnu-social.git] / plugins / GNUsocialPhotos / classes / gnusocialphotoalbum.php
index ed18f1f338b2a22faa6df9f47fdd34cd7650c107..848f92dffabdaed1488a71f2d23314b15cf65437 100644 (file)
@@ -74,6 +74,20 @@ class GNUsocialPhotoAlbum extends Memcached_DataObject
         return array('album_id', true, false);
     }
 
+    function getPageLink()
+    {
+        $profile = Profile::StaticGet('id', $this->profile_id);
+        return '/' . $profile->nickname . '/photos/' . $this->album_id;
+    }
+
+    function getThumbUri()
+    {
+        $photo = GNUsocialPhoto::staticGet('album_id', $this->album_id);
+        if (empty($photo))
+            return '/theme/default/default-avatar-profile.png'; //For now...
+        return $photo->thumb_uri;
+    }
+
     static function newAlbum($profile_id, $album_name, $album_description)
     {
         //TODO: Should use foreign key instead...
@@ -94,6 +108,6 @@ class GNUsocialPhotoAlbum extends Memcached_DataObject
         }
         common_log(LOG_INFO, 'album_id : ' . $album->album_id);
         return $album;
-    } 
+    }
 
 }