[pLog-svn] r2019 - plog/branches/plog-1.0.1/class/gallery/dao

jondaley at devel.plogworld.net jondaley at devel.plogworld.net
Thu May 19 11:05:23 GMT 2005


Author: jondaley
Date: 2005-05-19 11:05:23 +0000 (Thu, 19 May 2005)
New Revision: 2019

Modified:
   plog/branches/plog-1.0.1/class/gallery/dao/galleryresources.class.php
Log:
next/previous now works with resources with the same timestamp.  http://bugs.plogworld.net/view.php?id=523

Modified: plog/branches/plog-1.0.1/class/gallery/dao/galleryresources.class.php
===================================================================
--- plog/branches/plog-1.0.1/class/gallery/dao/galleryresources.class.php	2005-05-19 10:29:22 UTC (rev 2018)
+++ plog/branches/plog-1.0.1/class/gallery/dao/galleryresources.class.php	2005-05-19 11:05:23 UTC (rev 2019)
@@ -129,12 +129,13 @@
 			$prefix = $this->getPrefix();
 			$albumId = $resource->getAlbumId();
 			$date = $resource->getDate();
+			$id = $resource->getId();
 			$query = "SELECT id, owner_id, album_id, description,
         	                 date, flags, resource_type, file_path, file_name,
         	                 metadata, thumbnail_format 
         	          FROM {$prefix}gallery_resources 
-			          WHERE album_id = '$albumId' AND date > '$date' 
-					  ORDER BY date ASC LIMIT 1";
+			          WHERE album_id = '$albumId' AND date >= '$date' AND id > $id
+					  ORDER BY date ASC,id ASC LIMIT 1";
 
 			$result = $this->Execute( $query );
 			
@@ -162,12 +163,13 @@
 			$prefix = $this->getPrefix();
 			$albumId = $resource->getAlbumId();
 			$date = $resource->getDate();
+			$id = $resource->getId();
 			$query = "SELECT id, owner_id, album_id, description,
         	                 date, flags, resource_type, file_path, file_name,
         	                 metadata, thumbnail_format 
         	          FROM {$prefix}gallery_resources 
-			          WHERE album_id = '$albumId' AND date < '$date' 
-					  ORDER BY date DESC LIMIT 1";
+			          WHERE album_id = '$albumId' AND date <= '$date' AND id < $id
+					  ORDER BY date DESC,id DESC LIMIT 1";
 
 			$result = $this->Execute( $query );
 			




More information about the pLog-svn mailing list