Lid |
|
http://sitemast...amp;id=276
Kheb dus dat script gedownd en de instellingen juist gezet maar ik krijg steeds een of andere vage error
Citaat: Warning: opendir($dir): failed to open dir: No such file or directory in /drive2/fpgshttpd/cyberstek/website/foto/index.php on line 25
De dir is er dus wel degelijk. waaraan zou dit nog kunnen liggen?
<?php
//Door Tom Lustig
$dir ="img"; // Dir van je foto's
$Gal ="Referentie's"; // Titel
$thumb ="thumbs"; // Thumbs directory naam
$thumbwidth ="100"; // Width van een thumbnail
$imagequality ="100"; // Foto kwaliteit, in procenten
$cols ="4"; // Aantal kolommen
$vi ="Bekijk Foto"; // Text voor link van foto bekijken
$sname ="index.php"; // Naam van deze file
$isz ="Grote"; // Text voor grote
$msgnav ="Bekijk FotoGallery"; // Text voor het bekijken van de gallery
$msgcp ="Foto"; // Text voor een foto
$msgof ="van"; // Text voor foto 1 VAN 24
$msgback ="Terug naar het album"; // Text voor link naar de gallery
if (isset($_GET['iid'])) {
$_GET['iid'];
} elseif (isset($_POST['iid'])) {
$_POST['iid'];
}
$files = array();
if ($handle = opendir('$dir')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if (eregi("\.jpe?g$", $file) ||
eregi("\.gif$", $file) ||
eregi("\.png$", $file)) {
$files[] = $file;
}
}
}
closedir($handle);
}
sort($files);
if (!is_dir($thumb)) {
mkdir($thumb, 0755);
}
$i = 0;
$th = array();
$iw = array();
$ih = array();
$ifs = array();
foreach ($files as $image) {
$thumbimage = $thumb."/".$image;
$thumb_exists = file_exists($thumbimage);
$size = GetImageSize($image);
$width = $size[0];
$height = $size[1];
$type = $size[2];
if (!$thumb_exists) {
set_time_limit(30);
switch ($type) {
case 1 :
$im = ImageCreateFromGIF($image);
break;
case 2 :
$im = ImageCreateFromJPEG($image);
break;
case 3 :
$im = ImageCreateFromPNG($image);
break;
}
$newwidth = $thumbwidth;
$newheight = ($newwidth / $width) * $height;
$im2 = ImageCreateTrueColor($newwidth,$newheight);
ImageCopyResampled($im2,$im,0,0,0,0,$newwidth,$newheight,$width,$height);
switch ($type) {
case 1:
ImageGIF($im2, $thumbimage);
break;
case 2:
ImageJpeg($im2, $thumbimage, $imagequality);
break;
case 3:
ImagePNG($im2, $thumbimage);
break;
imagedestroy($im);
imagedestroy($im2);
}
}
$th[$i] = $thumbimage;
$iw[$i] = $width;
$ih[$i] = $height;
$ifs[$i] = round((@filesize($image)/1024), 1);
$i++;
}
echo "<br>";
echo "<p align=\"center\"><font size=\"4\" color=\"#000000\">" . $Gal . "</font></p>";
echo "<br>";
echo "<table border=\"1\" align=\"center\" bordercolor=\"#000000\" cellspacing=\"3\" cellpadding=\"3\">"; // Dit kan je natuurlijk naar je eigen style aanpassen
if (!isset($iid)) {
$rows = round(count($th)/$cols);
if (($rows * $cols) < (count($th))) {
$rows++;
}
for ($i = 1; $i <= $rows; $i++) {
echo "<tr>";
for ($j = 1; $j <= $cols; $j++) {
$td = (($i - 1) * $cols) + $j;
$iu = ($td - 1);
if (isset($th[$iu])) {
$op = "";
$op .= "<td>\n<div align=\"center\">\n<br>\n";
$op .= "<a title=\"" . $vi . "\" href=\"" . $sname . "?iid=" .$iu . "\">\n";
$op .= "<img src=\"" . $th[$iu] . "\" border=\"0\">\n";
$op .= "<br>" . $isz . ": " . $hw[$iu] . " x" . $ih[$iu] . "\n";
$op .= "<br>" . $ifs[$iu] . " Kb.</a>\n";
$op .= "<br>\n</div>\n</td>\n";
echo $op;
} else {
echo "<td>\n<br></td>\n";
}
}
echo "</tr>\n";
}
} else {
$iid2 = $iid+1;
$tot = count($th);
$op = "";
$op .= "<tr>\n<td>\n<div align=\"center\"> " . $msgnav . " " . $Gal . " :: " . $msgcp . " " . $iid2 . " " . $msgof . " " . $tot . " </td>\n</tr>\n<tr>\n";
$op .= "<td>\n<div align=\"center\">\n<br>\n";
$op .= "<img src=\"" . $files[$iid] . "\" border=\"0\">\n";
$op .= "<br>" . $isz . " " . $iw[$iid] . " x " . $ih[$iid] . "\n";
$op .= "<br>" . $ifs[$iid] . " Kb.</a>\n";
$op .= "<br>\n</div>\n</td>\n</tr>\n";
$op .= "<tr>\n<td>\n<div align=\"center\"><a href=\"" . $sname . "\"> " . $msgback . " </a></div></td></tr>";
echo $op;
}
echo "</table>";
?>
<?php //Door Tom Lustig $dir ="img"; // Dir van je foto's $Gal ="Referentie's"; // Titel $thumb ="thumbs"; // Thumbs directory naam $thumbwidth ="100"; // Width van een thumbnail $imagequality ="100"; // Foto kwaliteit, in procenten $cols ="4"; // Aantal kolommen $vi ="Bekijk Foto"; // Text voor link van foto bekijken $sname ="index.php"; // Naam van deze file $isz ="Grote"; // Text voor grote $msgnav ="Bekijk FotoGallery"; // Text voor het bekijken van de gallery $msgcp ="Foto"; // Text voor een foto $msgof ="van"; // Text voor foto 1 VAN 24 $msgback ="Terug naar het album"; // Text voor link naar de gallery if (isset($_GET['iid'])) { $_GET['iid']; } elseif (isset($_POST['iid'])) { $_POST['iid']; } while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (eregi("\.jpe?g$", $file) || eregi("\.gif$", $file) || eregi("\.png$", $file)) { $files[] = $file; } } } } } $i = 0; foreach ($files as $image) { $thumbimage = $thumb."/".$image; $width = $size[0]; $height = $size[1]; $type = $size[2]; if (!$thumb_exists) { switch ($type) { case 1 : $im = ImageCreateFromGIF($image); break; case 2 : $im = ImageCreateFromJPEG($image); break; case 3 : $im = ImageCreateFromPNG($image); break; } $newwidth = $thumbwidth; $newheight = ($newwidth / $width) * $height; $im2 = ImageCreateTrueColor($newwidth,$newheight); ImageCopyResampled($im2,$im,0,0,0,0,$newwidth,$newheight,$width,$height); switch ($type) { case 1: ImageGIF($im2, $thumbimage); break; case 2: ImageJpeg($im2, $thumbimage, $imagequality); break; case 3: ImagePNG($im2, $thumbimage); break; imagedestroy($im); imagedestroy($im2); } } $th[$i] = $thumbimage; $iw[$i] = $width; $ih[$i] = $height; $i++; } echo "<p align=\"center\"><font size=\"4\" color=\"#000000\">" . $Gal . "</font></p>"; echo "<table border=\"1\" align=\"center\" bordercolor=\"#000000\" cellspacing=\"3\" cellpadding=\"3\">"; // Dit kan je natuurlijk naar je eigen style aanpassen if (($rows * $cols) < (count($th))) { $rows++; } for ($i = 1; $i <= $rows; $i++) { for ($j = 1; $j <= $cols; $j++) { $td = (($i - 1) * $cols) + $j; $iu = ($td - 1); $op = ""; $op .= "<td>\n<div align=\"center\">\n<br>\n"; $op .= "<a title=\"" . $vi . "\" href=\"" . $sname . "?iid=" .$iu . "\">\n"; $op .= "<img src=\"" . $th[$iu] . "\" border=\"0\">\n"; $op .= "<br>" . $isz . ": " . $hw[$iu] . " x" . $ih[$iu] . "\n"; $op .= "<br>" . $ifs[$iu] . " Kb.</a>\n"; $op .= "<br>\n</div>\n</td>\n"; } else { echo "<td>\n<br></td>\n"; } } } } else { $iid2 = $iid+1; $op = ""; $op .= "<tr>\n<td>\n<div align=\"center\"> " . $msgnav . " " . $Gal . " :: " . $msgcp . " " . $iid2 . " " . $msgof . " " . $tot . " </td>\n</tr>\n<tr>\n"; $op .= "<td>\n<div align=\"center\">\n<br>\n"; $op .= "<img src=\"" . $files[$iid] . "\" border=\"0\">\n"; $op .= "<br>" . $isz . " " . $iw[$iid] . " x " . $ih[$iid] . "\n"; $op .= "<br>" . $ifs[$iid] . " Kb.</a>\n"; $op .= "<br>\n</div>\n</td>\n</tr>\n"; $op .= "<tr>\n<td>\n<div align=\"center\"><a href=\"" . $sname . "\"> " . $msgback . " </a></div></td></tr>"; } ?>
|