From 73818d27aefd2b0961deebbf096da846cbd635f5 Mon Sep 17 00:00:00 2001 From: rWatcher Date: Tue, 11 Dec 2012 19:46:31 -0500 Subject: [PATCH] Forum User bozek fix to cut back on the number of database queries used by EXIF_GPS ( http://gallery.menalto.com/node/109227#comment-399841 ). --- .../views/exif_gps_coordinates_xml.html.php | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php b/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php index c858a236..caedf8b2 100644 --- a/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php +++ b/3.0/modules/exif_gps/views/exif_gps_coordinates_xml.html.php @@ -1,13 +1,21 @@ \n"; ?> - -where("item_id", "=", $item->id)->find(); ?> -thumb_img(array("class" => "g-exif-gps-thumbnail"))); ?> - - -", ">", $str_thumb_html); ?> - - id}"); ?>" thumb="" /> +id); +$thumb_arr[$item->id] = $item->thumb_img(array("class" => "g-exif-gps-thumbnail")); +} +$item_coordinates_all = ORM::factory("exif_coordinate")->where("item_id", "IN", $items_id)->find_all(); +foreach ($item_coordinates_all as $item_coordinates) { +$str_thumb_html = str_replace("&", "&", $thumb_arr[$item_coordinates->item_id]); +$str_thumb_html = str_replace("\'", "'", $str_thumb_html); +$str_thumb_html = str_replace("<", "<", $str_thumb_html); +$str_thumb_html = str_replace(">", ">", $str_thumb_html); +$str_thumb_html = str_replace("\"", """, $str_thumb_html); +?> +item_id"); ?>" thumb="" />