]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GNUsocialPhotos/actions/photos.php
Added gallery links to previous / next pages.
[quix0rs-gnu-social.git] / plugins / GNUsocialPhotos / actions / photos.php
index 83060dc57375a6e47b0181cdc1256d516437d92a..368f806ff942501039f4244c3416cec931323940 100644 (file)
@@ -22,6 +22,7 @@
  * @category  Widget
  * @package   GNU Social
  * @author    Ian Denhardt <ian@zenhack.net>
+ * @author    Sean Corbett <sean@gnu.org>
  * @copyright 2010 Free Software Foundation, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
  */
@@ -85,10 +86,23 @@ class PhotosAction extends Action
             }
             $pathparts = explode('/', $args[1]['nickname']);
             $username = $pathparts[0];
-            $this->elementStart('ul', array('class' => 'photothumbs'));
 
-                       $photos = GNUsocialPhoto::getGalleryPage(1, 0, 9);
+                        
+
+            $page = $_GET['pageid'];
+            if (!filter_var($page, FILTER_VALIDATE_INT)){
+                $page = 1;
+            }
+   
+            if ($page > 1) { 
+                $this->element('a', array('href' => 'photos?pageid=' . ($page-1)), 'Previous page');
+            }
+            $this->element('a', array('href' => 'photos?pageid=' . ($page+1) ), 'Next page');
+
+            //TODO need to set album ID..
+                       $photos = GNUsocialPhoto::getGalleryPage($page, 0, 9);
 
+            $this->elementStart('ul', array('class' => 'photothumbs'));
             foreach ($photos as $photo) {
                 $this->elementStart('li');
                 $this->elementStart('a', array('href' => $photo->uri));