o to kod
<? $folder = zdjecia; $scale = 0; $maxwidth = 440; $maxheight = 500; $thumbmaxw = 50; $thumbmaxh = 50; $imgperpage = 5; $imgperrow = 5; $pgperrow = 10; $cursign = ''; $currentdir = 'zdjecia'; $title = "Pics"; $stylesheet = '' ; $home = "{$_SERVER['PHP_SELF']}"; $this_page = "{$_SERVER['PHP_SELF']}"; $caption = ""; $captionext = "txt"; //--- ind is put to zero when the script is first called uppon--- $_GET['ind'] = 0; $index = $_GET['ind']; //---the following code iterates through the directory and puts any image found in the imagelist array--- $extention = $extention[$extfield]; } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title><?= $title ?></title> <? if ($stylesheet == ''){ //--insert the default style sheet into html if none specified echo '<style type="text/css">' .'.imag { border-style : solid;' .'border-color: blue;' .'border-width : 1px;}' .'.thumb { border-style : solid;' .'border-color: #999999;' .'border-width : 2px;}' .'A:link { color: #999999;' .'text-decoration : none; }' .'A:visited { color: #999999;' .'text-decoration : none; }' .'A:hover { color:blue; }' .'</style>'; } elseif ($stylesheet == 'none') { //--no style sheet if that is what you want } else { } ?> </head> <body> <table align="center" border="0"> <tr> <td> <? if($index-1 >= 0) {?> <? } ?> </td> <td> <? //--- This is where the large pictures are resized so that they maintain ratio--- $imgwidth = $sizeee[0]; $imgheight = $sizeee[1]; if ($scale == 1 || $imgwidth > $maxwidth || $imgheight > $maxheight) { // decide if img needs to be scaled $newwidth = $imgwidth/($imgheight/$maxheight); $newheight = $imgheight/($imgwidth/$maxwidth); if ($imgwidth < $imgheight) { if ($newwidth > $maxwidth) { ?> <a href="<?= $imagelist[$index] ?>" target="_blank"> <img src="<?= $imagelist[$index] ?>" width="<?= $maxwidth ?>" height="<?= $newheight ?>" alt="" /> </a> <? } else { ?> <a href="<?= $imagelist[$index] ?>" target="_blank"> <img src="<?= $imagelist[$index] ?>" width="<?= $newwidth ?>" height="<?= $maxheight ?>" alt="" /> </a> <? } } else { if ($newhight > $maxheight) { ?> <a href="<?= $imagelist[$index] ?>" target="_blank"> <img src="<?= $imagelist[$index] ?>" width="<?= $newwidth ?>" height="<?= $maxheight ?>" alt="" /> </a> <? } else { ?> <a href="<?= $imagelist[$index] ?>" target="_blank"> <img src="<?= $imagelist[$index] ?>" width="<?= $maxwidth ?>" height="<?= $newheight ?>" alt="" /> </a> <? } } } else { ?> <a href="<?= $imagelist[$index] ?>" target="_blank"> <img src="<?= $imagelist[$index] ?>" width="<?= $imgwidth ?>" height="<?= $imgheight ?>" alt="" /> </a> <? } ?> </td> <td> <? } ?> </td> </tr> <tr> <td> </td> <td> <center><? include $imagelist[$index]. "." . $captionext; else </center> </td> <td> </td> </tr> </table> <table align="center"> <tr><td></td> <? //---this code generates the thumbnails based on the configuration settings--- for($j=0;$j<$nrpages;$j++) { if( $index >= ($j*$imgperpage) && ($index < (($j+1) * $imgperpage)) ) { for($i=($j*$imgperpage);$i<(($j+1) * $imgperpage);$i++) { if(($i%$imgperrow == 0) && ($i > 0)) { ?> </tr> <tr> <? } if($i <count($imagelist) ) { $path = "$this_page?ind=".$i; ?> <td> <? //--- This is where the thumbnails are resized so that they maintain ratio--- $imgwidth = $sizeee[0]; $imgheight = $sizeee[1]; $newthumbw = $imgwidth/($imgheight/$thumbmaxh); $newthumbh = $imgheight/($imgwidth/$thumbmaxw); if ($imgwidth < $imgheight) { if ($newthumbw > $thumbmaxw) { ?> <a href="<?= $path ?>"> <img src="<?= $imagelist[$i] ?>" width="<?= $thumbmaxw ?>" height="<?= $newthumbh ?>" alt="" /> </a> <? } else { ?> <a href="<?= $path ?>"> <img src="<?= $imagelist[$i] ?>" width="<?= $newthumbw ?>" height="<?= $thumbmaxh ?>" alt="" /> </a> <? } } else { if ($newthumbh > $thumbmaxh) { ?> <a href="<?= $path ?>"> <img src="<?= $imagelist[$i] ?>" width="<?= $newthumbw ?>" height="<?= $thumbmaxh ?>" /> </a> <? } else { ?> <a href="<?= $path ?>"> <img src="<?= $imagelist[$i] ?>" width="<?= $thumbmaxw ?>" height="<?= $newthumbh ?>" alt="" /> </a> <? } } ?> </td> <? } } } } ?> </tr> </table> <? if($index-1 >= 0) {?> <a href='<?= $this_page ?>?ind=<?= $index-1 ?>'><img src="images/strzalka_lewo.gif" alt="Poprzednie" /></a> <? } ?> <a href="<?= $this_page ?>?ind=<?= $index+1 ?>"><img src="images/strzalka_prawo.gif" alt="Następne" /></a> <center> <? //---this code generates links based on the configuration settings--- //---only puts $pgperrow page links per row to make cleaner--- for($j=0;$j<$nrpages;$j++) { if(($j%$pgperrow == 0) && ($j > 0)) { ?> <? } ?> <a href="<?= $this_page ?>?ind=<?= ($j*$imgperpage) ?>">[ <strong> Strona <?= ($j+1) ?></strong> ]</a> <? } ?> </center> </body> </html> </body> </html>
za każdą odp daje +