summaryrefslogtreecommitdiff
path: root/plugins/GeonamesPlugin.php
diff options
context:
space:
mode:
authorBrenda Wallace <shiny@cpan.org>2009-10-30 09:41:04 +1300
committerBrenda Wallace <shiny@cpan.org>2009-10-30 09:41:04 +1300
commitc0f8c0178a3cccead97fb0800a514b0ac9dbde64 (patch)
tree9d2f26feccaa85e73a7bc4985a1f899d9b89f730 /plugins/GeonamesPlugin.php
parent7f5fbee2e36889fae1d1c5043d76625e197e39ea (diff)
parent24c3a15124ab866bf7e9401f638156e102074608 (diff)
Merge commit 'mainline/0.9.x' into 0.9.x
Diffstat (limited to 'plugins/GeonamesPlugin.php')
-rw-r--r--plugins/GeonamesPlugin.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/GeonamesPlugin.php b/plugins/GeonamesPlugin.php
index 745cd4126..80ef44cc9 100644
--- a/plugins/GeonamesPlugin.php
+++ b/plugins/GeonamesPlugin.php
@@ -278,4 +278,28 @@ class GeonamesPlugin extends Plugin
return true;
}
+
+ /**
+ * Human-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 onLocationUrl($location, &$url)
+ {
+ if ($location->location_ns != self::NAMESPACE) {
+ // It's not one of our IDs... keep processing
+ return true;
+ }
+
+ $url = 'http://www.geonames.org/' . $location->location_id;
+
+ // it's been filled, so don't process further.
+ return false;
+ }
}