894 views
Dit is een script voor een fotoalbum met commentaar, alleen wil ik de bestanden gesorteerd hebben. Overal heb ik al gekeken, maar nergens heb ik de oplossing gevonden die ik kon implementeren in dit script, wie zou mij kunnen helpen?!
By the way, dit script werkt helemaal, alleen heb ik in mysql nog een table met daarin het foto commentaar en de filename. Op die mannier kun je dus onder iedere foto commentaar plaatsen. Voor de geïnteresseerden onder ons kan ik ook nog wel het uploadscript plaatsen.
Nou, ik ben benieuwd!
<?php
// Configuratie
$gallery="fotoalbum";
$woord="fotoalbum"; // naam vd php file
$path2 = "upload/images/"; // dir waar thumbnails in staan
$path = "upload/images/"; // dir waar foto's in staan
$title = "Pagina: ". ($page + 1);
// Configuratie
$clm = "5"; // Aantal kolommen
$rows = "4"; // aantal rijen
$t_w = "120";
$t_h = "90";
?>
<div align="center">
<?php
echo "<br><br><center><b>$title</b><br><br>";
$min = (1+($page * 20));
$max = (($page +1) * 20);
$number = $clm * $rows;
$break = (($page * 20) + $clm);
echo "<table border=0 cellpadding=0 cellspacing=0><tr>";
$d = dir("$path2");
$count = -1;
while($entry=$d->read()) {
if (($count >= $min) AND ($count <= $max)){
if(eregi(".jpg|.jpeg|.gif|.bmp|.png", $entry)){
ClearStatCache();
$size = GetImageSize("$path/$entry");
$size[0] = $size[0] + 20;
$size[1] = $size[1] + 25;
$file_size=fileSize("$path/$entry");
$file_size = round($file_size / 1000) . "k";
include("../../../connect.php");
$query = ("SELECT foto_comment,foto_name FROM fotoalbum WHERE foto_name='$entry'");
$result = mysql_query($query);
while ($foto_comment = mysql_fetch_array($result)){
echo ("<td><a href=\"#\" onmouseover=\"window.status='Vergroten';return true;\"
onmouseout=\"window.status=''; return true\"
onclick=\"window.open('$path/$entry','pix$count','width=$size[0],height=$size[1],innerwidth=$size[0],innerheight=$size[1],directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=no,top=0,left=0,leftmargin=0,topmargin=0,marginwidth=0,marginheight=0,screenX=0,screenY=0');return false\"><img src='$path2/$entry'");
echo " border=0 alt=$count height=$t_h></a> <br>$foto_comment[0]<br><br> </td>\n"; // width=$t_w
}
}
if ($count == $break){
echo "</tr>\n<tr>\n";
$break = $count + $clm ;
}
}
$count++;
}
$d->close();
echo "</tr></table>";
$pages = ($count / 20);
$pageplus = ($page + 1);
$pagemin = ($page - 1);
if (($page + 1) < $pages){
$volgende = " | <a href=$woord.php?gallery=$gallery&page=$pageplus>Next 20 Pictures</a> |";
}
if (($page+1) > "1"){
$vorige = "| <a href=$woord.php?gallery=$gallery&page=$pagemin>Previous 20 Pictures</a> |";
}
// Footer, dit staat onder de plaatjes.
echo "$vorige $volgende<br><br>Copyright © 2004";
?>