Scusa, ecco il codice dell'intera pagina SLIDE
http://www.meteoapuane.it/archivio_massa/slide.php
<html>
<head>
<link type="text/css" href="css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
<script language="javascript">
<!--
<?php
///////////////////////////////////////////// Configurazione :
// Estensione file della webcam jpg , jpeg , png , gif
$estensione = 'jpg' ;
// Prima immagine dello slideshow
$immagineiniziale = 'immagine-inizio.jpg';
// Ultima immagine dello slideshow
$immaginefinale = 'immagine-fine.jpg';
// Velocità slideshow in millisecondi
$velocita = 1000 ;
//////////////////////////////////// Non editare niente qua sotto
$data = $_POST["q"];
if ( $data == '' ) { $data = date("Y-m-d"); }
function returnimages($dirname,$extension,$start,$stop) {
$pattern="(\.".$extension."$)"; //
$files = array();
if($handle = @opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){ // Se immagine valida
$info = pathinfo($file);
if ( $file !== $start && $file !== $stop ) {
$image_array[] = $info['filename'] ;
}
}
}
}
@closedir($handle);
if ($image_array) {
sort ($image_array);
foreach ($image_array as $image) {
echo '"'.$image .'.'.$extension.'", ';
}
}
}
// ordino le immagini senza l'estensione per prevenire l'errore causato dal numero diverso di caratteri
echo 'strImage = [';
if ( $immagineiniziale !== '' ) { echo '"image/'.$immagineiniziale.'",' ; }
returnimages($data."/",$estensione,$immagineiniziale,$immaginefinal e);
if ( $immaginefinale !== '' ) { echo '"image/'.$immaginefinale.'"' ; }
echo '];';
echo "\n";
echo "baseurl = '".$data."/';";
echo "\n";
echo "reqdate = '".$data."';";
echo "\n";
echo "var vel = ".$velocita.";" ;
?>
now = 1 ;
totimages = strImage.length ;
stopani = 0;
function loadImages() {
i = 0 ;
num = 0 ;
$.each(strImage, function() {
var image = new Array();
image[i] = new Image();
image[i].onload = function() {
var valore = (100 / totimages) * num ;
$('#progressbar').progressbar('option', 'value', valore);
++num ;
$('#theSPN').text( num + ' di ' + totimages);
if ( num == totimages ) {
$('#msg').hide();
$('#cam').hide().html('[img]'+strImage[0]+'[/img]').fadeIn(100);
setTimeout('animazione()',2500);
}
};
if ( i == 0 ) {
image[i].src = ""+this+"";
}
else if ( i == totimages - 1) {
image[i].src = ""+this+"";
}
else {
image[i].src = ""+baseurl+""+this+"";
}
++i;
});
};
function animazione() {
if (now < totimages) {
if ( now == totimages - 1 ) {
url = ''+strImage[now];
}
else { url = ''+baseurl+''+strImage[now]; }
++now;
$('#theIMG').attr("src",url);
if ( stopani == 0 ) { setTimeout('animazione()',vel); }
}
}
function play() {
stopani = 0;
setTimeout('animazione()',vel);
}
function stop() {
stopani = 1;
}
$(window).load(function() {
loadImages();
$("#date").datepicker();
$("#date").datepicker('option', {dateFormat: 'yy-mm-dd'});
$("#progressbar").progressbar({
value: 0
});
var currentTime = new Date()
var month = currentTime.getMonth() + 1
if (month < 10){ month = "0" + month ; }
var day = currentTime.getDate()
if (day < 10){ day = "0" + day ; }
var year = currentTime.getFullYear()
$("#date").val(reqdate);
});
//-->
</script>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
.Stile3 {color: #000000; font-family: Arial, Helvetica, sans-serif; }
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body>
<div align="center" id="formdata">
<form action="#" method="post">
<span class="Stile3">Visualizza animazione del</span>
<input type="text" size="10" name="q" id="date" >
<input type="submit" value="invia">
</div>
<div align="center" id="theDIV">
<div id="msg"><h2><span class="Stile1">Attendere...
Caricamento immagini <span id="theSPN"></span> </h2>
<div id="progressbar" style="width: 200px; height:10px;"></div>
</div>
<div id="cam" style="margin:20px"></div>
</div>
<div align="center"><a href="slide1.php#" onClick="javascriptlay();return false">
<input onClick="startPlay()" value="Play >>" type="button">
</a><big><big> </big></big><a href="slide1.php#" onClick="javascript:stop();return false">
<input onClick="clearLastUpdate()" value="Stop" type="button">
</a>
</div>
</form>
</body>
</html>