Returning to page 'n' of gallery page

I posted the same question previously (http://www.zenphoto.org/support/topic.php?id=221), but that was quite some time ago so am re-asking this for the current version of zenphoto.

Have just upgraded to 1.4.6 from 1.4.5.9, and noticed that the gallery link returns to the 1st page instead of the page that I'm currently on (e.g. previously if I'm on page 5 of my gallery page, clicking on link would return me to page 5). Makes browsing the gallery site a bit tedious.

Is this changed in the newer version or is there a theme function for this?

Comments

  • acrylian Administrator, Developer
    Do you mean you selected an album on gallery page 5 and then want to return from that album to page 5?

    You would have to pass the value of the current gallery page to whereever you are clicking so you can return to it. Since all are links and no form elements you can only append that via a GET query to the url and check that on the target page. Something like `&returnpage=`. Then append it to the gallery url.

    The current page number is stored in the global variable `$_zp_page` (for all standard theme paginations gallery, album, news articlces).
  • Yes. What do I put in my theme file to do that? I was using `"`

    Curious, why is it that it works out of the box in prior versions before 1.4.6?
  • acrylian Administrator, Developer
    Actually I don't remember any changes in 1.4.6 (but I might not have been involved) and actually not even that this ever worked…

    YOu would have to pass the page you are on to the page you are going.
    Then you have to check for the page and append a query to the return url. `getCustomPageURL()` has a parameter for queries.

    EDIT: Indeed I still have a 1.4.5.9 install locally and there it works. Have to look what changed. But it should only have worked with `getGalleryIndexURL()`. Indeed a lot has been removed here.
  • How do I do that? I referred to the template function documentation but am not sure how to do it. I'm not familiar with php :(
  • acrylian Administrator, Developer
    Well, as of the current state you will not be able to do it if you are not at least a bit familiar with php. I look at it and try to get the old functionality back. I didn't notice that my former colleague had remove it all. Could have been an accident or a reason I don't understand yet as the function was deprecated a short time until it was redecided.
  • Sorry, posted before seeing your edited comment above..

    re: getCustomPageURL, how do I pass the current page I'm on to `getCustomPageURL`?
  • acrylian Administrator, Developer
    Not that easy, you have to edit every album link to include the current page number. Then you ahve to read that and pass it back. Use the parameter and append a query (`&page=` or modwrite `/page/`.

    Give me some time to get the functionality back.
  • Ok, thanks for looking into this.
  • acrylian Administrator, Developer
    I opened a ticket for further discussion: https://github.com/zenphoto/zenphoto/issues/831
Sign In or Register to comment.