exit search context still giving me a headache..

after several hours i still could not solve this one;

on my testsite on the image.php of the default theme I added a getAlbumLinkURL link beneath each picture. so when you are in the search reults you can go to the album to which this pic belongs
see:
http://www.bertsimons.nl/zenphototest/page/search/test

if you click on the link you go to the album and all is well untill you view the image that brought you here.. and that takes you back to the searchimages. what i don't want!!!
I spent several hours, setting contexts, unsetting cookies, setting searchparams etc but without any luck..

Comments

  • The definitive way to cancel search context is to set `$_zp_current_search = NULL;` and clear the cookie ` zp_setcookie("zenphoto_image_search_params", "", time()-368000, $cookiepath);` but this must be done before any functions are referenced that might be aware of search context. So, you will need to know that you got to the album page from your link and clear the search.

    update: `handleSearchParms()` is the way to clear the cookie.
  • thanks again sbillard! handleSearchParms did the job. I have the link set a cookie which is checked on top of the image page and if set call the function.
    you can see it working on:
    http://www.bertsimons.nl/zenphoto/page/search/tags/rendering
Sign In or Register to comment.