Latest image
(updated every 10 minutes)
Some info about the Webcam and
its location
\n";
echo "
Recent images
";
function GetDirArray($sPath, $sMatch, $sTimeDiff)
{
$now=time();
$handle=opendir($sPath);
while (false !== ($file = readdir($handle))) {
if ( ereg($sMatch, $file) ) {
$fName = "$sPath/$file";
$fTime = filemtime($fName);
$diff = $now-$fTime;
if ($diff <= $sTimeDiff || $sTimeDiff == 0) {
$fileArr[$file] = $fTime;
}
}
}
closedir($handle);
arsort($fileArr);
return $fileArr;
}
if ($format == short) // 1 week
$timediff = 604800;
else if ($format == long) // 1 month (30 days)
$timediff = 2592000;
else // all
$timediff = 0;
//
// 1st param is directory name
// 2nd is regexp for the images (.jpg$ lists all files ending with .jpg)
// 3rd is the maximum age (in seconds) for the displayed archived images
//
$iArr = GetDirArray("$basedir", ".jpg$", $timediff);
$num = sizeof($iArr);
for($t=0;$t<$num;$t++) {
$thisFile = each($iArr);
$thisName = $thisFile[0];
$then = $thisFile[1];
$a_then=getdate($then);
if ( $a_then["yday"] != $prevday) {
echo "
\n";
echo strftime("%A %x: ",$then);
}
$prevday=$a_then["yday"];
echo "";
echo strftime("%H:%M",$then)."\n";
}
echo "";
if ( $format != "short" )
echo "last week's images |\n";
else
echo " last weeks images |\n";
if ( $format != "long" )
echo "last month's images |\n";
else
echo " last month's images |\n";
if ( $format != "all" )
echo " all images\n";
else
echo " all images\n";
echo "
\n";
?>