diff options
Diffstat (limited to 'modules/gallery/controllers/albums.php')
-rw-r--r-- | modules/gallery/controllers/albums.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 3c1a0adf..319f1416 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -71,6 +71,7 @@ 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); @@ -81,7 +82,7 @@ class Albums_Controller extends Items_Controller { // 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. - Database::instance()->query( + db::query( "UPDATE {items} SET `view_count` = `view_count` + 1 WHERE `id` = $album->id"); print $template; @@ -131,16 +132,16 @@ class Albums_Controller extends Items_Controller { $form->edit_item->dirname->value != $album->name || $form->edit_item->slug->value != $album->slug) { // Make sure that there's not a conflict - if ($row = Database::instance() + if ($row = db::build() ->select(array("name", "slug")) ->from("items") - ->where("parent_id", $album->parent_id) - ->where("id <>", $album->id) - ->open_paren() - ->where("name", $form->edit_item->dirname->value) - ->orwhere("slug", $form->edit_item->slug->value) - ->close_paren() - ->get() + ->where("parent_id", "=", $album->parent_id) + ->where("id", "<>", $album->id) + ->and_open() + ->where("name", "=", $form->edit_item->dirname->value) + ->or_where("slug", "=", $form->edit_item->slug->value) + ->close() + ->execute() ->current()) { if ($row->name == $form->edit_item->dirname->value) { $form->edit_item->dirname->add_error("name_conflict", 1); |