Bonjour,
j'ai testé de changer les variables $directory_name = "thumbs"; par un include ou ?viable etc... sa ne veut pas marcher :/
j'ai voulu changer se code qui marche très bien sauf que j'arrive pas a lui dire dallé cherché mes image qui se trouve sur free et non pas sur mon site (thumbs).
donc comment je peut faire pour aller cherché mes image et que sa les affiche sur ma page.
Code:
<head>
<title>Defilement images</title>
<meta name="author" content="Wassim Jied jiedwassim.1free.ws" />
</head>
<body onLoad="rotate();">
<?php
$directory_name = "thumbs"; >>>>>>ICI JE VOUDRAI METTRE MON LIEN DE MES IMAGE<<<<<<<<
$extensions_ok = array ( ".jpg","jpeg",".gif",".png");
$folder = opendir ($directory_name);
$i = 0;
$photos = array();
while ($file = readdir ($folder))
{
if (in_array(strtolower(substr($file, -4)),$extensions_ok))
$photos[] = $directory_name."/".$file;
}
closedir ($folder);
$count_photos = count ($photos);
?>
<script type="text/javascript">
var rotate_delay = 4000; // delais en microseconde (4000 = 4 secs)
var current = -1;
var photos = [<?php for($i=0;$i<$count_photos;$i++)
{
echo "\"".$photos[$i]."\"";
if($i!=$count_photos-1) echo ",";
}
?>];
function next() {
if (current<photos.length - 1)
++current;
else current = 0;
}
function rotate() {
if(photos.length > 0)
{
next();
document.images.slides.src = photos[current];
window.setTimeout("rotate()", rotate_delay);
}
}
</script>
<center>
<table>
<tr>
<td>
<img src="/" id="slides" width=120px height=120px/>
</td>
</tr>
</table>
Cordialement Stéphane