1
Mods & Plugins (Releases & Support) / Re: Different download options / Verschiedene Download Möglichkeiten
« on: December 02, 2007, 03:36:30 PM »Kudos: This is a great mod, thank you. I was able to change it a bit to support multiple file types instead of different resolutions, and it's working very well for that.
Problem: It seems the code placed into functions.php (after the "$allow_download = 1;" line) runs not only for the detail image, but also for the Random Image that appears to the left of the page. In fact, it looks to run twice for that image, then once for the detail image.
This might not sound like an issue, but it is when I don't have all the same file types for all the images in the gallery.

What happens, is the {download_button} arrays are generated but if the random image has a file type that the detail image doesn't, the {download_button} for that file type is actually for the random image when it appears on the page. (If the file type existed for the detail image that array would have been overwritten.)
Question: Is there a way to make sure that the {download_button} arrays are only generated for the detail image, and not the random image that's also on the page?
I found I have access to the image_id field when building the arrays, so I was tempted to use that in the {download_button} array name, but I don't know if I can build those array names on the fly in details.html when the page loads.
Any ideas?
Thank You,
Rich