prev/next navigation in album view breaks on deleted photos

Posted by tvman at 15:11 on 3rd Jan 2012
I encountered an issue when deleted some photos in the middle of an album. In the album view the "End" icon will be displayed at the point of deleted photo and you have to return to the thumbnails view to get over it.

It can be fixed as follows:

In the file lib/photos.php
function _printPhoto() line 117

===================================
$prev=$photo[13]-1;
$next=$photo[13]+1;
$sql="SELECT photoID,photoName FROM shutter_photos WHERE albumOrder<=".$prev." AND albumID=".$photo[0]." ORDER BY albumOrder DESC LIMIT 1";
$query=mysql_query($sql);
$prevphoto=mysql_fetch_row($query);
$sql="SELECT photoID,photoName FROM shutter_photos WHERE albumOrder>=".$next." AND albumID=".$photo[0]." ORDER BY albumOrder LIMIT 1";
$query=mysql_query($sql);

==============================


Reply To This Topic

You must log in or register to reply to this topic.

Current Version

Version: 0.1.4

Updates: Possible SQL injection vunerability and css formatting issues addressed.

Download the latest release.