Member
Member
ayutheos   2014-06-15, 10:42
#1

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?

Administrator
Administrator
acrylian   2014-06-15, 11:22
#2

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).

Member
Member
ayutheos   2014-06-15, 12:47
#3

Yes. What do I put in my theme file to do that? I was using `

Administrator
Administrator
acrylian   2014-06-15, 13:17
#4

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.

Member
Member
ayutheos   2014-06-15, 13:23
#5

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

Administrator
Administrator
acrylian   2014-06-15, 13:26
#6

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.

Member
Member
ayutheos   2014-06-15, 13:30
#7

Sorry, posted before seeing your edited comment above..

re: getCustomPageURL, how do I pass the current page I'm on to getCustomPageURL?

Administrator
Administrator
acrylian   2014-06-15, 13:37
#8

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.

Member
Member
ayutheos   2014-06-15, 14:01
#9

Ok, thanks for looking into this.

Administrator
Administrator
acrylian   2014-06-15, 14:02
#10

I opened a ticket for further discussion: https://github.com/zenphoto/zenphoto/issues/831

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.