Hier mal ein paar Bilder. Draufklicken und sie werden groesser.
Unten gehts weiter mit Seite 2.
$folder_scr = "images";
$des_src = "thumbs";
$thumbx = "100";
$thumby = "100";
function mkthumb($img_src,
$img_width,
$img_height,
$folder_scr,
$des_src)
{
$image = imagecreatefromjpeg($folder_scr."/".$img_src);
list($src_width, $src_height) = getimagesize($folder_scr."/".$img_src);
if($src_width >= $src_height)
{
$new_image_width = $img_width;
$new_image_height = $src_height * $img_width / $src_width;
}
if($src_width < $src_height)
{
$new_image_height = $img_width;
$new_image_width = $src_width * $img_height / $src_height;
}
$new_image = imagecreatetruecolor($new_image_width, $new_image_height);
imagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_image_width,$new_image_height, $src_width, $src_height);
imagejpeg($new_image, $des_src."/".$img_src, 100);
}
$filename = $_SERVER['index.php'];
$verz=opendir($folder_scr);
$linkl = array ();
if(!$_GET['page'])$page=1;else $page=$_GET['page'];
$anz=0;
$anz_max=2*$page;
while ($file = readdir ($verz))
{
if($file != "." && $file != ".." && $file != $filename)
{
if($anz<$anz_max) array_push ($linkl, "$file");
$anz++;
}
}
if($page!=1) {
$linkl = array_slice($linkl,2*($page-1));
}
$anzahl = count($linkl);
$x = 0;
$y = 0;
echo "
";
foreach($linkl as $key => $value)
{
if($y==2) break;
if(!file_exists($des_src."/".$value))
{
// erstelle ein thumb
mkthumb($value, $thumbx, $thumby, $folder_scr, $des_src);
}
if($x==2) {
echo "
";
$x=0;
}
echo " ".substr($value,0,strlen($value)-4)." | ";
$x++;
$y++;
}
if($x!=0)echo "
";
echo "
";
closedir($verz);
for($i=1;$i<=ceil($anz/2);$i++)echo "
$i ";
?>