summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-12 21:44:55 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-12 21:44:55 +0000
commitac06fcd26ca98a6025323d0cf79f5c25769c5a92 (patch)
tree53964662534a6ebd90bf3b9167af549fe29fc5b0
parent0cf2423bbe04e9fcd75272c42b2384c72b18b5a8 (diff)
Remove the Database::query call for deletes and updated and use
Database::delete or Database::update instead
-rw-r--r--core/helpers/graphics.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php
index f708435b..4292bcbb 100644
--- a/core/helpers/graphics.php
+++ b/core/helpers/graphics.php
@@ -71,8 +71,8 @@ class graphics_Core {
*/
static function remove_rules($module_name) {
$db = Database::instance();
- $result = $db->query("DELETE FROM `graphics_rules` WHERE `module_name` = '$module_name'");
- if ($result->count()) {
+ $status = $db->delete("graphics_rules", array("module_name" => $module_name));
+ if (count($status)) {
self::mark_dirty(true, true);
}
}
@@ -225,12 +225,16 @@ class graphics_Core {
* Mark thumbnails and resizes as dirty. They will have to be rebuilt.
*/
static function mark_dirty($thumbs, $resizes) {
- $db = Database::instance();
- if ($thumbs) {
- $db->query("UPDATE `items` SET `thumb_dirty` = 1");
- }
- if ($resizes) {
- $db->query("UPDATE `items` SET `resize_dirty` = 1");
+ if ($thumbs || $resizes) {
+ $db = Database::instance();
+ $fields = array();
+ if ($thumbs) {
+ $fields["thumb_dirty"] = 1;
+ }
+ if ($resizes) {
+ $fields["resize_dirty"] = 1;
+ }
+ $db->update("items", $fields, true);
}
$count = self::find_dirty_images_query()->count();