$sql = "select * from st_file_category where file_category_code = 'WALLPAPERS'";
$result = mysql_query($sql) or die(mysql_error());
$line = mysql_fetch_array($result);
$file_category_id = $line['file_category_id'];
?>
Landscape
$sql = "select * from st_file where file_category_id = '$file_category_id' and archived is null order by lastUpdated asc";
$result = mysql_query($sql) or die(mysql_error());
while($line = mysql_fetch_array($result))
{
extract($line, EXTR_PREFIX_ALL, "qry");
$image_path = "resources/100_$qry_fileName";
$image_size=getimagesize($image_path);
$image_width=$image_size[0];
$image_height=$image_size[1];
if($image_width > $image_height)
{
?>

}
}
?>
Portrait
$sql = "select * from st_file where file_category_id = '$file_category_id' and archived is null order by lastUpdated asc";
$result = mysql_query($sql) or die(mysql_error());
while($line = mysql_fetch_array($result))
{
extract($line, EXTR_PREFIX_ALL, "qry");
$image_path = "resources/100_$qry_fileName";
$image_size=getimagesize($image_path);
$image_width=$image_size[0];
$image_height=$image_size[1];
if($image_width < $image_height)
{
?>

}
}
?>
for($i=0; $i<$index; $i++)
{
//echo $arr_href[$i]." == ".$arr_title[$i]."
";
if($i == 0)
{
?>
}
else
{
if($i == $index-1)
{
$color = "color:#414141;";
}
else
{
$color = '';
}
?>
}
}
//
?>