//initialize session
session_start();
//set some global vars
$_SESSION["server_path"] = "/home/content/e/r/i/ericfriggin/html/_ef_images/hires/";
$_SESSION["lowres_path"] = "/home/content/e/r/i/ericfriggin/html/_ef_images/lowres/";
$_SESSION["thumbnail_path"] = "/_ef_images/thumbnails/";
$_SESSION["image_path"] = "/_ef_images/lowres/";
//database connection
global $my_conn;
if(!isset($my_conn)) $my_conn = mysql_connect("p3plcpnl0510.prod.phx3.secureserver.net","ericfriggin","FrigginRO1!");
if (!$my_conn) {
die('Could not connect to database.');
} else {
$db_selected = mysql_select_db("ericfriggin",$my_conn);
if (!$db_selected) die('Could not select database: ericfriggin');
mysql_set_charset('utf8',$my_conn);
}
//exif functions
include("/home/content/e/r/i/ericfriggin/html/apps/api/exif_functions.php");
?>
/apps/map.php | ericfriggin.com
if ( (isset($_GET["showGallery"])) && ($_GET["showGallery"]=="true") ) {
?>
if ( (isset($_GET["galleryId"])) && ($_GET["galleryId"]>0) ) {
$sql = "select gallery_id, name, description, map_center_lat, map_center_long, map_zoom_level from gallery where gallery_id=".$_GET["galleryId"];
$res = mysql_query($sql,$my_conn);
$gallery = mysql_fetch_assoc($res);
$sql="
SELECT p.photo_id, p.filename, p.description, p.latitude, p.longitude, c.camera_folder_name
FROM photo p, photo_to_gallery ptg, camera c
WHERE ptg.gallery_id=".$gallery["gallery_id"]."
AND p.photo_id=ptg.photo_id
AND p.public=1
AND c.camera_id = p.camera_id
ORDER BY p.filename, p.photo_id
";
// die($sql);
$res = mysql_query($sql,$my_conn);
$photo_count = 0;
while ($db_image = mysql_fetch_object($res)) {
$exifimage = $_SESSION["lowres_path"].$db_image->camera_folder_name.$db_image->filename;
$thumbimage = $_SESSION["thumbnail_path"].$db_image->camera_folder_name.$db_image->filename;
$imagehref = "/image.php?from=map&ga=".$_GET["galleryId"]."&im=".$db_image->photo_id;
if (file_exists($exifimage)) $exif_data_available = true;
if ( ($exif_data_available) && (isset($db_image->latitude)) && (isset($db_image->longitude)) ) {
?>
$photo_count++;
}
}
}
?>
//end gallery display
//begin check for single image display
} else if ( (isset($_GET["showImage"])) && ($_GET["showImage"]=="true") ) {
$sql="SELECT ptg.gallery_id, g.name FROM photo_to_gallery ptg, photo p, gallery g WHERE ptg.photo_id=".$_GET["imageId"]." AND p.photo_id=ptg.photo_id AND p.public=1 AND g.gallery_id=ptg.gallery_id";
$res = mysql_query($sql,$my_conn);
$gallery = mysql_fetch_assoc($res);
$_SESSION["gallery_id"] = $gallery["gallery_id"];
$sql="
SELECT p.photo_id, p.filename, p.description, pg.photographer_name, p.date, DATE_FORMAT(p.date, '%b %d, %Y') AS date_formatted, p.latitude, p.longitude, p.keywords, c.camera_folder_name
FROM photo p, camera c, photographer pg
WHERE p.photo_id=".mysql_real_escape_string($_GET["imageId"])."
AND p.public=1 AND c.camera_id = p.camera_id AND pg.photographer_id=p.photographer_id
";
$res = mysql_query($sql,$my_conn);
$db_image = mysql_fetch_assoc($res);
$exifimage = $_SESSION["lowres_path"].$db_image["camera_folder_name"].$db_image["filename"];
$thumbimage = $_SESSION["thumbnail_path"].$db_image["camera_folder_name"].$db_image["filename"];
$imagehref = "/image.php?from=map&ga=".$gallery["gallery_id"]."&im=".$db_image["photo_id"];
if (file_exists($exifimage)) $exif_data_available = true;
if ( (isset($db_image["latitude"])) && (isset($db_image["longitude"])) ) {
?>
} else if ($exif_data_available) {
?>
echo returnExifHTMLTable($exifimage);
?>
} else {
die("no lat/lon detected");
}
?>
} //end single image display
?>