<?
include("header.html");
?>
<?
# program specific text
include($type.$year.".inc");
$portrait = array();
$landscape = array();
if ($dir = @opendir("./")) {
while (($file = readdir($dir)) !== false) {
if (ereg("(jpg)\$",$file) && ereg("^$type",$file) && ereg("$year",$file))
{
$imagesize = getimagesize("./".$file);
#print $file . "<br>";
# figure out landscape/portrait,for arrays
$wth = intval($imagesize[0]);
$hgt = intval($imagesize[1]);
if (intval($hgt) > intval($wth))
{
array_push($portrait, $file);
}
else
{
array_push($landscape, $file);
}
}
}
closedir($dir);
}
print "<pre>";
print_r ($landscape);
print "</pre>";
# rifle through arrays, grouping jpg orientations together.
foreach($landscape as $val)
{
print $val."<br>";
#$imagesize = GetImageSize("./".$val);
$wth = intval($imagesize[0]);
$hgt = intval($imagesize[1]);
$factor = 150;
$mult = $wth / $factor;
$phgt = $hgt / $mult;
$pwth = $wth / $mult;
#print "<a href='$val'><img src='$val' width=$pwth height=$phgt border=0></a>\n";
}
foreach($portrait as $val)
{
#print "$val<br>";
#$imagesize = GetImageSize("./".$val);
$wth = intval($imagesize[0]);
$hgt = intval($imagesize[1]);
$factor = 150;
$mult = $hgt / $factor;
$phgt = $hgt / $mult;
$pwth = $wth / $mult;
#print "<a href='$val'><img src='$val' width=$pwth height=$phgt border=0></a>\n";
}
include("footer.html");
?>