summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/albums.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers/albums.php')
-rw-r--r--modules/gallery/controllers/albums.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 3c1a0adf..76032655 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;
@@ -134,12 +135,12 @@ class Albums_Controller extends Items_Controller {
if ($row = Database::instance()
->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()
+ ->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()
->get()
->current()) {
if ($row->name == $form->edit_item->dirname->value) {