filemtime($b)) ? -1 : 1; } $dir = glob('img/*.jpg'); // Načtení uasort($dir, "newest"); // Setřídění array_unshift($dir, ''); // Přečíslování pole od 1 reset($dir); // Ukazatel nastavit na první for ($i = 7; $i < count($dir); $i++) unlink($dir[$i]); // Konec mazání if (isset($_REQUEST["image"])) { $fname = substr($_REQUEST["image"], (strrpos($_REQUEST["image"],"/")+1) ); $filename = $IMGPATH . "/" . $fname; } if (isset($_REQUEST["sizex"])) { $sizex = intval ($_REQUEST["sizex"], 10 ); } if (isset($_REQUEST["sizey"])) { $sizey = intval ($_REQUEST["sizey"], 10 ); } $size = getimagesize($filename); $fp = fopen($filename, "rb"); if ($size && $fp) { header("Content-type: {$size['mime']}"); fpassthru($fp); exit; } else { echo "Error - image not found
\n"; } ?>