diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-11-19 12:00:25 -0500 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-11-19 12:00:25 -0500 |
commit | 4463768baed036b487d473a60b30f0c314ee1673 (patch) | |
tree | 5c617bf209239e36929117beda261778815756f9 /plugins/GeonamesPlugin.php | |
parent | ad0b9a7115dd0681b003f350bebcd6b6e39ea8b2 (diff) |
tobyink's location RDF patch
Diffstat (limited to 'plugins/GeonamesPlugin.php')
-rw-r--r-- | plugins/GeonamesPlugin.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/GeonamesPlugin.php b/plugins/GeonamesPlugin.php index 1d7381a80..59232c1c5 100644 --- a/plugins/GeonamesPlugin.php +++ b/plugins/GeonamesPlugin.php @@ -302,4 +302,28 @@ class GeonamesPlugin extends Plugin // it's been filled, so don't process further. return false; } + + /** + * Machine-readable name for a location + * + * Given a location, we try to retrieve a geonames.org URL. + * + * @param Location $location Location to get the url for + * @param string &$url Place to put the url + * + * @return boolean whether to continue + */ + + function onLocationRdfUrl($location, &$url) + { + if ($location->location_ns != self::LOCATION_NS) { + // It's not one of our IDs... keep processing + return true; + } + + $url = 'http://sw.geonames.org/' . $location->location_id . '/'; + + // it's been filled, so don't process further. + return false; + } } |