<?php
$img_width = 96;
$img_format = array();
$img_format[] = 'jpg';
$img_format[] = 'gif';
$img_format[] = 'png';
//====================
?>
<table><tr><td>
<table border="0" cellpadding="0" cellspacing="0">
<?php
$prev_rep=substr("$path",0,(strlen("$path")-strlen(strrchr("$path","/"))));
echo "<tr><td colspan=\"2\" align=\"left\"><a href=\"?path=$prev_rep\" class=\"dir\"><img src=sys/icons/previous.gif border=0>..</a></td></tr>\n";
if (!($dir = @opendir("$path/tiny"))) $dir_ok = mkdir("$path/tiny");
else $dir_ok = true;
@closedir($dir);
if ($dir = opendir("$path"))
{
while (false !== ($file = readdir($dir)))
{
$file_ext = strtolower(substr(strrchr($file,"."),1));
if (in_array($file_ext, $img_format))
{
if (! file_exists("$path/tiny/$file.jpg"))
{
if (($file_ext == 'jpg') || ($file_ext == 'jpeg')) $src = ImageCreateFromJPEG("$path/$file" );
else if ($file_ext == 'gif') $src = ImageCreateFromGIF("$path/$file" );
else if ($file_ext == 'png') $src = ImageCreateFromPNG("$path/$file" );
$org_h = imagesy($src);
$org_w = imagesx($src);
$img_height = floor(($img_width * $org_h) / $org_w);
$img = ImageCreate($img_width, $img_height);
ImageCopyResized($img, $src,0,0,0,0,$img_width,$img_height,$org_w,$org_h);
imagejpeg($img, "$path/tiny/$file.jpg");
ImageDestroy($img);
}
echo "<tr>
<td align=\"left\">
<a href=\"sys/img.php?img=$path/$file\"><img src=\"$path/tiny/$file.jpg\" border=0></a><br>&nbsp;
</td>
<td class=\"file\">&nbsp;&nbsp;</td>
</tr>\n";
}
}
}
@closedir($dir);
?>
</table></td><td>
<img src=sys/<?=$logo_img;?>></td></tr></table>