All pastes #564434 Raw Edit

Mine

public text v1 · immutable
·published 2007-06-13 16:21 UTC
rendered paste body
</div>
<br>
<div class="oben" align="center">
<h2>Gallery</h2>
</div>
<div class="unten" align="center">
<p>Hier mal ein paar Bilder von mir:</p>
<?
  $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 ();
 
  while ($file = readdir ($verz))
  {
    if($file != "." && $file != ".." && $file != $filename)
    {
      array_push ($linkl, "$file"); 
    }
  }
  $anzahl = count($linkl);
  sort ($linkl);
  $i=0;
  foreach($linkl as $key => $value)
  {
    if(!file_exists($des_src."/".$value))
    {
      // erstelle ein thumb
      mkthumb($value, $thumbx, $thumby, $folder_scr, $des_src);
    }
   if($i=2){
      echo "<br>";
      $i=0;
   }else{
      echo " ";
   }
   $i++:
   echo "<a href=".$folder_scr."/".$value." target=_blank ><img src=".$des_src."/".$value." border=0 class=rahmen></a><br><b>".$value."</b><br><br>&nbsp;";
 
  }
  closedir($verz);
?>
</div>
<br>