# URLs for this page are in the form: # rjw_image_viewer.php?IMGNAME=pic.gif # useful PHP URLs at http://uk.php.net/manual/en/ref.array.php # # RJW 17 Nov 2004 # There is nothing to alter in this page, just rename it as desired and dump in a directory. # NOTE: renaming it index.php works, but unlike index.html you MUST write it in the path. $phpdir=getcwd(); # get your current directory # URL is something like http://msslhx.mssl.ucl.ac.uk/~rjw/mssl_only/fte/rjw_image_viewer.php?IMGNAME=fte_005_004.png $fullURL = explode("/",$_SERVER['SCRIPT_FILENAME']); # get URL and split on / $URL = array_pop($fullURL); # Take final part $URLbits = explode("?",$URL); # split on ? in case there are any additions on the end of the file name $thisfilename = array_shift($URLbits); # End up with "rjw_image_viewer.php" $dh = opendir($phpdir); while (false !== ($filename = readdir($dh))) { $list[] = $filename; } sort($list); $file=""; if ($_GET[IMGNAME]) { $file= $_GET[IMGNAME]; $efile=substr($file,5,3).'-'.substr($file,19,4); if (strlen($file) >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=""; } ?>
List of all ".count ($list)." image files in directory
\n"; print "Cluster S/C during AAR Perigee Passes
\n"; print "".$list[$z]." | \n"; # print "".substr($list[$z],0,8)." | \n"; if (($z+1)/2 == floor (($z+1)/2) ) { print "
"; print " | \n"; print " | \n"; print " | \n
"; print " "; print " "; print " | ||
"; print " "; print " "; print " | \n