| Sponsoring | 
|
Dakdekkersbedrijf van Miltenburg is sponsor van judovereniging Barberio
//define the path as relative
$path = "../Fotos";
// read all html file in the current directory
if ($dh = opendir($path))
{
$dirs = array();
$i = 0;
while ($file = readdir($dh))
{
// put directory names in array
if (is_dir($path."/".$file) && $file != "." && $file != "..")
{
$dirs[$i] = $file;
$i++;
}
}
closedir($dh);
}
// Loop bottom to top
while ($i > 0)
{
$i--;
echo "| $dirs[$i] | \n";
//read all jpg files
$imagepath = $path."/".$dirs[$i];
if ($dh = opendir($imagepath))
{
$files = array();
$j = 0;
while ($file = readdir($dh))
{
if (substr($file, strlen($file) - 4) == '.jpg' || substr($file, strlen($file) - 4) == '.JPG')
{
$files[$j] = $file;
$j++;
}
}
closedir($dh);
// files sorteren op naam
asort($files);
// Toon de files
$td = 1;
foreach ($files as $file)
{
$title = Title($file);
echo " | \n";
$td++;
if ($td > 4)
{
$td = 1;
echo "";
}
}
}
echo " ";
}
// Function to get a human readable title from the filename
function Title($filename)
{
$title = substr($filename, 0, strlen($filename) - 4);
$title = str_replace('-', ' ', $title);
$title = ucwords($title);
return $title;
}
?>
|