Hi. I've had a look around the forums (searching for multiple albums) and also at the FAQ but can't seem to find anything conclusive (sorry, otherwise I would't be creating this thread) but I was wondering if ZenPhoto supports multiple albums? ie. that one image can be 'categorised' into more than one album.
Thanks!
Comments
i'd like to have albums reflecting broad categories - wildlife, architecture, people etc. but i'd also like to have 'sets' or 'collections' of photos - say all my photos from a trip to Hong Kong (or at least the ones worth uploading). some of those photos may also be appropriate in one of the category albums, eg 'people', or 'architecture'.
there *are* ways which one photo can be in more than one album, but they are no better than ugly hacks - eg create a symlink in one album to a real image in another - however this creates a duplicate record in the database, so its not really the 'same' image. works surprisingly well if your title, caption and keywords are all read from file metadata though.
im not sure exactly what im proposing here, perhaps an extension to zenphoto to allow not only albums, but also 'collections' or 'sets'. db-wise, i guess you'd have something like:
zp_collections (id, name) - to hold the named collections
zp_collection_images (id, collection_id, image_id) - a mapping table for many-to-many image-collection mappings.
alternatively...
we could have keyword-based (and even other metadata-based) dynamic albums... say, all images with keyword 'London', and another configured as all images with keyword 'People'. Thus, if you have one image which has London AND People tags, it would show up in both. possibly a nicer solution, all in all.
could call the saved searches 'dynamic albums' or something. that'd be cool because then people could use them however they wanted.
Symlinks are the only real solution. The disadvantage of multiple DB entries can be mitigated by putting all the image info into metadata in the image EXIF/IPTC fields. Then at least the database will get populated automatically with the data.
@acrylian: there is no difference at all, except the saved searches / dynamic albums would look like albums, have a thumbnail etc. whereas all they would really be is a link to a saved search - perhaps on a subtly modified search page.
what im thinking is the resultant page wouldnt show 'Search', but instead could be told to display a 'dynamic album name' - i think this is probably best done via url rewriting rules. something like /*.dynalbum in the url - whatever the * is would be displayed as the album name. certainly, it might be sensible to provide a visual cue that we're looking at a dynamically-generated album rather than a static one.
the nice thing about this approach is that new images matching the original search criteria will automatically become part of the dynalbum.
i've hacked a little something together - basically i changed the search results page to look for an 'albumname' property. if its set, the name is displayed instead of 'Search', and the 'total results for blah' bit is omitted.
the next steps are:
1) at the bottom of the normal search results page (ie no albumname property) have a link to 'save this search as a dynamic album'. this will write the url-encoded version of the search string to a new table (zp_dynalbums) along with a name and optional description.
2) at the bottom of the dynalbum version of the search results page, have an 'edit this dynamic album' link, for admins.
3) get the dynamic albums to show up on the main gallery page, alongside the 'normal' albums.
if anyone wants to see my (very rough) working copy, its here: http://gallery.mungler.com/index.php?p=search&words=(outdoor&!scotland)|bird&albumname=hellomum
as i say, im totally new to php and im obviously just hacking this together for my own purposes. if anyone wants to take what im doing and add it properly, i'm even happier cheers
EDIT: added an 'omitalbums' to the search results:
http://gallery.mungler.com/index.php?p=search&words=architecture&omitalbums=1&albumname=stuffblah - this stops it showing the 'architecture' album as a search result.
EDIT2: well, im giving up for the night. im starting to get my head around how zenphoto is put together. i think the next step is to create a class DynamicAlbum as a subclass of PersistentObject, and set about saving the search criteria to the db. I noticed that my changes to the search results page result in some odd behaviour in the breadcrumb links if you click on an image in the 'dynamic album'.
ultimately, one of three things will happen:
1) one of the proper zenphoto devs will pick this up and implement it properly, life will be good, etc
2) i fail to convince the devs its a good idea, so end up hacking something together just for my own use/amusement, which may or may not work.
3) i fail to convince the devs, fail to get it to work either through inability or (more likely) lack of time and motivation, and end up using the symlinks instead.
i'd prefer options 1, then 2, with 3 only as a last resort
You should create a new feature ticket for this. Include your implementation as an attachment. We will then add it to the voting poll and see how much interest it generates. Sounds like it would be reasonably popular.
regards
- mungler
IAn
Many thanks
Ian