Like Landscapes, Waterscapes hold a great interest for me, I have a fascination for water based subjects, if that water is ina great landscape all the better!
0 " )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result); // how many results did the query produce
// I dont do anything with this yet but will use for pages & null results...
$total_pages=round(($num_rows/$img_per_page)+0.4);
if ($page>$total_pages)
$page=$total_pages;
if ($page<0)
$page=0;
//echo $total_pages.' ';
print "
"; // nav bar for pages
print "";
if ($page>0)
print " ";
print " | ";
$pageplus=$page+1;
//echo 'Page Number'.$pageplus;
printf (" Page %s of %s | ",$pageplus,$total_pages);
print "";
if ($page+1<$total_pages)
print " ";
print " |
";
print "
";
print "
";
$offset_counter=$page*$img_per_page;
$img_read=0;
// loopthrugh the list (array) of items returned from the query
while (($img_displayed<$img_per_page)&&($get_info = mysql_fetch_row($result)) ){
$img_read++; // count to see how many read from db on page so far
if ($img_read>$offset_counter)
{
$img_displayed++; // count to see how many displayed on page so far
//echo $img_read.' '.$offset_counter.' '.$img_displayed;
$keyword=$get_info[4];
// get info[5] holds the filename, then hardcoded to my root photo folder.
// get_info[9] now holds the subfolder of the images, to make a search easier later
// also it means that no matter where the img is stored it can easily appear
// in several galleries depending on the keywords........
$imgpath='http://www.photography-sales.com/sk/photos/'.$get_info[9].'/'.$get_info[5];
$tnpath='http://www.photography-sales.com/sk/photos/'.$get_info[9].'/tn_'.$get_info[5];
//echo $tnpath;
//echo $imgpath; test to try outputting the built path
// Get dimensions of current image
list($width, $height, $type, $attr) = getimagesize($imgpath);
if ($width>$height)
$newwidth=250;
else
$newwidth=160;
// printf ("image #1",$get_info[5]); // old strin to test what is being pulled out he db for path...
print "
";
print "";
print "";
// image path + alt tag
print "";
printf (" ",$imgpath, $get_info[1],$tnpath, $get_info[1],$newwidth);
print " | ";
// print " ";
$prices=explode (',',$get_info[10]);
$sizes=explode (',',$get_info[11]);
$szcount=5;
$ext='1';
while ($szcount!=0)
{
if ( $sizes[$ext-1]!='')
{
$szimg='../gfx/size'.$ext.'b.jpg';
printf (" ",$szimg,$prices[$ext-1]);
}
$ext++;
$szcount--;
} // size loop while
print " | ";
print ""; // second outer TD
printf (" %s: %s",$get_info[1],$get_info[2]);
printf ("
%s ",$get_info[6]);
printf ("Keywords: %s ",$keyword);
//printf ("%s |%s |%s |%s |%s |%s ",$get_info[3], $get_info[4],$get_info[5], $get_info[6],$get_info[7], $get_info[8]); // more old debug printing..
print " |
";
}// if greater then offset then output
} //end of while
print " |
";
print "
"; // nav bar for pages
print "";
if ($page>0)
print " ";
print " | ";
$pageplus=$page+1;
//echo 'Page Number'.$pageplus;
printf (" Page %s of %s | ",$pageplus,$total_pages);
print "";
if ($page+1<$total_pages)
print " ";
print " |
";
print "
";
mysql_close($link);
?>