1
Discussion & Troubleshooting / Re: Issue With Search
« on: April 25, 2017, 12:07:25 AM »
anyone?
4images code on GitHub Click here to visit GitHub.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
//############################ Start EXIF ##############################
if ($detailed_view ) {
global $site_db,$lang,$additional_image_fields;
$additional_field_sql = "";
foreach ($additional_image_fields as $key => $val){
$additional_field_sql .= ','.$key;
}
$sql = "SELECT image_id".$additional_field_sql."
FROM ".IMAGES_TABLE."
WHERE image_id = '$image_id'";
$result = $site_db->query($sql);
$row = mysql_fetch_object($result);
$GPSLongitude = $row->image_GPSLongitude;
$GPSLatitude = $row->image_GPSLatitude;
$bgcounter = 0;
foreach ($row as $key => $val) {
if ($val != "") {
$search_key = $key;
$url_val = '"' . $val . '"';
$val = (is_numeric($val)) ? round($val,6) : $val;
$key = str_replace('image_','',($key));
if (isset($lang['exif_'.$key])) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => "<a href=\"".$site_sess->url(ROOT_PATH."search.php?search_keywords=".urlencode($url_val))."&search_fields=$search_key \">".format_text($val)."</a>",
"exif_name" => $lang['exif_'.$key],
"row_bg_number" => $row_bg_number,
"image_lat" => $GPSLatitude,
"image_lon" => $GPSLongitude
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}
}
}
//########################### End Exif ###################################
if ($detailed_view && $image_info[2] == 2 && function_exists('exif_read_data') && $exif_data = @exif_read_data($src, 'EXIF')) {
$lens_info = get_lens_info($src);
$exif_array = get_exif_info($exif_data);
$bgcounter = 0;
foreach ($exif_array as $key => $val) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$site_template->register_vars(array(
"exif_value" => format_text($val),
"exif_name" => $lang['exif_'.$key],
"row_bg_number" => $row_bg_number
));
$exif_info .= $site_template->parse_template("exif_bit");
}
}