100 ) { $file=""; } # Stop huge strings breaking it. } $flag=0; $z=0; $n= count ($list); while ($z<$n) { # if ( preg_match("/[\.][jJpP][nNpP][gG]$/", $list[$z]) ) { # Allow png, gif and jpg and ps files #preg_match('#^http:\/\/(.*)\.(gif|png)$#i' if ( preg_match("/CLUSTER/", $list[$z]) ) { $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"; ?>
".$outmonth." ".$outyear." AAR Perigee Passes

\n"; print "\n \n"; $z=0; $n= count ($list); while ($z<$n) { print " \n"; # print " \n"; # if (($z+1)/4 == floor (($z+1)/4) ) { print " \n \n";# } $z=$z+4; } print " \n
".substr($list[$z],0,4)." DOY ".substr($list[$z],4,3)." ".substr($list[$z],7,4)."".substr($list[$z],0,8)."
\n"; print "

Back to Summary Plot Home

\n"; } else { # plot graph $key=array_search($file,$list); $key=(int)$key; if ($key == ((int) count ($list) - 4) ) { $nextfile=$list[0]; # at end, go to start... } else { for ($j=$key;$j<=((int) count ($list) - 1);$j++) { IF(substr($list[$j], 0, 7) != substr($list[$j+4], 0, 7)) { $nextfile=$list[$j+4]; break; } } # $nextfile=$list[$key+1]; } if ($key == 0) { for ($j=$key;$j<=((int) count ($list) - 1);$j++) { IF(substr($list[$j], 0, 7) != substr($list[$j+1], 0, 7)) { $prevfile=$list[(int) count ($list) -4]; break; } } # $prevfile=$list[(int) count ($list) -1]; # at start, go to end } else { $prevfile=$list[$key-4]; } $file_1=substr($file, 0, 20)."1.png"; $file_2=substr($file, 0, 20)."2.png"; $file_3=substr($file, 0, 20)."3.png"; $file_4=substr($file, 0, 20)."4.png"; print "

Back to Index

\n"; $ndays = count($list)/4; print "AAR Pass ".floor(($key/4)+1)." of ".$ndays." in current month
"; print "".substr($prevfile,0,7).""; print " ".substr($file,0,4)." DOY ".substr($file,4,3)." ".substr($file,7,4)." "; print "".substr($nextfile,0,7).""; print "\n \n \n \n \n \n"; print " \n \n \n\n\n\n \n \n
"; # print "".$prevfile.""; print ""; # print "(".($key+1)." of ".count ($list).")
"; # print "".$file.""; print "
"; # print "".$nextfile.""; print "
"; #print " "; print " "; print " "; print " "; print ""; print " "; print " "; print "
"; print " "; print " "; print " "; print ""; print " "; print " "; print " "; print "
\n"; print "

Back to Index

\n"; } #print $URL."\n"; ################################################ /*********************************************************************** * Use * * $needle // The item you are looking for * $array // The array you are searching in * * // Return the key * $array_key = array_searcher($needle, $array); * echo "The array's key is : " . $array_key; ***********************************************************************/ function array_searcher($needle, $array) { // Make sure a valid array was passed if(!is_array($array)) { return "Not a valid array"; } // Loop through each part of the array foreach ($array as $key => $item) { // Inner loop foreach($item as $entity) { // Found a match, return the key if ($entity == $needle) { return $key; } } } } ######################################################## ?>