';
$q = 'select ID, Medium, Description from photos where GalleryID = ' . $page['GalleryID'] . ' order by Ord';
$r = mysql_query($q) or die(mysql_error() . '
' . $q);
$w = mysql_fetch_row($r);
$img = getimagesize(('images/photos/' . $w[1]));
if($img[0] > $img[1]) {
$style = 'width: 300px;';
} else{
$style = 'height: 300px;';
}
echo '
![' . $w[2] . '](http://' . $site_info['domain_name'] . '/images/photos/' . $w[1] . ')
';
$i = 2;
while($w = mysql_fetch_row($r)) {
$img = getimagesize(('images/photos/' . $w[1]));
if($img[0] > $img[1]) {
$style = 'width: 300px;';
} else{
$style = 'height: 300px;';
}
echo '
![' . $w[2] . '](http://' . $site_info['domain_name'] . '/images/photos/' . $w[1] . ')
';
$i++;
}
echo '