![]() |
|
printLatestImagesByDate and link back - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: printLatestImagesByDate and link back (/thread-12081.html) |
printLatestImagesByDate and link back - XavierJ - 2014-11-27 Hello, I'm currently building a new site. On the gallery of this new site, I woud like to show the 12 last uploaded images in an album. Currently, when I use the navigation of the image.php page, it does get back to the original album the image was uploaded to. For the link back to the album, I currently use this function I've made : function getParentSearchURL()
} How to build the link? Thank you by advance, printLatestImagesByDate and link back - acrylian - 2014-11-27 Search things are actually not needed. How to get back to the latest images depends on where you print them. If you are on Problem is that you need to pass to Then you can add a check for that on If that is too much coding for you maybe it would be easier for you to just use a dynamic album sorted by date (well there is then no limit unless you code something). Then the album to return it is naturally automatically the dynamic album. printLatestImagesByDate and link back - XavierJ - 2014-11-27 Thank you very much Acrylian for your answer. I think I'll try to use a dynamic album by date (I would have prefered to use the printLatestImagesByDate() function, but navigation inside this pseudo album must be really hard to code, especially next and previous images). Actually, I don't know how to code something to limit the search results to a limited number of images. I've made some research on the forum, but didn't find a real way to do it. I don't know if you have a way to do that? I'll try by myself. Thank you again. printLatestImagesByDate and link back - XavierJ - 2014-11-28 Ok, I think about a way to limit the number of images in a dynamic album : I was thinking about this code : printLatestImagesByDate and link back - acrylian - 2014-11-28 Quote: (I would have prefered to use the printLatestImagesByDate() function, but navigation inside this pseudo album must be really hard to code, especially next and previous images). Yes, you can limit the number of images that way in an album. But if you do that on your theme's album.php you will do this for any album regardless if real or dynamic. Add a check like Or you should extend your theme using this plugin: printLatestImagesByDate and link back - XavierJ - 2014-11-29 Ok, thank you Acrylian for the check code, I'll use it. The code : does work well for limiting the number of thumbs to 6 in the dynamic album page, but each pages has now 6 thumbs. It does not limit the effective number of image of the dynamic album (by navigating inside this album, I've all the images, not only the 6 last I want, considering they're sorted by date). So I'm searching a way to limit the number of image in the dynamic album, wich is equal to limit the number of results given by the search loop (or filtering the 6 last results of the search). Is there a way to do that? Thank you again. printLatestImagesByDate and link back - acrylian - 2014-11-29 "Is there a way to do that?" is of course a wrong question for coding. But shortly no there is no simple way to limit code of an dynamic album. A dynamic album is bascially a "saved search". To limit you need to limit what you search for. The easiest is assign a tag to it. If you have only six it will find only six. But naturally it is not one option to get the latest images by that. My code was meant to give you a clue to limit something to one specific album. You have of course do do more custom theme coding like disabling the page navigation itself so you get only one page. As you will hopefully understand I cannot provide a complete solution for your specific problem here. That exceeds the possibilities of this forum. If you wishing to dive deeper see the tutorial about the theming basics first and then look at the object model tutorial. Your will probably have to invest a bit of time. printLatestImagesByDate and link back - XavierJ - 2014-11-30 No problem Acrylian, it is really kind from you to have taken the time to help me until now. I'm sure it is a bit porcinet and it is certainly not conventional, but it does work... And I think I can use that to limit every search results. Thank you again. I'll sure show my site here when it will be completely finished. Thank you for Zenphoto. printLatestImagesByDate and link back - acrylian - 2014-11-30 Ok, looking forward to see the site. One further tipp though: Instead of passing the variable you can also check |