diff options
| author | Chad Kieffer <ckieffer@gmail.com> | 2011-01-04 15:59:26 -0700 |
|---|---|---|
| committer | Chad Kieffer <ckieffer@gmail.com> | 2011-01-04 15:59:26 -0700 |
| commit | e921c3c5b5b8f963f121601d346c50a24bc0cf15 (patch) | |
| tree | a29064762c3b37812596cb82c3e910f7321a85b2 /modules/gallery/controllers/albums.php | |
| parent | dbff45cc91ac44f18ef02b8abdd220a2864f050f (diff) | |
| parent | d74aad072d8ccca70efb1c8b673e8368566a1974 (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/controllers/albums.php')
| -rw-r--r-- | modules/gallery/controllers/albums.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index b0887195..25df0da7 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -61,20 +61,18 @@ class Albums_Controller extends Items_Controller { } $template = new Theme_View("page.html", "collection", "album"); - $template->set_global("page", $page); - $template->set_global("page_title", null); - $template->set_global("max_pages", $max_pages); - $template->set_global("page_size", $page_size); - $template->set_global("item", $album); - $template->set_global("children", $album->viewable()->children($page_size, $offset)); - $template->set_global("children_count", $children_count); - $template->set_global("parents", $album->parents()->as_array()); // view calls empty() on this + $template->set_global( + array("page" => $page, + "page_title" => null, + "max_pages" => $max_pages, + "page_size" => $page_size, + "item" => $album, + "children" => $album->viewable()->children($page_size, $offset), + "parents" => $album->parents()->as_array(), // view calls empty() on this + "children_count" => $children_count)); $template->content = new View("album.html"); - // We can't use math in ORM or the query builder, so do this by hand. It's important - // that we do this with math, otherwise concurrent accesses will damage accuracy. - db::query("UPDATE {items} SET `view_count` = `view_count` + 1 WHERE `id` = $album->id") - ->execute(); + $album->increment_view_count(); print $template; } |
