Here is the code for the script so far.....
Code: Select all
<?php
# To add portability we'll make it into a function.
# and call it later on.
function GetIMGList($DIR) {
$handle = opendir("$DIR");
$count = 1;
while (false !== ($file = readdir($handle))) {
if ($count == 1000) {
echo "<br>";
$count = 1000;
}
if (!ereg("\.jpg|\.gif",$file)) continue; # Real images only please
echo "<a href="javascript:PopupPic('$DIR/$file')"> <img src="$DIR/$file" width="50" height="50" alt="$file" onmouseover="nereidFade(this,100,30,10)" style="FILTER: alpha(opacity=30)" onmouseout="nereidFade(this,30,50,5)"></A>\n";
$count++;
}
closedir($handle);
}
?>
<html>
<head>
<script language="Javascript">
function PopupPic(sPicURL) {
window.open( "popup.htm?"+sPicURL, "",
"resizable=1,HEIGHT=200,WIDTH=200");
}
</script>
<script language="JavaScript">
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
if (object != "їobject]"){
setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
return;
}
clearTimeout(nereidFadeTimersїobject.sourceIndex]);
diff = destOp-object.filters.alpha.opacity;
direction = 1;
if (object.filters.alpha.opacity > destOp){
direction = -1;
}
delta=Math.min(direction*diff,delta);
object.filters.alpha.opacity+=direction*delta;
if (object.filters.alpha.opacity != destOp){
nereidFadeObjectsїobject.sourceIndex]=object;
nereidFadeTimersїobject.sourceIndex]=setTimeout("nereidFade(nereidFadeObjectsї"+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
}
}
</script>
<style>
body{scrollbar-face-color: #ffffff;
scrollbar-shadow-color: #ffffff;
scrollbar-highlight-color: #ffffff;
scrollbar-3dlight-color: #ded7d6;
scrollbar-darkshadow-color: #ded7d6;
scrollbar-track-color: #ffffff;
scrollbar-arrow-color: #ded7d6;}
</style>
</head>
<body bgcolor="#FFFFFF" link="#000000" vlink="#000000" alink="#000000" topmargin="0" marginheight="0" leftmargin="0" marginwidth="0">
<CENTER>
<?php
#Call it here:
GetIMGList("./");
?>
</body>
</html>NE ideas?