[datapress] r162 committed - added geocoding hook on client side

1 view
Skip to first unread message

codesite...@google.com

unread,
Mar 30, 2011, 5:04:36 PM3/30/11
to datapres...@googlegroups.com
Revision: 162
Author: edward.benson
Date: Wed Mar 30 14:03:30 2011
Log: added geocoding hook on client side
http://code.google.com/p/datapress/source/detail?r=162

Modified:
/trunk/plugin/head-datasources.php
/trunk/plugin/head-exhibit.php
/trunk/plugin/head.php
/trunk/plugin/wp-exhibit-geocoder.php

=======================================
--- /trunk/plugin/head-datasources.php Wed Mar 30 12:05:17 2011
+++ /trunk/plugin/head-datasources.php Wed Mar 30 14:03:30 2011
@@ -11,9 +11,10 @@
foreach($exhibit_to_show->get('datasources') as $datasource) {
echo($datasource->htmlContent() . "\n");
}
+

if(WpExhibitGeocoder::doesExhibitContainGeocodedData($exhibit_to_show->get('id')))
{
- echo("<link href='$exhibituri/wp-exhibit-geocode.php?exhibit-id=" .
$exhibit_to_show->get('id') . "' type='application/json' rel='exhibit/data'
alt='geocoded_data' />\n");
- }
- }
+ echo("<link
href='$exhibituri/wp-exhibit-geocode.php?exhibit-id=" .
$exhibit_to_show->get('id') . "' type='application/json' rel='exhibit/data'
alt='geocoded_data' />\n");
+ }
+}
}
?>
=======================================
--- /trunk/plugin/head-exhibit.php Wed Dec 1 13:17:04 2010
+++ /trunk/plugin/head-exhibit.php Wed Mar 30 14:03:30 2011
@@ -34,7 +34,7 @@
}

echo('<script type="text/javascript">');
- include('head-start-exhibit.js');
+ include('head-start-exhibit.js.php');
echo('</script>');
}
}
=======================================
--- /trunk/plugin/head.php Tue Mar 31 13:14:07 2009
+++ /trunk/plugin/head.php Wed Mar 30 14:03:30 2011
@@ -28,8 +28,8 @@
*/
if (isset($lightboxed_exhibit) && ($lightboxed_exhibit != NULL)) {
// Weire inside the lightbox
- include('head-datasources.php');
- include('head-exhibit.php');
+ include('head-exhibit.php');
+ include('head-datasources.php');
}
else {
// We're not inside the lightbox
=======================================
--- /trunk/plugin/wp-exhibit-geocoder.php Wed Mar 30 12:27:20 2011
+++ /trunk/plugin/wp-exhibit-geocoder.php Wed Mar 30 14:03:30 2011
@@ -27,6 +27,15 @@
}
return false;
}
+
+ static function getGeocodedFieldsForExhibit($exhibit_id) {
+ global $wpdb;
+ $table =
WpExhibitConfig::table_name(WpExhibitConfig::$GEOCODE_TABLE_KEY);
+ $query = "SELECT DISTINCT addressField FROM $table WHERE exhibit_id
= %d";
+ $query = $wpdb->prepare($query, $exhibit_id);
+ return $wpdb->get_col($query);
+ }
+
//look up the lat and lng for a given exhibit, data set, and address.
//If not found, geocode and store in table
static function lookup($exhibit_id, $address_field, $datum_id,
$address) {

Reply all
Reply to author
Forward
0 new messages