include("A.php");
function cmp($a, $b)
{
return strcmp($b[0], $a[0]);
}
function printSeason($dirname, $headline) {
echo "".$headline."
";
echo "
";
echo "Filnamn | ";
echo "Uppdaterad | ";
echo "Antal bilder |
";
$dirpath = "bilder/".$dirname."/";
$dir = opendir($dirpath);
$i = -1;
while (false !== ($file = readdir($dir))) {
$localpath = $dirpath.$file;
if (is_dir($localpath) && $file != "." && $file != "..") {
$i++;
$handle = opendir($localpath);
$c = 0;
$key = 0;
$temp_key = 0;
while (false !== ($temp = readdir($handle))) {
$c++;
// $temp_key = date("Ymd",filemtime($localpath."/".$temp));
// if($temp_key > $key) {
// $key = $temp_key;
// $galleries[$i][0] = $key;
// $galleries[$i][2] = date("j M Y",filemtime($localpath."/".$temp)); //Last modified date
// }
}
$galleries[$i][1] = $c; //Number of pictures
$galleries[$i][3] = $file;
$galleries[$i][0] = date("Ymd",filemtime($localpath."/."));
$galleries[$i][2] = date("j M y",filemtime($localpath."/.")); //Last modified date
closedir($handle);
}
}
closedir($dir);
usort($galleries, "cmp");
for($i=0; $i < count($galleries); $i++) {
echo " | ", $galleries[$i][2], " | ";
echo "", $galleries[$i][1] - 2, " bilder |
\n";
}
echo "
";
echo "
\n\n";
}
echo "Galleri
";
printSeason("1314", "Säsongen 13/14");
printSeason("1213", "Säsongen 12/13");
printSeason("1112", "Säsongen 11/12");
printSeason("1011", "Säsongen 10/11");
printSeason("0910", "Säsongen 09/10");
printSeason("0809", "Säsongen 08/09");
printSeason("0708", "Säsongen 07/08");
printSeason("0607", "Säsongen 06/07");
printSeason("0506", "Säsongen 05/06");
printSeason("0405", "Säsongen 04/05");
printSeason("0304", "Säsongen 03/04");
printSeason("0203", "Säsongen 02/03");
include("B.php");
?>