I was thinking that it might be a nice feature to have a "previous resource" and "next resource" links to see the resources one after each other without to have to go to the thumbnails page everytime !
Does is seems to be a good idea?
I found that in the file class/gallery/dao/galleryresources.class.php :
- Code: Select all
* given a resource id, tries to find the next one in the sequence
*
* @param resource A GalleryResource object that represents the resource whose next
* object we'd like to load
* @return Returns a GalleryResource object representing the next resource, or false
* if there was no next resource
*/
function getNextResource( $resource )
{
$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, properties, file_size
FROM {$prefix}gallery_resources
WHERE album_id = '$albumId' AND date >= '$date' AND id > $id
ORDER BY date ASC,id ASC LIMIT 1";
$result = $this->Execute( $query );
if( !$result )
return false;
if( $result->RecordCount() == 0 ){
$result->Close();
return false;
}
$row = $result->FetchRow();
$result->Close();
$resource = $this->mapRow( $row );
$this->_cache->setData( $resource->getId(), CACHE_RESOURCES, $resource );
$this->_cache->setData( $resource->getFileName(), CACHE_RESOURCES_BY_NAME, $resource );
return $resource;
}
Is it possible to use that?
I have to confess I don't know anything about smarties except it's some kind of chocolate candies
