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 ).
This commit is contained in:
parent
fe359ce21e
commit
73818d27ae
@ -1,13 +1,21 @@
|
|||||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||||
<? print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?>
|
<? print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?>
|
||||||
<markers>
|
<markers>
|
||||||
<? foreach ($items as $item) { ?>
|
<?
|
||||||
<? $item_coordinates = ORM::factory("exif_coordinate")->where("item_id", "=", $item->id)->find(); ?>
|
$thumb_arr=array();
|
||||||
<? $str_thumb_html = str_replace("&", "&", $item->thumb_img(array("class" => "g-exif-gps-thumbnail"))); ?>
|
$items_id=array();;
|
||||||
<? $str_thumb_html = str_replace("\'", "'", $str_thumb_html); ?>
|
foreach ($items as $item) {
|
||||||
<? $str_thumb_html = str_replace("<", "<", $str_thumb_html); ?>
|
array_push($items_id, $item->id);
|
||||||
<? $str_thumb_html = str_replace(">", ">", $str_thumb_html); ?>
|
$thumb_arr[$item->id] = $item->thumb_img(array("class" => "g-exif-gps-thumbnail"));
|
||||||
<? $str_thumb_html = str_replace("\"", """, $str_thumb_html); ?>
|
}
|
||||||
<marker lat="<?= $item_coordinates->latitude; ?>" lng="<?= $item_coordinates->longitude; ?>" url="<?= url::abs_site("exif_gps/item/{$item->id}"); ?>" thumb="<?=$str_thumb_html; ?>" />
|
$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);
|
||||||
|
?>
|
||||||
|
<marker lat="<?= $item_coordinates->latitude; ?>" lng="<?= $item_coordinates->longitude; ?>" url="<?= url::abs_site("exif_gps/item/$item_coordinates->item_id"); ?>" thumb="<?=$str_thumb_html; ?>" />
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</markers>
|
</markers>
|
||||||
|
Reference in New Issue
Block a user