diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-04 09:50:49 -0800 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-11-04 09:50:49 -0800 |
commit | 88852c45eac5981a4cd82f3207df1fad0cf51fcc (patch) | |
tree | d22d9c7894ae200fcdd7c25c69e73d232dace42f /modules/gallery/controllers/movies.php | |
parent | baca223e1d5a5d495b41b0232d2528a776bbc49c (diff) |
Modified the so that a where clause can be passed into item::get_position. Was also able to remove the sub-select from the calculation of the current position as we already have the child item containing the sort column value.
Also added a where clause that ignores albums to the get_position, children and children_count method calls in photos.php and movies.php
Diffstat (limited to 'modules/gallery/controllers/movies.php')
-rw-r--r-- | modules/gallery/controllers/movies.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php index 01a9fc8b..6200e8b4 100644 --- a/modules/gallery/controllers/movies.php +++ b/modules/gallery/controllers/movies.php @@ -25,13 +25,14 @@ class Movies_Controller extends Items_Controller { public function _show($movie) { access::required("view", $movie); - $position = $movie->parent()->get_position($movie); + $where = array("type != " => "album"); + $position = $movie->parent()->get_position($movie, $where); if ($position > 1) { list ($previous_item, $ignore, $next_item) = - $movie->parent()->children(3, $position - 2); + $movie->parent()->children(3, $position - 2, $where); } else { $previous_item = null; - list ($next_item) = $movie->parent()->viewable()->children(1, $position); + list ($next_item) = $movie->parent()->viewable()->children(1, $position, $where); } $template = new Theme_View("page.html", "movie"); @@ -41,7 +42,7 @@ class Movies_Controller extends Items_Controller { $template->set_global("parents", $movie->parents()); $template->set_global("next_item", $next_item); $template->set_global("previous_item", $previous_item); - $template->set_global("sibling_count", $movie->parent()->viewable()->children_count()); + $template->set_global("sibling_count", $movie->parent()->viewable()->children_count($where)); $template->set_global("position", $position); $template->content = new View("movie.html"); |