+
+ /*
+ * TODO: -Sanitize input
+ * @param int page_id The desired page of the gallery to show.
+ * @param int album_id The id of the album to get photos from.
+ * @param int gallery_size The number of thumbnails to show per page in the gallery.
+ * @return array Array of GNUsocialPhotos for this gallery page.
+ */
+ function getGalleryPage($page_id, $album_id, $gallery_size)
+ {
+ $page_offset = ($page_id-1) * $gallery_size;
+ $sql = 'SELECT * FROM GNUsocialPhoto order by notice_id limit ' . $page_offset . ',' . $gallery_size;
+ $this->query($sql);
+ $thumbs = array();
+
+ while ($this->fetch()) {
+ $thumbs[] = clone($this);
+ }
+
+ return $thumbs;
+ }
+