real_escape_string($cat); $kwd = $mysqli->real_escape_string($kwd); if ($cat == "philadelphia") $cat = "philly"; if ($cat == "bucks_county") $cat = "Bucks"; if ($cat == "new_jersey") $cat = "jersey"; if ($cat == "travel") $cat = "california"; // retrive category information from the database if ($cat == "all") $result = $mysqli->query ("SELECT * FROM `photo` WHERE enable = 1"); else if ($cat != "") $result = $mysqli->query ("SELECT * FROM `photo` WHERE FIND_IN_SET(\"$cat\",cat) > 0 AND enable = 1 ORDER by `weighting` ASC"); else if ($kwd != "") $result = $mysqli->query ("SELECT * FROM `photo` WHERE keywords LIKE \"%$kwd%\" AND enable = 1 ORDER by `weighting` ASC"); if (!$result) { echo "Query failed

"; $numrows = 0; } else $numrows = $result->num_rows; $col = 0; $twid = 500; if ($cat != "") { $resultc = $mysqli->query ("SELECT * FROM `photocat` WHERE name = '$cat';"); if ($resultc) { $valuec = $resultc->fetch_object(); $catup = $valuec->display; $cattitle = "Pictures of ".$valuec->display; // get the version of the category for the URL (if needed) $urlcatkeyword = $valuec->urlkeyword; if ($urlcatkeyword == "") $urlcatkeyword = $cat; $resultc->free(); } else { $catup = ucfirst($cat); $urlcatkeyword = "fineartphotos"; } } else if ($kwd != "") { $catup = ucfirst($kwd)." Photos"; $cattitle = ucfirst($kwd)." Pictures"; } else $cattitle = ""; if ($cat == "all" || $kwd != "") { $keywords = build_keywords(""); echo "\n"; echo "$cattitle - Fine Art Photography by Matt Schrier\n"; } else { $keywords = build_keywords($catup); echo "\n"; echo "$cattitle - Fine Art Photography by Matt Schrier\n"; } if ($cat == "panoramic") { $numcolumns = 2; $grouping = 100; } else { $numcolumns = 3; $grouping = 9; } ?> // Add content here ?> \n"; echo "

$catup

"; if ($cat != "" && $cat != "all") echo "
".$valuec->verbiage.""; ?> fetch_object(); } $idx = $numrows; if (isset($start)) { if ($start == -1) { $grouping = $cnt; $start = 0; } else { $idx -= $start; if ($idx <= 0) { $cnt = 0; $start = -1; } // if ($idx > $numrows) // $idx -= $numrows; } } else $start = 0; if ($cnt > $grouping) $cnt = $grouping; while ($cnt > 0) { $overlay=""; $value = $res_array[$idx]; if ($value->award) { $overlay="&overlay=Award"; } if ($col == 0) $maincontent .= "\n"; // $maincontent .= "\n"; if (++$col == $numcolumns) { $maincontent .= ""; $col = 0; } $cnt -= 1; if ($cnt == 0 && $col > 0) $maincontent .= ""; $idx -= 1; if ($idx == 0) { if ($col > 0) $maincontent .= ""; $cnt = 0; } } if ($cat == "" && $kwd != "") $url_insert = "kwd=$kwd"; else $url_insert = "cat=$cat"; if (isset($start) && $start >= 0) { if ($cat == "panoramic") { $navcontent = ""; } else { $groups = round(($numrows / $grouping) + 0.49999, 0); $gr0 = round(($start / $grouping) + 0.49999, 0) + 1; $gr1 = $gr0-1; $gr2 = $gr0+1; $navcontent .= "\n"; } } if ($numrows > 0) { echo $navcontent; if ($cat != "panoramic") { if ($numcolumns == "2") echo ""; else echo ""; } echo $maincontent; if ($cat != "panoramic") { if ($numcolumns == "2") echo ""; else echo ""; } echo $navcontent; if ($cat != '') incrementVisits("photo_cat_$cat", $_SERVER['REMOTE_ADDR'], 0, $_SERVER['HTTP_REFERER']); else if ($kwd != '') incrementVisits("photo_tag_$kwd", $_SERVER['REMOTE_ADDR'], 0, $_SERVER['HTTP_REFERER']); } else { echo "Sorry - nothing here. Please choose a Gallery from the list above."; } if ($result) $result->free(); $mysqli->close(); ?>
"; $maincontent .= ""; $id4 = sprintf("%04d", $value->id); $nameloc = $value->desc . ", " . $value->location; $urlkeyword = $value->urlkeyword; if ($urlkeyword == "") $urlkeyword = $urlcatkeyword; if ($cat == "panoramic") { $idalt = ""; if ($value->filename != "") $idalt = "&idalt=$value->filename"; // $maincontent .= "name\">name$idalt&max_dim=250&alt_dim=125\" title=\"$nameloc\" alt=\"$value->desc\" />"; $maincontent .= "name/$urlkeyword/\">name$idalt&max_dim=250&alt_dim=125\" title=\"$nameloc\" alt=\"$value->desc\" />"; } else { $idalt = ""; if ($value->filename != "") $idalt = "&idalt=$value->filename"; $u = photoURL($value->name, $urlkeyword); $maincontent .= "name$idalt&size=T&fsize=3&msize=10".$overlay."\" title=\"$nameloc\" alt=\"$value->desc\" />"; } $maincontent .= "\n"; $maincontent .= "
$value->desc
$value->location\n"; $maincontent .= "
\n"; $maincontent .= "
"; if ($start - $grouping >= 0) { $navcontent .= "« View Previous $grouping\n"; } $navcontent .= ""; $e = (($start + $grouping) > $numrows) ? $numrows : ($start + $grouping); $s = $start + 1; $navcontent .= "[ Viewing $s-$e of $numrows ]"; $navcontent .= ""; if ($start + $grouping < $numrows) { $i = (($start + 2*$grouping) > $numrows) ? ($numrows - ($start + $grouping)) : ($grouping); $navcontent .= "View Next $i »\n"; } $navcontent .= "