summaryrefslogtreecommitdiff
path: root/FisheyeGallery.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2007-06-25 20:02:30 +0000
committerChristian Fowler <spider@viovio.com>2007-06-25 20:02:30 +0000
commita2c6868b261bddf8fe68049868e4ead4e1ef36b1 (patch)
tree54009515cf66e2d0e203c4215515e3e7e92c680e /FisheyeGallery.php
parent254b4a0eddfa75edeb89f0f1337757758a242379 (diff)
downloadfisheye-a2c6868b261bddf8fe68049868e4ead4e1ef36b1.tar.gz
fisheye-a2c6868b261bddf8fe68049868e4ead4e1ef36b1.tar.bz2
fisheye-a2c6868b261bddf8fe68049868e4ead4e1ef36b1.zip
when retrieving thumbnail via advanced postgres, remove fisheyeimage restriction for thumbnail and get content_type_guid
Diffstat (limited to 'FisheyeGallery.php')
-rw-r--r--FisheyeGallery.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/FisheyeGallery.php b/FisheyeGallery.php
index 031c304..0fbaeb2 100644
--- a/FisheyeGallery.php
+++ b/FisheyeGallery.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeGallery.php,v 1.61 2007/06/24 07:10:15 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_fisheye/FisheyeGallery.php,v 1.62 2007/06/25 20:02:30 spiderr Exp $
* @package fisheye
*/
@@ -343,13 +343,14 @@ class FisheyeGallery extends FisheyeBase {
$whereSql = " AND (cgm.`security_id` IS NULL OR lc.`user_id`=?) ";
$bindVars[] = $gBitUser->mUserId;
}
- $query = "SELECT COALESCE( fg.`preview_content_id`, lc.`content_id` )
+ $query = "SELECT COALESCE( fg.`preview_content_id`, lc.`content_id` ) AS `content_id`, lc.`content_type_guid`
FROM connectby('`".BIT_DB_PREFIX."fisheye_gallery_image_map`', '`item_content_id`', '`gallery_content_id`', ?, 0, '/') AS t(`cb_item_content_id` int, `cb_parent_content_id` int, `level` int, `branch` text)
INNER JOIN liberty_content lc ON(content_id=cb_item_content_id)
LEFT OUTER JOIN `".BIT_DB_PREFIX."gatekeeper_security_map` cgm ON (cgm.`content_id`=lc.`content_id`), `".BIT_DB_PREFIX."fisheye_gallery` fg
- WHERE lc.`content_type_guid`='fisheyeimage' $whereSql AND `cb_parent_content_id`=fg.`content_id`"; // ORDER BY RANDOM() is DOG slow (seq scans)
- if( $pThumbnailContentId = $this->mDb->getOne( $query, $bindVars ) ) {
- $pThumbnailContentType = 'fisheyeimage';
+ WHERE `cb_parent_content_id`=fg.`content_id` $whereSql "; // ORDER BY RANDOM() is DOG slow (seq scans)
+ if( $row = $this->mDb->getRow( $query, $bindVars ) ) {
+ $pThumbnailContentType = $row['content_type_guid'];
+ $pThumbnailContentId = $row['content_id'];
}
} else {
$query = "SELECT fgim.`item_content_id`, lc.`content_type_guid`