summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.build_number2
-rw-r--r--modules/gallery/helpers/graphics.php3
-rw-r--r--modules/search/helpers/search.php12
3 files changed, 7 insertions, 10 deletions
diff --git a/.build_number b/.build_number
index dd7bd0c9..6d8dc21b 100644
--- a/.build_number
+++ b/.build_number
@@ -3,4 +3,4 @@
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
-build_number=179
+build_number=182
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php
index 3548faa1..06cab788 100644
--- a/modules/gallery/helpers/graphics.php
+++ b/modules/gallery/helpers/graphics.php
@@ -229,7 +229,6 @@ class graphics_Core {
return db::build()
->from("items")
->and_open()
- ->and_open()
->where("thumb_dirty", "=", 1)
->and_open()
->where("type", "<>", "album")
@@ -239,8 +238,6 @@ class graphics_Core {
->where("resize_dirty", "=", 1)
->where("type", "=", "photo")
->close()
- ->close()
- ->where("id", "<>", 1)
->close();
}
diff --git a/modules/search/helpers/search.php b/modules/search/helpers/search.php
index d6d67c29..ab6da802 100644
--- a/modules/search/helpers/search.php
+++ b/modules/search/helpers/search.php
@@ -112,22 +112,22 @@ class search_Core {
static function get_position($item, $q) {
$page_size = module::get_var("gallery", "page_size", 9);
-
$query = self::_build_query_base($q, array("{items}.id = " . $item->id));
-
$db = Database::instance();
// Truncate the score by two decimal places as this resolves the issues
// that arise due to in exact numeric conversions.
$score = $db->query($query)->current()->score;
- $score = substr($score, 0, strlen($score) - 2);
+ if (strlen($score) > 7) {
+ $score = substr($score, 0, strlen($score) - 2);
+ }
$data = $db->query(self::_build_query_base($q) . " HAVING `score` >= " . $score);
-
$data->seek($data->count() - 1);
- while ($data->get("id") != $item->id && $data->prev()->valid());
+ while ($data->get("id") != $item->id && $data->prev()->valid()) {
+ }
- return $data->key() + 1;
+ return $data->key() + 1;
}
}