100 ) { $file=""; } # Stop huge strings breaking it. } $flag=0; $z=0; $n= count ($list); while ($z<$n) { if ( preg_match("/[\.][jJPp][pPnN][gG]$/", $list[$z]) ) { # Allow png, gif and jpg and ps files $listnew[]=$list[$z]; if ($file == $list[$z]) { $flag=$flag+1; $eventl[$z]=substr($list[$z],5,3).'-'.substr($list[$z],19,4); } } $z=$z+1; } $list=$listnew; if ($flag == 1) { # great, found the requested image in the list } else { # Didn't find it, so show all list. $file=""; } ?> Cluster S/C during AAR events <? print ": $file"; ?>
List of all ".count ($list)." image files in directory

\n"; print "

Cluster S/C during AAR Perigee Passes

\n"; print "\n \n"; $z=0; $n= count ($list); while ($z<$n) { print " \n"; # print " \n"; if (($z+1)/2 == floor (($z+1)/2) ) { print " \n \n"; } $z=$z+1; } print " \n
".$list[$z]."".substr($list[$z],0,8)."
\n"; } else { # plot graph $key=array_search($file,$list); $key=(int)$key; if ($key == ((int) count ($list) - 1) ) { $nextfile=$list[0]; # at end, go to start... } else { $nextfile=$list[$key+1]; } if ($key == 0) { $prevfile=$list[(int) count ($list) -1]; # at start, go to end } else { $prevfile=$list[$key-1]; } $file_1=$file; if (substr($file, 17, 1) == 4) { $sensor='CODIF'; } else { $sensor='HIA'; } $nfile_1=substr($file, 0, 9).$sensor.substr($file, 16, 7).".png"; print "
"; print "\n \n \n \n \n \n"; print " \n \n \n \n
"; print ""; print ""; print "
"; print " "; print " "; print "
"; print " "; print " "; print "
\n"; } ?>