![]() |
|
Different sizes download button - 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: Different sizes download button (/thread-11002.html) |
Different sizes download button - nelson - 2013-04-18 Hi, Using ZPhoto 1.4 Thanks for any pointer to a solution Nelson. Different sizes download button - acrylian - 2013-04-18 Make sure the images are already cached when accessed. Use the cache_manager plugin to do that. Note that 1.4 is nowhere near the current release version so you should respectively might need to upgrade. Different sizes download button - sbillard - 2013-04-18 You could have your script run a background request for the images via an "ajax" request when the page loads if the image is not already in the cache. You can find an example of this in the development build Different sizes download button - acrylian - 2013-04-18 True, that is the more sophisticated way...;-) Different sizes download button - nelson - 2013-04-18 Thank you acrylian for the prompt response, yes, I'm a little behind in the updates, currently on v1.4.1.6 Different sizes download button - nelson - 2013-04-18 sbillard, thank you very much for the idea; you are right, AJAX was the step I was missing in my current process Nelson. Different sizes download button - nelson - 2013-04-19 For future reference ... I did it like this: ` //then I made the AJAX call function requestHR(){ //then I construct the URL to the cached image: //I use that path in the link The code for downloading the photo is pretty simple: Different sizes download button - acrylian - 2013-04-19 Since JS and PHP are different you cannot call a PHP function directly via JS. Generally you can for example call "custom theme pages" (those have the url Regarding the download, we also have a downloadlist plugin that may be of help for the download (it does bascially what you do but it also has download statistics available). Different sizes download button - sbillard - 2013-04-19 In the example I referenced you will see PHP code testing for the uri being to the image processor and saving it into an array. Then at the end of the script, if it did find some images needing caching it generates some javascript code to do the caching. Among the code is a definition of a js array containing the links needing to be fetched and a loop doing an ajax request for each of the elements in that array. |