Hi all!
Using print_album_menu plugin I've noticed a strange behavior:
If you jump from a dynamic album to a static one, and then you choose an image included in the dynamic album too, ZP goes in ZP_SEARCH_LINKED context while showing the image.
Then you'll browse a wrong album (with the dynamic album name in the Breadcrumb instead of the static one too).
Latest version of zenphoto (Nightly Build 20/04/2009) with zenpage default theme.
Comments
I have the same issue whenever i switch between search results and a static album directly (using album menu) without passing across gallery index.
It appends that the cookie `zenphoto_image_search_params` is still present in such a case.
May be this could cause the problem?
If the first image i choose in the static albun in not in the search results, I can browse the album till I find an image that is part of the results. Then the context switches to ZP_SEARCH_LINKED and I fall browsing the results...
It solved my issue, and works ok with dynamic albums but, after a normal search, the image.php page in not anymore in ZP_SEARCH_LINKED context, infact `get_context()=7` , so that you can't browse the resulting image pages
Another little issue, already present in previous build, is that if while browsing the image.php pages generated by a dynamic album you click a link in the Breadcrumb and then go back in browser the context is loosed again and you fall in a static album. I suppose that nothing can be done about it.
You added this line in functions.php
`line 1220 zp_setcookie("zenphoto_image_search_params", "", time()-368000, $cookiepath);`
to delete the search cookie.
This way the cookie is deleted if not in ZP_SEARCH_LINKED context.
The problem is that when search result are displayed as thumbs the context is ZP_SEARCH if I'm not wrong.
I've put the deletion under the condition: `if (in_context(ZP_ALBUM |ZP_IMAGE))` so that the cookie is not deleted when search results are displayed.
It seems to work ATM, I don't know if it's clean, I'm absolute beginner.
My 1220 line is: `if (in_context(ZP_ALBUM |ZP_IMAGE)){zp_setcookie("zenphoto_image_search_params", "", time()-368000, $cookiepath);}`
if i remove the ZP_ALBUM |ZP_IMAGE condition I can't browse the image search results
Yes, may be that's why it needs the cookie to browse the searched images pages.
>Can you walk me through just what is not working when you say you can't browse the image search resluts?
This is a search results page:
Search Results
Now after your 1220 line for cookie removal if you click on a thumb, let's say the first one:
Browse 1
Before adding the new 1220 line or whit the ZP_ALBUM |ZP_IMAGE condition added:
Browse 2
In the pictures I posted you can only see the difference in the breadcrumb (and in the prev button present only in the first case) but if you continue browsing using the next button you'll see that in the first case you are in the Portfolio album (18 images), in the second case you are browsing the search results (4 images).
This world of coding is a real a mistery!!!
`zenphoto_image_search_params`
It appens with zenpage default theme.
When in Gallery archive, if you follow a month link (like 2009 > April) all the dynamic albums displayed by Print Album Menu show the same number of image beside the name of each album, that is the number given by the date's search results.
The original problem was caused by "silent" 404 errors. The fix in the nightly build is to avoid clearing the cookie under that circumstance.
I didn't notice it before but this behavior also affects the "News archive" month links. In this case the number displayed beside names of dynamic album is zero (nothing displayed actually).
So, is there something wrong everytime we have a DATE in the search cookie?
`topalbum = new Album($_zp_gallery,$album,true);`
For one of those misterious reasons that make this world of software so fascinating, when `&date` is in QUERY_STRING `topalbum` is populated with the images (if any) present in the search for date results. This happens only if `$album` is a dynamic folder.
Try it to believe!
../index.php?p=search&date=2009-04
or
../index.php?p=news&date=2009-05
Dynamic albums use the search engine. Archive pages use the search engine. There is only one search remembered.
Infact it uses a new album object to do it, as seen a few posts above.
But if date is involved in the serch, the new album object is populated with wrong images!
This, of course, is not a problem of the plug in, it happens whenever you try to build a new album object in a search for date context.
While we are here I also suggest to add this two lines to the print_album_menu function after line 153 (latest nigthly):
`
} else if(in_context(ZP_ALBUM) && in_context(ZP_SEARCH_LINKED) && $_zp_current_search->dynalbumname == $topalbum->name) {
$link = "".$topalbum->getTitle().$count;
`
after declaring $_zp_current_search as global.
This enhances the context sensitive behavior of the menu, extending it to dynamic albums too.