summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/photos.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers/photos.php')
-rw-r--r--modules/gallery/controllers/photos.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 79ad674a..81e7519e 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -25,23 +25,23 @@ class Photos_Controller extends Items_Controller {
public function _show($photo) {
access::required("view", $photo);
- $position = $photo->parent()->get_position($photo->id);
+ $position = $photo->parent()->get_position($photo);
if ($position > 1) {
list ($previous_item, $ignore, $next_item) =
$photo->parent()->children(3, $position - 2);
} else {
$previous_item = null;
- list ($next_item) = $photo->parent()->children(1, $position);
+ list ($next_item) = $photo->parent()->viewable()->children(1, $position);
}
$template = new Theme_View("page.html", "photo");
$template->set_global("item", $photo);
$template->set_global("children", array());
- $template->set_global("children_count", $photo->children_count());
+ $template->set_global("children_count", 0);
$template->set_global("parents", $photo->parents());
$template->set_global("next_item", $next_item);
$template->set_global("previous_item", $previous_item);
- $template->set_global("sibling_count", $photo->parent()->children_count());
+ $template->set_global("sibling_count", $photo->parent()->viewable()->children_count());
$template->set_global("position", $position);
$template->content = new View("photo.html");