Complex custom image gallery block, loop not completing properly...
Permalink
I have a pretty hefty custom block I've been working on which automatically creates an image gallery with albums from filesets. Its my first journey into php and I have come a long way, but I've hit my final roadblock. Everything is working correctly except for this one part.
I've attached the entire block for reference because I'm really not sure what part of the block is causing the problem. (jQuery or block controller?)
What the block does is loop through all filesets, checks them against an array of sets to exclude, gets a display image and converts it to a thumbnail and also grabs custom attributes off the file, then (this is where things go wrong) it takes all the files in each set and prints each one out inside some div hierarchy.
I've added jQuery to make an interesting expanding box that expands from a thumbnail to a simple slideshow using the printed out images.
What seems to be happening is that the second loop that prints out each image in the set (while inside a loop that goes through each fileset) prints out the images in ALL filesets. For example, if I view the slideshow for the first fileset, it contains images from all the filesets, and all the other slideshows are blank.
This block is so complex, I don't know what is causing it to behave this way.
[I am using several custom file attributes to make this work, the most important being a checkbox for 'display' (the one that will be used as the thumbnail).]
*Also any tips on how to clean up my code and make it more efficient is greatly appreciated. It's rather sloppy.
I've attached the entire block for reference because I'm really not sure what part of the block is causing the problem. (jQuery or block controller?)
What the block does is loop through all filesets, checks them against an array of sets to exclude, gets a display image and converts it to a thumbnail and also grabs custom attributes off the file, then (this is where things go wrong) it takes all the files in each set and prints each one out inside some div hierarchy.
I've added jQuery to make an interesting expanding box that expands from a thumbnail to a simple slideshow using the printed out images.
What seems to be happening is that the second loop that prints out each image in the set (while inside a loop that goes through each fileset) prints out the images in ALL filesets. For example, if I view the slideshow for the first fileset, it contains images from all the filesets, and all the other slideshows are blank.
This block is so complex, I don't know what is causing it to behave this way.
[I am using several custom file attributes to make this work, the most important being a checkbox for 'display' (the one that will be used as the thumbnail).]
*Also any tips on how to clean up my code and make it more efficient is greatly appreciated. It's rather sloppy.