if(isset($_GET['film']) and $_GET['film']!= '') { $film = $_GET['film']; //Test for version of the film and set width & height accordingly $version = substr ($film,-5,-4); switch ($version) { case "d": $_width = "240"; $_height = "196"; break; case "s": $_width = "320"; $_height = "256"; break; case "g": $_width = "480"; $_height = "376"; break; } // Set link file names for version links $small = substr ($film,0,-6).'_d.mov'; $medium = substr ($film,0,-6).'_s.mov'; $large = substr ($film,0,-6).'_g.mov'; //Set file sizes function size_hum_read($size){ //Returns a human readable size $i=0; $iec = array("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); while (($size/1024)>1) { $size=$size/1024; $i++; } return substr($size,0,strpos($size,'.')+0).$iec[$i]; } if (file_exists($small)) {$smallSize = size_hum_read(filesize($small));} if (file_exists($medium)) {$mediumSize = size_hum_read(filesize($medium));} if (file_exists($large)) {$largeSize = size_hum_read(filesize($large));} } else { echo "Film source ".$film." is not recognised"; exit; } ?>
Select film size:
if (($version=="d") && file_exists($small))
{
echo '240x180 ['.$smallSize.'] |