HTML interesse |
|
Hallo,
Heb uiteindelijk een gallery gevonden die thumbs on the fly weergeeft. Maar ik heb een probleem met dit. De 3 bestanden: "index.php", "config.cfg.php" en "picture.php" kunnen slecht worden samengevoegd (of ik heb iets over het hoofd gekeken). Picture.php zorgt ervoor dat de thumbs on the fly wordt weergeven en zorgt ook dat de originele foto wordt weergegeven.
Nu wil ik het intereren in mijn site en dit aanroepen dmv http://site/fotos.php?pid=01 (waarbij 01 eerste album is, 02 is volgende album). Ik heb ?pic=01 gelinkt naar de map foto/zooi/index.php (index.php is bestand waarbij ik ze samen heb gevoegd, maar deze niet wil wrken).
Ik heb tot zover alles geprobeerd, maar de foto's willen alsmaar niet tonen.
Hieronder de 3 bestanden die zo (stand-alone zonder site) zijn. En helemaal daaronder wat ik heb gedaan om ze samen te voegen. Maar het wilt niet helemaal werken, wie kan mij helpen om te laten werken.
"config.cfg.php"
<?
// image directory
$_images_dir_ = 'fotos/zooi/';
// pad van 1e album naar index.php van foto
$_link = '?pid=01';
// minimale breedte van image
$_width_min_ = 150 ;
// verticaal space
$_vspace_ = 10 ;
// horizontaal space
$_hspace_ = 10 ;
// border van image
$_border_ = 0;
// sorteren: SORT_ASC, SORT_DESC
$_sort_ = SORT_ASC;
// breedte van image: 0 voor originele breedte
$_width_max_ = 640 ;
// filename weergven: 1 = Ja, 0 = Nee
$_filename_ = 0;
// aantal kolommen
$_no_cols_ = 3;
// aantal images op een site: aantal kolommen x aantal rijen
$_no_pics_per_page_ = 9;
?>
<? // image directory $_images_dir_ = 'fotos/zooi/'; // pad van 1e album naar index.php van foto $_link = '?pid=01'; // minimale breedte van image $_width_min_ = 150 ; // verticaal space $_vspace_ = 10 ; // horizontaal space $_hspace_ = 10 ; // border van image $_border_ = 0; // sorteren: SORT_ASC, SORT_DESC $_sort_ = SORT_ASC; // breedte van image: 0 voor originele breedte $_width_max_ = 640 ; // filename weergven: 1 = Ja, 0 = Nee $_filename_ = 0; // aantal kolommen $_no_cols_ = 3; // aantal images op een site: aantal kolommen x aantal rijen $_no_pics_per_page_ = 9; ?>
"index.php"
<?
// checken of config.cfg.php file bestaat
if(is_file('config.cfg.php'))
require 'config.cfg.php';
else
die('Error, no config file');
// checken of er een image directorie bestaat
if(!is_dir($_images_dir_))
die('Error, no image directory');
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>fotos</title>
</head>
<body>
<?
$time_start = microtime(true);
// weergave thumb (jpg of gif)
$noimage = 0;
if ($dh = opendir($_images_dir_)) {
while (($f = readdir($dh)) !== false) {
if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'jpg'))
{
$imageinfo = getimagesize($_images_dir_.$f);
$width = $imageinfo[0];
$height = $imageinfo[1];
$size = round(filesize($_images_dir_.$f)/1024,1).' KB';
$noimage++;
$images[] = array('filename' => $f, 'width' => $width, 'height' => $height, 'size' => $size);
array_multisort($images, $_sort_, SORT_REGULAR);
}
}
closedir($dh);
}
if($noimage)
{
if($_GET["img"] != '')
{
echo '<p class="title">'.$images[$_GET["img"]][filename].'</p>';
if($images[$_GET["img"]][filename] != '')
{
if($_GET["img"])
$_no_ = ceil(($_GET["img"]+1)/$_no_pics_per_page_);
else
$_no_ = 1;
if($_GET["img"] == 0)
$side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">up</a> <a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]+1).'" class="link">next >></a></p>';
elseif($_GET["img"] == ($noimage-1))
$side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]-1).'" class="link"><< prev</a> <a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">up</a></p>';
else
$side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]-1).'" class="link"><< prev</a> <a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">up</a> <a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]+1).'" class="link">next >></a></p>';
echo $side.'<p align="center"><img class= "link" src="picture.php?img='.$images[$_GET["img"]][filename].'&show=full" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$_GET["img"]][filename].'" title="'.$images[$_GET["img"]][filename].', '.$images[$_GET["img"]][width].'x'.$images[$_GET["img"]][height].', '.$images[$_GET["img"]][size].'" ></p>'.$side;
}
}
else
{
echo '<p class="title">'.$_page_title_.'</p>';
// echo $noimage.'<br>'.print_r($images);
if($noimage > $_no_pics_per_page_)
$norows = ceil($_no_pics_per_page_/$_no_cols_);
else
$norows = ceil($noimage/$_no_cols_);
$nopos = ceil($noimage/$_no_pics_per_page_);
// echo $nopos;
echo '<table border="0" align="center" cellpadding="0" cellspacing="0">
';
if($_GET["no"] == "")
$no = 1;
else
$no = $_GET["no"];
$index=abs($no-1)*$_no_pics_per_page_;
if(($noimage-$index)<$_no_pics_per_page_)
$norows= ceil(($noimage-$index)/$_no_cols_);
for($a = 1;$a<=$norows;$a++)
{
echo '
<tr>
';
for($b = 1;$b<=$_no_cols_;$b++)
{
if($images[$index][filename] != '')
{
echo '<td width="'.(2*$_vspace_+$_width_min_).'" valign="top" align="center"><a href="'.$_SERVER["PHP_SELF"].'?img='.$index.'" ><img class="link"src="picture.php?img='.$images[$index][filename].'" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$index][filename].'" title="'.$images[$index][filename].', '.$images[$index][width].'x'.$images[$index][height].', '.$images[$index][size].'"></a>
';
if($_filename_)
echo '<span class="name">'.$images[$index][filename].'</span><br><br>';
echo '</td>';
$index++;
}
else
echo '<td width="'.(2*$_vspace_+$_width_min_).'"> </td>';
}
echo '</tr>
';
}
echo '
</table>
';
if($nopos>1)
{
echo '<p class="stopka">';
for($i=1;$i<=$nopos;$i++)
{
if($i == $no)
echo '<font class="stopka_select">'.$i.'</font> ';
else
echo '<a href="'.$_SERVER["PHP_SELF"].'?no='.$i.'" class="stopka">'.$i.'</a> ';
}
echo '</p>';
}
}
}
else
die('No images in directory');
$time_end = microtime(true);
$time = $time_end - $time_start;
echo '<p class="exe"><br>All images in gallery : '.count($images).'</p>';
?>
</body>
</html>
<? // checken of config.cfg.php file bestaat require 'config.cfg.php'; else die('Error, no config file'); // checken of er een image directorie bestaat die('Error, no image directory'); ?> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> <title>fotos</title> </head> <body> <? // weergave thumb (jpg of gif) $noimage = 0; if ($dh = opendir($_images_dir_)) { while (($f = readdir($dh)) !== false) { { $width = $imageinfo[0]; $height = $imageinfo[1]; $noimage++; $images[] = array('filename' => $f, 'width' => $width, 'height' => $height, 'size' => $size); } } } if($noimage) { if($_GET["img"] != '') { echo '<p class="title">'.$images[$_GET["img"]][filename ].'</p>'; if($images[$_GET["img"]][filename] != '') { if($_GET["img"]) $_no_ = ceil(($_GET["img"]+1)/$_no_pics_per_page_); else $_no_ = 1; if($_GET["img"] == 0) $side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">up</a> <a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]+1).'" class="link">next >></a></p>'; elseif($_GET["img"] == ($noimage-1)) $side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]-1).'" class="link"><< prev</a> <a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">up</a></p>'; else $side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]-1).'" class="link"><< prev</a> <a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">up</a> <a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]+1).'" class="link">next >></a></p>'; echo $side.'<p align="center"><img class= "link" src="picture.php?img='.$images[$_GET["img"]][filename ].'&show=full" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$_GET["img"]][filename ].'" title="'.$images[$_GET["img"]][filename ].', '.$images[$_GET["img"]][width ].'x'.$images[$_GET["img"]][height ].', '.$images[$_GET["img"]][size ].'" ></p>'.$side; } } else { echo '<p class="title">'.$_page_title_.'</p>'; // echo $noimage.'<br>'.print_r($images); if($noimage > $_no_pics_per_page_) $norows = ceil($_no_pics_per_page_/$_no_cols_); else $norows = ceil($noimage/$_no_cols_); $nopos = ceil($noimage/$_no_pics_per_page_); // echo $nopos; echo '<table border="0" align="center" cellpadding="0" cellspacing="0"> '; if($_GET["no"] == "") $no = 1; else $no = $_GET["no"]; $index=abs($no-1)*$_no_pics_per_page_; if(($noimage-$index)<$_no_pics_per_page_) $norows= ceil(($noimage-$index)/$_no_cols_); for($a = 1;$a<=$norows;$a++) { <tr> '; for($b = 1;$b<=$_no_cols_;$b++) { if($images[$index][filename] != '') { echo '<td width="'.(2*$_vspace_+$_width_min_).'" valign="top" align="center"><a href="'.$_SERVER["PHP_SELF"].'?img='.$index.'" ><img class="link"src="picture.php?img='.$images[$index][filename ].'" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$index][filename ].'" title="'.$images[$index][filename ].', '.$images[$index][width ].'x'.$images[$index][height ].', '.$images[$index][size ].'"></a> '; if($_filename_) echo '<span class="name">'.$images[$index][filename ].'</span><br><br>'; $index++; } else echo '<td width="'.(2*$_vspace_+$_width_min_).'"> </td>'; } '; } </table> '; if($nopos>1) { echo '<p class="stopka">'; for($i=1;$i<=$nopos;$i++) { if($i == $no) echo '<font class="stopka_select">'.$i.'</font> '; else echo '<a href="'.$_SERVER["PHP_SELF"].'?no='.$i.'" class="stopka">'.$i.'</a> '; } } } } else die('No images in directory'); $time = $time_end - $time_start; echo '<p class="exe"><br>All images in gallery : '.count($images).'</p>'; ?> </body> </html>
"picture.php"
<?
// checken of config.cfg.php file bestaat
if(is_file('config.cfg.php'))
require 'config.cfg.php';
else
die('Error, no config file');
if($_GET[img] == "")
exit;
if (!ereg('^[^./][^/]*$', $_GET[img]))
exit;
$_image_ = $_images_dir_.$_GET[img];
$new_w = $_width_min_;
$imagedata = getimagesize($_image_);
// echo $_image_;
if(!$imagedata[0])
exit();
$new_h = (int)($imagedata[1]*($new_w/$imagedata[0]));
// weergeven van volledige image
if($_GET["show"] == "full")
{
if($_width_max_)
{
if($imagedata[0]<$_width_max_)
{
$new_w = $imagedata[0];
$new_h = $imagedata[1];
}
else
{
$new_w = $_width_max_;
$new_h = (int)($imagedata[1]*($new_w/$imagedata[0]));
}
}
else
{
$new_w = $imagedata[0];
$new_h = $imagedata[1];
}
}
// gegevens voor *.jpg
if(strtolower(substr($_GET[img],-3)) == "jpg")
{
header("Content-type: image/jpg");
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromJpeg($_image_);
$dst_img = imagecreatetruecolor($new_w, $new_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
$img = Imagejpeg($dst_img);
}
// gegevens voor *.gif
if(substr($_GET[img],-3) == "gif")
{
header("Content-type: image/gif");
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromGif($_image_);
ImagePaletteCopy($dst_img,$src_img);
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
$img = Imagegif($dst_img);
}
?>
<? // checken of config.cfg.php file bestaat require 'config.cfg.php'; else die('Error, no config file'); if($_GET[img] == "") if (!ereg('^[^./][^/]*$', $_GET[img ])) $_image_ = $_images_dir_.$_GET[img]; $new_w = $_width_min_; // echo $_image_; if(!$imagedata[0]) $new_h = (int)($imagedata[1]*($new_w/$imagedata[0])); // weergeven van volledige image if($_GET["show"] == "full") { if($_width_max_) { if($imagedata[0]<$_width_max_) { $new_w = $imagedata[0]; $new_h = $imagedata[1]; } else { $new_w = $_width_max_; $new_h = (int)($imagedata[1]*($new_w/$imagedata[0])); } } else { $new_w = $imagedata[0]; $new_h = $imagedata[1]; } } // gegevens voor *.jpg { header("Content-type: image/jpg"); $dst_img=ImageCreate($new_w,$new_h); $src_img=ImageCreateFromJpeg($_image_); $dst_img = imagecreatetruecolor($new_w, $new_h); imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img)); $img = Imagejpeg($dst_img); } // gegevens voor *.gif if(substr($_GET[img ],-3) == "gif") { header("Content-type: image/gif"); $dst_img=ImageCreate($new_w,$new_h); $src_img=ImageCreateFromGif($_image_); ImagePaletteCopy($dst_img,$src_img); ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img)); $img = Imagegif($dst_img); } ?>
En nu wat ik heb gedaan om dit in 1 file te laten werken (wat ie dus niet doet).
nieuwe "index.php"
<?
// image directory
$_images_dir_ = 'fotos/zooi/';
// checken of er een image directorie bestaat
if(!is_dir($_images_dir_))
die('Error, no image directory');
// pad van 1e album naar index.php van foto
$_link = '?pid=01';
// minimale breedte van image
$_width_min_ = 150 ;
// verticaal space
$_vspace_ = 10 ;
// horizontaal space
$_hspace_ = 10 ;
// border van image
$_border_ = 0;
// sorteren: SORT_ASC, SORT_DESC
$_sort_ = SORT_ASC;
// breedte van image: 0 voor originele breedte
$_width_max_ = 640 ;
// filename weergven: 1 = Ja, 0 = Nee
$_filename_ = 0;
// aantal kolommen
$_no_cols_ = 3;
// aantal images op een site: aantal kolommen x aantal rijen
$_no_pics_per_page_ = 9;
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>QuickGallery</title>
<meta NAME="Author" CONTENT="Marcin Chmielecki">
<link href="<?echo $_style_?>" rel="stylesheet" type="text/css">
</head>
<body>
<?
$time_start = microtime(true);
// weergave thumb (jpg of gif)
$noimage = 0;
if ($dh = opendir($_images_dir_)) {
while (($f = readdir($dh)) !== false) {
if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'jpg'))
{
$imageinfo = getimagesize($_images_dir_.$f);
$width = $imageinfo[0];
$height = $imageinfo[1];
$size = round(filesize($_images_dir_.$f)/1024,1).' KB';
$noimage++;
$images[] = array('filename' => $f, 'width' => $width, 'height' => $height, 'size' => $size);
array_multisort($images, $_sort_, SORT_REGULAR);
}
}
closedir($dh);
}
if($noimage)
{
if($_GET["img"] != '')
{
echo '<p class="title">'.$images[$_GET["img"]][filename].'</p>';
if($images[$_GET["img"]][filename] != '')
{
if($_GET["img"])
$_no_ = ceil(($_GET["img"]+1)/$_no_pics_per_page_);
else
$_no_ = 1;
if($_GET["img"] == 0)
$side = '<p class="link"><a href="'.$_link.'&no='.$_no_.'" class="link">up</a> <a href="'.$_link.'&img='.($_GET["img"]+1).'" class="link">next >></a></p>';
elseif($_GET["img"] == ($noimage-1))
$side = '<p class="link"><a href="'.$_link.'&img='.($_GET["img"]-1).'" class="link"><< prev</a> <a href="'.$_link.'&no='.$_no_.'" class="link">up</a></p>';
else
$side = '<p class="link"><a href="'.$_link.'&img='.($_GET["img"]-1).'" class="link"><< prev</a> <a href="'.$_link.'&no='.$_no_.'" class="link">up</a> <a href="'.$_link.'&img='.($_GET["img"]+1).'" class="link">next >></a></p>';
echo $side.'<p align="center"><img class="link" src="'.$_link.'&img='.$images[$_GET["img"]][filename].'&show=full" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$_GET["img"]][filename].'" title="'.$images[$_GET["img"]][filename].', '.$images[$_GET["img"]][width].'x'.$images[$_GET["img"]][height].', '.$images[$_GET["img"]][size].'" ></p>'.$side;
}
}
else
{
echo '<p class="title">'.$_page_title_.'</p>';
// echo $noimage.'<br>'.print_r($images);
if($noimage > $_no_pics_per_page_)
$norows = ceil($_no_pics_per_page_/$_no_cols_);
else
$norows = ceil($noimage/$_no_cols_);
$nopos = ceil($noimage/$_no_pics_per_page_);
// echo $nopos;
echo '<table border="0" align="center" cellpadding="0" cellspacing="0">
';
if($_GET["no"] == "")
$no = 1;
else
$no = $_GET["no"];
$index=abs($no-1)*$_no_pics_per_page_;
if(($noimage-$index)<$_no_pics_per_page_)
$norows= ceil(($noimage-$index)/$_no_cols_);
for($a = 1;$a<=$norows;$a++)
{
echo '
<tr>
';
for($b = 1;$b<=$_no_cols_;$b++)
{
if($images[$index][filename] != '')
{
echo '<td width="'.(2*$_vspace_+$_width_min_).'" valign="top" align="center"><a href="'.$_link.'&img='.$index.'" ><img class="link"src="'.$_link.'&img='.$images[$index][filename].'" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$index][filename].'" title="'.$images[$index][filename].', '.$images[$index][width].'x'.$images[$index][height].', '.$images[$index][size].'"></a>
';
if($_filename_)
echo '<span class="name">'.$images[$index][filename].'</span><br><br>';
echo '</td>';
$index++;
}
else
echo '<td width="'.(2*$_vspace_+$_width_min_).'"> </td>';
}
echo '</tr>
';
}
echo '
</table>
';
if($nopos>1)
{
echo '<p class="stopka">';
for($i=1;$i<=$nopos;$i++)
{
if($i == $no)
echo '<font class="stopka_select">'.$i.'</font> ';
else
echo '<a href="'.$_link.'&no='.$i.'" class="stopka">'.$i.'</a> ';
}
echo '</p>';
}
}
}
else
die('No images in directory');
$time_end = microtime(true);
$time = $time_end - $time_start;
echo '<p class="exe"><br>All images in gallery : '.count($images).'</p>';
?>
</body>
</html>
<?
if($_GET[img] == "")
exit;
if (!ereg('^[^./][^/]*$', $_GET[img]))
exit;
$_image_ = $_images_dir_.$_GET[img];
$new_w = $_width_min_;
$imagedata = getimagesize($_image_);
// echo $_image_;
if(!$imagedata[0])
exit();
$new_h = (int)($imagedata[1]*($new_w/$imagedata[0]));
// weergeven van volledige image
if($_GET["show"] == "full")
{
if($_width_max_)
{
if($imagedata[0]<$_width_max_)
{
$new_w = $imagedata[0];
$new_h = $imagedata[1];
}
else
{
$new_w = $_width_max_;
$new_h = (int)($imagedata[1]*($new_w/$imagedata[0]));
}
}
else
{
$new_w = $imagedata[0];
$new_h = $imagedata[1];
}
}
// gegevens voor *.jpg
if(strtolower(substr($_GET[img],-3)) == "jpg")
{
header("Content-type: image/jpg");
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromJpeg($_image_);
$dst_img = imagecreatetruecolor($new_w, $new_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
$img = Imagejpeg($dst_img);
}
// gegevens voor *.gif
if(substr($_GET[img],-3) == "gif")
{
header("Content-type: image/gif");
$dst_img=ImageCreate($new_w,$new_h);
$src_img=ImageCreateFromGif($_image_);
ImagePaletteCopy($dst_img,$src_img);
ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));
$img = Imagegif($dst_img);
}
?>
<? // image directory $_images_dir_ = 'fotos/zooi/'; // checken of er een image directorie bestaat die('Error, no image directory'); // pad van 1e album naar index.php van foto $_link = '?pid=01'; // minimale breedte van image $_width_min_ = 150 ; // verticaal space $_vspace_ = 10 ; // horizontaal space $_hspace_ = 10 ; // border van image $_border_ = 0; // sorteren: SORT_ASC, SORT_DESC $_sort_ = SORT_ASC; // breedte van image: 0 voor originele breedte $_width_max_ = 640 ; // filename weergven: 1 = Ja, 0 = Nee $_filename_ = 0; // aantal kolommen $_no_cols_ = 3; // aantal images op een site: aantal kolommen x aantal rijen $_no_pics_per_page_ = 9; ?> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-2"> <title>QuickGallery</title> <meta NAME="Author" CONTENT="Marcin Chmielecki"> <link href=" <? echo $_style_? >" rel="stylesheet" type="text/css"> </head> <body> <? // weergave thumb (jpg of gif) $noimage = 0; if ($dh = opendir($_images_dir_)) { while (($f = readdir($dh)) !== false) { { $width = $imageinfo[0]; $height = $imageinfo[1]; $noimage++; $images[] = array('filename' => $f, 'width' => $width, 'height' => $height, 'size' => $size); } } } if($noimage) { if($_GET["img"] != '') { echo '<p class="title">'.$images[$_GET["img"]][filename ].'</p>'; if($images[$_GET["img"]][filename] != '') { if($_GET["img"]) $_no_ = ceil(($_GET["img"]+1)/$_no_pics_per_page_); else $_no_ = 1; if($_GET["img"] == 0) $side = '<p class="link"><a href="'.$_link.'&no='.$_no_.'" class="link">up</a> <a href="'.$_link.'&img='.($_GET["img"]+1).'" class="link">next >></a></p>'; elseif($_GET["img"] == ($noimage-1)) $side = '<p class="link"><a href="'.$_link.'&img='.($_GET["img"]-1).'" class="link"><< prev</a> <a href="'.$_link.'&no='.$_no_.'" class="link">up</a></p>'; else $side = '<p class="link"><a href="'.$_link.'&img='.($_GET["img"]-1).'" class="link"><< prev</a> <a href="'.$_link.'&no='.$_no_.'" class="link">up</a> <a href="'.$_link.'&img='.($_GET["img"]+1).'" class="link">next >></a></p>'; echo $side.'<p align="center"><img class="link" src="'.$_link.'&img='.$images[$_GET["img"]][filename ].'&show=full" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$_GET["img"]][filename ].'" title="'.$images[$_GET["img"]][filename ].', '.$images[$_GET["img"]][width ].'x'.$images[$_GET["img"]][height ].', '.$images[$_GET["img"]][size ].'" ></p>'.$side; } } else { echo '<p class="title">'.$_page_title_.'</p>'; // echo $noimage.'<br>'.print_r($images); if($noimage > $_no_pics_per_page_) $norows = ceil($_no_pics_per_page_/$_no_cols_); else $norows = ceil($noimage/$_no_cols_); $nopos = ceil($noimage/$_no_pics_per_page_); // echo $nopos; echo '<table border="0" align="center" cellpadding="0" cellspacing="0"> '; if($_GET["no"] == "") $no = 1; else $no = $_GET["no"]; $index=abs($no-1)*$_no_pics_per_page_; if(($noimage-$index)<$_no_pics_per_page_) $norows= ceil(($noimage-$index)/$_no_cols_); for($a = 1;$a<=$norows;$a++) { <tr> '; for($b = 1;$b<=$_no_cols_;$b++) { if($images[$index][filename] != '') { echo '<td width="'.(2*$_vspace_+$_width_min_).'" valign="top" align="center"><a href="'.$_link.'&img='.$index.'" ><img class="link"src="'.$_link.'&img='.$images[$index][filename ].'" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$index][filename ].'" title="'.$images[$index][filename ].', '.$images[$index][width ].'x'.$images[$index][height ].', '.$images[$index][size ].'"></a> '; if($_filename_) echo '<span class="name">'.$images[$index][filename ].'</span><br><br>'; $index++; } else echo '<td width="'.(2*$_vspace_+$_width_min_).'"> </td>'; } '; } </table> '; if($nopos>1) { echo '<p class="stopka">'; for($i=1;$i<=$nopos;$i++) { if($i == $no) echo '<font class="stopka_select">'.$i.'</font> '; else echo '<a href="'.$_link.'&no='.$i.'" class="stopka">'.$i.'</a> '; } } } } else die('No images in directory'); $time = $time_end - $time_start; echo '<p class="exe"><br>All images in gallery : '.count($images).'</p>'; ?> </body> </html> <? if($_GET[img] == "") if (!ereg('^[^./][^/]*$', $_GET[img ])) $_image_ = $_images_dir_.$_GET[img]; $new_w = $_width_min_; // echo $_image_; if(!$imagedata[0]) $new_h = (int)($imagedata[1]*($new_w/$imagedata[0])); // weergeven van volledige image if($_GET["show"] == "full") { if($_width_max_) { if($imagedata[0]<$_width_max_) { $new_w = $imagedata[0]; $new_h = $imagedata[1]; } else { $new_w = $_width_max_; $new_h = (int)($imagedata[1]*($new_w/$imagedata[0])); } } else { $new_w = $imagedata[0]; $new_h = $imagedata[1]; } } // gegevens voor *.jpg { header("Content-type: image/jpg"); $dst_img=ImageCreate($new_w,$new_h); $src_img=ImageCreateFromJpeg($_image_); $dst_img = imagecreatetruecolor($new_w, $new_h); imagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img)); $img = Imagejpeg($dst_img); } // gegevens voor *.gif if(substr($_GET[img ],-3) == "gif") { header("Content-type: image/gif"); $dst_img=ImageCreate($new_w,$new_h); $src_img=ImageCreateFromGif($_image_); ImagePaletteCopy($dst_img,$src_img); ImageCopyResized($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img)); $img = Imagegif($dst_img); } ?>
Ik hoop dat jullie mij (verder) willen helpen en dat het duidelijk is.
het enige probleem is dat ie geen plaatje zowel bij thumb als origineel niet wilt tonen.
Alvast bedankt.
|