Hi,
When I create a list of tags for the album level, the search runs all over the entire gallery. Is there a way to get the search to run only inside the album for which they have been created?
It would be logic, and very useful too.
Thank you.
# Version de Zenphoto 1.3.1.2 [5831] (Version officielle)
# Current gallery theme: zpGalleriffic
# PHP version: 5.2.14
# Graphics support: PHP Imagick library 3.0.1RC2
ImageMagick 6.6.0-2 2010-07-13 Q16
http://www.imagemagick.org
Comments
Around line 174, I added `$album = getAllSubAlbumIDs();`
and then modified the next line to include a call to the first cell in the array:
`
echo "".$tname.$counter."".$separator."
\n";
`
It's working a peach for subalbums, but the problem is that if I am in a main album, there technically aren't any photos there (as they all reside in the subalbums), so while the tags show up perfectly, the resulting searches (by which I mean clicking on the tag) turn up empty even though there are plenty of hits to be had in the subalbums of that parent.
Would love to see someone improve upon this - it's giving me a headache!
If you want to search more then one album, then by all means, do so. You can supply as many albums as you want in the search list.
Since im new on the forum it is not letteing me preview my posts, so I am only now seeing that there is a truncation on my code. It should be
`
echo "".$tname.$counter."".$separator."
\n";
`
(in case that also doesn't post, I am passing $album[0] as the last parameter to getSearchURL.
As you say, it is indeed correct to return empty results. The problem is the tag cloud function returns results for both the album itself and all sub-albums as well (so a tag may have x number of hits even though the top-level album has zero). However, the hack I wrote above does not return sub-albums for the search query, so returns zero (not x).
I would like the hack to also search sub-albums, just not sure how to do it. I would have assumed that passing $album (or a version printed with foreach) would have done it, but I only get 'array,array,array'.
tags_from_album plugin (which has been renamed to tags_extras in the svn btw) has a function getAllTagsFromAlbum() has options to include subalbums or not. Of course since mainly images would be tagged the main purpose is to get the tags of these within the album. Last time I tried this worked well even in in the main album are no images itself.
It has also an option for getting the tags of the album and its subalbums itself.
`echo "".$tname.$counter."".$separator."\n";`
(not entirely sure what the '1' is at the end, but is common to all, so I presume it is the gallery root). As I said earlier, the query actually works perfectly on a sub-album.
So effectively, my variable $album[0] is actually outputting an array it seems. However, if I were to echo, say, $album[0][0], $album[0][1], etc. I get nothing whatsoever. Nor do I get anything if I were to echo $album[1], etc...