summaryrefslogtreecommitdiff
path: root/FisheyeBase.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2006-01-15 06:46:36 +0000
committerChristian Fowler <spider@viovio.com>2006-01-15 06:46:36 +0000
commit86d050555536975ca942ea2aede2ef4cda59d1af (patch)
tree27009f8d945cfe81e5613d76f86fa3ed8f3f9f5b /FisheyeBase.php
parent7911b3404f7032dd79eb78b766c22375fcf2f8a7 (diff)
downloadfisheye-86d050555536975ca942ea2aede2ef4cda59d1af.tar.gz
fisheye-86d050555536975ca942ea2aede2ef4cda59d1af.tar.bz2
fisheye-86d050555536975ca942ea2aede2ef4cda59d1af.zip
Woot! my first ReleaseTwo commit. Have added simple table to hold list of favorite user content_id's
Diffstat (limited to 'FisheyeBase.php')
-rw-r--r--FisheyeBase.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/FisheyeBase.php b/FisheyeBase.php
index f70269f..345ea4f 100644
--- a/FisheyeBase.php
+++ b/FisheyeBase.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeBase.php,v 1.12 2005/12/26 12:23:58 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeBase.php,v 1.13 2006/01/15 06:46:36 spiderr Exp $
* @package fisheye
*/
@@ -56,8 +56,10 @@ class FisheyeBase extends LibertyAttachable
function updatePosition($pGalleryContentId, $newPosition = NULL) {
if( $pGalleryContentId && $newPosition && $this->verifyId($this->mContentId) ) {
- $sql = "UPDATE `".BIT_DB_PREFIX."tiki_fisheye_gallery_image_map` SET `position` = ? WHERE `item_content_id` = ? AND `gallery_content_id` = ?";
- $rs = $this->mDb->query($sql, array($newPosition, $this->mContentId, $pGalleryContentId));
+ // SQL optimization to prevent stupid updates of identical data
+ $sql = "UPDATE `".BIT_DB_PREFIX."tiki_fisheye_gallery_image_map` SET `position` = ?
+ WHERE `item_content_id` = ? AND `gallery_content_id` = ? AND `position`!=?";
+ $rs = $this->mDb->query($sql, array($newPosition, $this->mContentId, $pGalleryContentId, $newPosition));
}
}