include 'statsi.inc'; include '../mysql.inc'; $cat = $_GET["cat"]; $kwd = $_GET["kwd"]; $start = $_GET["start"]; $mysqli = new mysqli("localhost", $username, $password, $dbuse); // handle new category identifiers, convert to legacy if (!isset($cat)) $cat = ""; if (!isset($kwd)) $kwd = ""; // Security $cat = $mysqli->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 "
$catup"; if ($cat != "" && $cat != "all") echo "".$valuec->verbiage.""; ?> |
| "; $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\"> $value->desc $value->location\n"; $maincontent .= "\n"; $maincontent .= " | \n";
if (++$col == $numcolumns)
{
$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 .= " |