ZenphotoCMS Forum
Slideshow: how to control number of images cached? - 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: Slideshow: how to control number of images cached? (/thread-3192.html)

Pages: 1 2


Slideshow: how to control number of images cached? - dpeterson - 15-07-2008

I've created a ticket via trac, and hopefully the slideshow.php file is attached for review (I ?think? my submission worked - very new at this stuff). Anyway, good luck, hopefully someone can make use of the revisions.




Slideshow: how to control number of images cached? - acrylian - 15-07-2008

You did everything correctly. We surely will make use of it!




Slideshow: how to control number of images cached? - acrylian - 17-07-2008

jackdaw, dpeterson's fix is in the svn, so it will be in tonight's nightly.




Slideshow: how to control number of images cached? - jackdaw - 19-07-2008

Downloaded and tried the new slideshow.php and it works very nicely and fast!
The only thing that took me a little work (just a little ), is that at first I couldn't get the filename/title beneath the images instead of above.
At first I did it by moving

echo "".$image->getTitle()." (".$count."/".$numberofimages.")";

to the end of the if/else statements (movie or mp3 or image) like I did in the 'old' slideshow.php file. This resulted in a correct presentation of that filename for two slides, but with the third slide this filename moved to a position above the image. This is because from then on this title/filename is created somewhat differently ('htmlblock +=' etc.), so I had to change it there to.

Thanks dpeterson and acrylian! This will limit the data transfer immensily for large albums .




Slideshow: how to control number of images cached? - acrylian - 19-07-2008

The credit for this goes to dpeterson who figured it out. Now we are working on it to get it working with dynamic albums, too..




Slideshow: how to control number of images cached? - pipalia - 04-11-2008

Here's how we got around the issue of preloading images:

We used setInterval to call a function iteratively every 1 second to check if all the images have loaded (note: startingSlide attribute is required to restart cycle after it has been stopped):

var vCycleImages = setInterval("setImgCycleStatus()", 1000);

$(function() {
$('#fadeCenter').cycle();
$('#fadeCenter').cycle('stop');
});

function setImgCycleStatus() {

if ($.preloadImages("pic1", "pic2", "pic3", "pic4")){
$('#fadeCenter').cycle({
speed: 500,
timeout: 8000,
delay: -5000,
startingSlide: 0
});
clearInterval(vCycleImages);
}
}

jQuery.preloadImages = function() {
var bImgLoaded = true;

for(var i = 0; i < arguments.length; i++){
if (document.getElementById(arguments[i]).complete == false) {
bImgLoaded = false;
}
}
return bImgLoaded;
}

Hope this helps.

Samir Pipalia
Pipalia Software House
http://www.pipalia.co.uk