jeg paster det bare her ...
du kan se en demo på
http://www.easyfrag.dk/thumbnailgen/o_s_babes.php<?php
$TITLE = \"Open Source Babes\"; // Titel på siden.
$UNIXDIR = \"/easyfrag/WWW/pic/babes/\"; // Bibliotek med billeder.
$WWWDIR = \"/pic/babes/\"; // Bibliotek på WWW serveren med billeder.
$NUMBER = 8; // Antal billeder pr. side.
if($file) {
$dst_im = @ImageCreate(80,100) or die (\"Cannot Initialize new GD image stream\");
$src_im = @ImageCreateFromJPEG($UNIXDIR.$file) or die(\"Failed to open JPEG file\");
ImageCopyResized($dst_im,$src_im,0,0,0,0,80,100,ImageSX($src_im),ImageSY($src_im));
header(\"Content-type: image/png\");
ImagePng($dst_im);
}
?>
<html>
<head>
<title><?php print($TITLE); ?></title>
</head>
<LINK REL=stylesheet HREF=/styles.css TYPE=text/css>
<body bgcolor=\"#000000\">
<div align=center>
<table border=0 cellspacing=0 cellpadding=0 width=650>
<tr>
<td valign=top>
<div align=right><font class=heading>.<?php print($TITLE); ?> </font></div>
</td>
</tr>
<tr>
<td valign=top background=/gfx/maintabletop.jpg height=20>
</td>
</tr>
<tr>
<td valign=top background=/gfx/maintablefill.jpg>
<div align=center>
<table border=0 cellspacing=0 cellpadding=0 width=644>
<tr>
<td valign=top>
<font class=normal>
<?php
if(!isset($show)) {
if(!isset($page)) $page = 1;
print(\"<font class=tableheading> Side \".$page.\"</font>\\n<br>\\n<br>\\n<table align=\\\"center\\\" width=644>\\n\");
$from = ($page-1)*$NUMBER;
$to = $page*$NUMBER;
$d = dir($UNIXDIR);
$c = 6969;
$count = 0;
while($entry = $d->read()) {
if(substr($entry,-4) == \".jpg\") {
if($count >= $from && $count < $to) {
if($c < 4) {
print(\"<td align=\\\"center\\\" class=\\\"tiny\\\" height=120><a href=\\\"\".$PHP_SELF.\"?show=\".$entry.\"\\\"><img src=\\\"\".$PHP_SELF.\"?file=\".$entry.\"\\\" border=0></a><br>\".$entry.\"</td>\\n\");
$c += 1;
}
else {
if($c == 6969) {
print(\"<tr>\\n<td align=\\\"center\\\" class=\\\"tiny\\\" height=120><a href=\\\"\".$PHP_SELF.\"?show=\".$entry.\"\\\"><img src=\\\"\".$PHP_SELF.\"?file=\".$entry.\"\\\" border=0></a><br>\".$entry.\"</td>\\n\");
$c = 1;
}
else {
print(\"</tr>\\n<tr>\\n<td align=\\\"center\\\" class=\\\"tiny\\\" height=120><a href=\\\"\".$PHP_SELF.\"?show=\".$entry.\"\\\"><img src=\\\"\".$PHP_SELF.\"?file=\".$entry.\"\\\" border=0></a><br>\".$entry.\"</td>\\n\");
$c = 1;
}
}
}
if($count == $to) {
$next = $page+1;
print(\"</tr>\\n</table>\\n<p align=\\\"center\\\">\");
if($page != 1) {
$prev = $page-1;
print(\"<a href=\\\"\".$PHP_SELF.\"?page=\".$prev.\"\\\">forrige side</a> | \");
}
print(\"<a href=\\\"\".$PHP_SELF.\"?page=\".$next.\"\\\">næste side</a></p>\\n\");
break;
}
$count += 1;
}
}
if($c != 6969 || $c == 4) {
print(\"\\n\");
}
if($page != 1 && !isset($prev)) {
$prev = $page-1;
print(\"</tr>\\n</table>\\n<p align=\\\"center\\\"><a href=\\\"\".$PHP_SELF.\"?page=\".$prev.\"\\\">forrige side</a></p>\\n\");
}
$d->close();
}
else {
?>
<p align=\"center\" class=tableheading><?php print($show); ?></p>
<p align=\"center\"><img src=\"<?php print($WWWDIR.$show); ?>\" alt=\"<?php print($show); ?>\"></p>
<p align=\"center\"><a href=\"java script:history.go(-1);\">Tilbage</a></p>
<?php
}
?>
</font>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td valign=top background=/gfx/maintablebottom.jpg height=11>
</td>
</tr>
</table>
</body>
</html>