join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->viewable() ->order_by("exif_coordinates.latitude", "ASC") ->descendants(); $curr_album = ORM::factory("item")->where("id", "=", $type_id)->find_all(); $map_title = $curr_album[0]->title; } elseif ($map_type == "user") { // Generate an array of all items uploaded by the current user that // have exif gps coordinates and order by latitude (to group items // w/ the same coordinates together). $items = ORM::factory("item") ->join("exif_coordinates", "items.id", "exif_coordinates.item_id") ->where("items.owner_id", "=", $type_id) ->viewable() ->order_by("exif_coordinates.latitude", "ASC") ->find_all(); $curr_user = ORM::factory("user")->where("id", "=", $type_id)->find_all(); $map_title = $curr_user[0]->full_name . "'s " . t("Photos"); } // Make a new page. $template = new Theme_View("page.html", "other", "EXIFMap"); $template->page_title = t("Gallery :: Map"); $template->content = new View("exif_gps_map.html"); if ($map_title == "") { $template->content->title = t("Map"); } else { $template->content->title = t("Map of") . " " . $map_title; } // Figure out default map type. $int_map_type = module::get_var("exif_gps", "largemap_maptype"); if ($int_map_type == 0) $map_type = "ROADMAP"; if ($int_map_type == 1) $map_type = "SATELLITE"; if ($int_map_type == 2) $map_type = "HYBRID"; if ($int_map_type == 3) $map_type = "TERRAIN"; $template->content->map_type = $map_type; // When mapping an album, generate a "return to album" link. if (isset($curr_album)) $template->content->return_url = url::abs_site("{$curr_album[0]->type}s/{$curr_album[0]->id}"); // Load in module preferences. $template->content->items = $items; $template->content->google_map_key = module::get_var("exif_gps", "googlemap_api_key"); // Display the page. print $template; } }