summaryrefslogtreecommitdiff
path: root/modules/exif/helpers/exif.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-12-26 11:24:50 -0800
committerTim Almdal <tnalmdal@shaw.ca>2009-12-26 11:24:50 -0800
commit3060a6f662da66008d57a461bf1c9b5b4aa2b002 (patch)
tree442fd290505817efc0324f2af6e01805cb7396aa /modules/exif/helpers/exif.php
parent1cd6a615bb47a33794e4a4f690c87a348ab752d7 (diff)
parent32d25dafd5b033338b6a9bb8c7c53edab462543a (diff)
Merge branch 'master' into talmdal_dev
Conflicts: modules/gallery/controllers/albums.php modules/gallery/controllers/movies.php modules/gallery/controllers/photos.php
Diffstat (limited to 'modules/exif/helpers/exif.php')
-rw-r--r--modules/exif/helpers/exif.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/modules/exif/helpers/exif.php b/modules/exif/helpers/exif.php
index 5ddd09d4..3baed177 100644
--- a/modules/exif/helpers/exif.php
+++ b/modules/exif/helpers/exif.php
@@ -39,7 +39,7 @@ class exif_Core {
if (function_exists("mb_detect_encoding") && mb_detect_encoding($value) != "UTF-8") {
$value = utf8_encode($value);
}
- $keys[$field] = utf8::clean($value);
+ $keys[$field] = Input::clean($value);
if ($field == "DateTime") {
$time = strtotime($value);
@@ -62,7 +62,7 @@ class exif_Core {
if (function_exists("mb_detect_encoding") && mb_detect_encoding($value) != "UTF-8") {
$value = utf8_encode($value);
}
- $keys[$keyword] = utf8::clean($value);
+ $keys[$keyword] = Input::clean($value);
if ($keyword == "Caption" && !$item->description) {
$item->description = $value;
@@ -73,8 +73,8 @@ class exif_Core {
}
$item->save();
- $record = ORM::factory("exif_record")->where("item_id", $item->id)->find();
- if (!$record->loaded) {
+ $record = ORM::factory("exif_record")->where("item_id", "=", $item->id)->find();
+ if (!$record->loaded()) {
$record->item_id = $item->id;
}
$record->data = serialize($keys);
@@ -86,9 +86,9 @@ class exif_Core {
static function get($item) {
$exif = array();
$record = ORM::factory("exif_record")
- ->where("item_id", $item->id)
+ ->where("item_id", "=", $item->id)
->find();
- if (!$record->loaded) {
+ if (!$record->loaded()) {
return array();
}
@@ -139,19 +139,19 @@ class exif_Core {
}
static function stats() {
- $missing_exif = Database::instance()
+ $missing_exif = db::build()
->select("items.id")
->from("items")
->join("exif_records", "items.id", "exif_records.item_id", "left")
- ->where("type", "photo")
- ->open_paren()
- ->where("exif_records.item_id", null)
- ->orwhere("exif_records.dirty", 1)
- ->close_paren()
- ->get()
+ ->where("type", "=", "photo")
+ ->and_open()
+ ->where("exif_records.item_id", "IS", null)
+ ->or_where("exif_records.dirty", "=", 1)
+ ->close()
+ ->execute()
->count();
- $total_items = ORM::factory("item")->where("type", "photo")->count_all();
+ $total_items = ORM::factory("item")->where("type", "=", "photo")->count_all();
if (!$total_items) {
return array(0, 0, 0);
}