okay, i don't know anything about php at all whatsoever, i'm a beginner and stuff but umm.. okay if you go to this part of my site: http://botchla.radiostatic.org//.php?start=50 it shows "___.php" as a broken image and i do not for the life of me know how to get that to be hidden.. if anyone could help that would be much appreciated.. here is the script:
<!-- Gallery START //-->
<table cellpadding="10" align="center"
cellspacing="0" border="0" align="center">
<?PHP
//initializing array function
$retVal = array ();
//Load Directory Into Array
$handle=opendir('.');
while (false !== ($file = readdir($handle)))
// ***** This if-statement needs to be changed if you want to display *****
// ***** other types than jpegs *****
//Sorting out ., .. and all files that aren´t jpegs
if ($file != "." && $file != "..") {
//assigning directory listing to array $retVal
$retVal [count($retVal)] = $file;
}
//****************************************************************************
// Initialize variables
//
// These three lines are
// the only ones that need
// to be edited.
//
// $thumbnail_dir = relative path to directory where you store your thumbnails
// !! Thumbs must have the same name and format as the large picture !!
// $num_rows = number of rows to display on each page
// $photos_per_row = how many pictures you want to display on each row
//*****************************************************************************
$thumbnail_dir = "";
$num_rows = 10;
$photos_per_row = 5;
$photos = $retVal;
$total_photos = sizeof($photos);
$photos_per_page = $num_rows * $photos_per_row;
//check to see if the start variable exists in the URL.
//If not, then the user is on the first page - set start to 0
if(!isSet($start)){
$start = 0;
}
//init i to where it needs to start in the photos array
$i = $start;
$prev_start = $start - $photos_per_page;
$next_start = $start + $photos_per_page;
for ($row=0; $row < $num_rows; $row++){
print("<tr>\n");
for ($col=0; $col < $photos_per_row; $col++){
if($i < $total_photos){
$thumbnail = $thumbnail_dir.trim($photos[$i]);
$thumb_image_size = getimagesize($thumbnail);
$image_size = getimagesize(trim($photos[$i]));
print("<td align=\"center\">
<img src=\"".$thumbnail."\" ".$thumb_image_size[3]." border=\"0\"></a></td>\n");
} else {
print("<td></td>\n");
}
$i++;
}
print("</tr>\n");
}
//end table
?>
</table>
<div align="center">
<?PHP
// Page numbers
// calculate number of pages needing links
$pages=intval($total_photos/$photos_per_page);
// $pages now contains int of pages needed unless there is a remainder from division
if ($total_photos%$photos_per_page) {
// has remainder so add one page
$pages++;
}
for ($i=1;$i<=$pages;$i++) { // loop thru
$newstart=$photos_per_page*($i-1);
print "<a href=\"$PHP_SELF?start=$newstart\">$i</a>\n";
}
echo "<br>";
//print out navigation links
if(($start == 0) && ($next_start < $total_photos)){
//you're at the beginning of the photo gallery
?>
<?PHP
}
elseif (($start > 0) && ($next_start < $total_photos)){
//you're in the middle of the photo gallery
?>
<?PHP
}
elseif(($start == 0) && ($next_start > $total_photos)){
//you're in a photo gallery with only one page of photos
?>
<?PHP
}
else {
//you're at the end of the photo galley
?>
<?PHP } ?>
</div>
<br>
<!-- Gallery END //-->
</body>
</html>
<?PHP
// ** This needs to be here - at the very end **
//Clean up directory array
closedir($handle);
return $retVal;
?>