if (!isset($_SESSION)) { session_start(); } if (!isset($_COOKIE["cart_id"])) { $expire=time()+60*60*24*30; // 30 days $cart_id = mt_rand(1,1000000); setcookie("cart_id", $cart_id, $expire, "/"); } else { $cart_id = $_COOKIE["cart_id"]; } if (isset($_COOKIE["zipcode"])) { $zipcode = $_COOKIE["zipcode"]; } ?> // PRE-HEADER CODE ///////////// // Set $hdr_keywords, $hdr_description, and $webtitle // Price selection generator function do_price_pulldown_option($name, $desc, $size, $format, $price, $max_size) { $media = $size." ".$format; $id = "item_dim=$size&image_desc=$desc&image_id=$name&price=$price"; if ($max_size != "") $id .= "&matting_dim=$max_size"; $o = ""; return $o; } $file_id = $_GET["file_id"]; $start = $_GET["start"]; include 'statsi.inc'; include '../mysql.inc'; $mysqli = new mysqli("localhost", $username, $password, $dbuse); // Validate "file_id" to prevent malicious activity $x = explode("-", $file_id); $itsok = 0; // format NNNN-YYY if (strlen($x[0]) == 4 && strlen($x[1]) >= 2 && strlen($x[1]) <= 3) $itsok = 1; // format PAxxxxx or PBxxxxx if (strlen($file_id) == 8 && $file_id[0] == "P" && ($file_id[1] == "A" || $file_id[1] == 'B')) $itsok = 1; if (strlen($file_id) == 8 && $file_id[0] == "p" && ($file_id[1] == "a" || $file_id[1] == 'b')) $itsok = 1; // Format IMG_nnnnnn.m $x = explode("_", $file_id); if (($x[0] == "img" || $x[0] == "IMG") && strlen($x[1]) <= 8) $itsok = 1; // Check for anything specifically bad if (strstr($file_id, "<") > 0 || strstr($file_id, ">") > 0 || strstr($file_id, "\'") > 0) $itsok = 0; if (!$itsok) $file_id = "INVALID_NAME"; $result = $mysqli->query ("SELECT * FROM `photo` WHERE name='$file_id';"); if ($result) { $value = $result->fetch_object(); } else { $result = $mysqli->query ("SELECT * FROM `photo` WHERE alias='$file_id';"); // old ID if ($result) { $value = $result->fetch_object(); // $file_id = $value->id; // use the main file name } // else // { // echo "Query failed
".mysql_error(); // } } $picname=$file_id; $enable_buying = 1; if ($result) $result->free(); $filename=$picname.".jpg"; $hdr_keywords = "fine,art,nature,photography,photographs,pennsylvania,bucks,county,bucks county,sunsets,trees,farms,country,rural,natural,mountains,flowers,philadelphia,new,jersey,"; if ($value) { // Set $webtitle for use later in the Pinterest button if ($value->webtitle) $webtitle = $value->webtitle." Photo Art Print - ".$value->desc." - ".$value->location; else if ($value->location) $webtitle = $value->location." Photo Art Print - ".$value->desc; else $webtitle = $value->desc." Photo Art Print - ".$value->location; $webtitle .= " - Photography by Matt Schrier"; $hdr_keywords .= $value->keywords; $hdr_description = "Original Photograph, available as matted, unmatted, or framed print. Subject: $value->desc, $value->location"; } else { $webtitle = "Bucks County Photography by Matt Schrier"; $hdr_description = "Original Photographs, available as matted, unmatted, or framed print"; } ?>
echo "\n"; echo "\n"; echo "|
\n"; $picnamesafe = htmlentities($file_id); incrementVisits("photo_inv_$picnamesafe", $_SERVER['REMOTE_ADDR'], 0, ""); } else { incrementVisits("photo_$picname", $_SERVER['REMOTE_ADDR'] , 0, $_SERVER['HTTP_REFERER']); $img_src = imagecreatefromjpeg($img_source); $ww = imagesx($img_src); $hh = imagesy($img_src); $x = imagesx($img_src); $y = imagesy($img_src); $dd = $value->desc . ", " . $value->location; // Limit the image size, to fit the redesign of 2014 if ($ww > 500) $ww = 500; echo "
|
/////////////////////////////////////////////////////////////////////////
///// The description and other related links /////////
/////////////////////////////////////////////////////////////////////////
if ($value != 0)
{
echo " $value->location "; } ?> echo "Stock ID: $picname "; ?> echo " ![]() \n"; $l = encodelink("mailto:schrierphoto@gmail.com?subject=Photo Inquiry - Viewing: $value->desc ($picname)", "Inquire About this Photo"); // echo "
"; ?> Sign up for E-mail. Licensing: This image is available for Licensing. E-mail me. $doing_related = 0; if ($value->related1 != "" || $value->related2 != "" || $value->related3 != "") { $doing_related = 1; } if ($doing_related) { ?> You may also like ... |
Important Ordering Information - Please Read:
|